-
Notifications
You must be signed in to change notification settings - Fork 28
Uncertainty Module
A generic uncertainty module written in Python.
Design Goals
- To design a generic module for uncertainty that can take into account multiple factors for calculating uncertainty.
- To work with external scheduler or simulator in runtime.
- To improve the current model with feedback loop later.
Overview of Approach
We will use normal distribution to model uncertainty at various places in our simulator. The uncertainty can be thought of as variance around the mean for a gaussian distribution and hence the problem reduces to finding the ideal variance to model uncertainty using different factors. Not only do we need to know the factors that should account the variance/uncertainty but also their relation to uncertainty. For instance, frequency of scheduling for the simulator has an inverse relation to uncertainty i.e more the frequency, lesser the model uncertainty. This module will be extensible for adding new factors for uncertainty later on. The basic block diagram for the module is shown below:

Model Inputs
-
Scenario file - The original scenario file without perturbations .i.e perfect scenario. The format should be TSV.
-
Factors file - This file will contain all possible factors that can contribute to uncertainty and their relation to uncertainty i.e prior belief. The format of input will be ' <Relation: DIRECT/INVERSE>. For example frequency of scheduling will be encoded as 'Frequency 10 INVERSE' where 3 denotes reschedule every 10 minutes.
-
Column list as system argument - This will denote the comma-separated list of columns to be changed in the scenario file through uncertainty. This is to support any generic file in future for uncertainty. For our current scenario file, we will be changing entry time and active time that is columns 12,13.
Model Output
The output of the module will be a uncertainty encoded scenario file having the column values changes as listed in the input.
Calculating uncertainty
We already have the perfect scenario values in our cases which should be the expected mean in the gaussian distribution. To calculate the variance, we will take the factors file and for each factor either take the value directly (DIRECT) or invert it (INVERSE) and take the sum of these values as the uncertainty. We will sample the new value of the column from this gaussian distribution. Future approaches will try learning weights of this factors to determine the optimum combination of factors for calculating variance.
Open questions
- We want to be able to incorporate a feedback loop to improve this basic model in future. One approach is to improve the way we calculate variance based on the given factors. To identify the optimum weights of the external factors, we might need to run several simulations with different scenario and learn weights via regression.
Upcoming POC
- Will .ini file better than tsv files?
- What about putting the parameters under
uncertainty_params/? Like:
.
├── uncertainty.py
└── uncertainty_params
├── default.ini
├── high.ini
└── low.ini
- Integration with the simulator could be like this:
In simulation:
$ ./simulator --airport sfo --uncertainty-config-file uncertainty_params/high.ini
from uncertainty import Uncertainty
class Simulation:
uncertainty = Uncertainty()
...
def __init__():
...
uncertainty.setConfigFile(params.uncertain_config_file)
In usage:
from simulation import Simulation
uc = Simulation.uncertainty
aircraft.move_at_v(uc.get_uncertain_on(self.expected_v))