This is the accompanying code-base for the paper (NOTE: Paper available soon):
Adaptive Splitting of Reusable Temporal Monitors for Rare Traffic Violations
To install required libraries, run:
pip install -r requirements.txt
The MPC-controller for the Automated Vehicle uses Gurobi for Non-Linear Program Solving, so you will need a License.
To run PEM experiments using standard monte-carlo sampling, use:
python GrountTruthNaive.py <num-experiments> <exp_name> <save_root>
Where arguments are:
num-experiments
- the number of simulations that will be sampledexp-name
- The name of the experiment (used to create file names)save-root
- The root folder where results will be saved
To run PEM experiments using the Imp-CE
baseline, use:
python ScenarioImportanceSampling.py <num-experiments> <rule-name> <exp-name> <save-root>
Where arguments are:
num-experiments
- The number of simulations that will be sampledrule-name
- Determines which rule is used for cross-entropy learning. Choose betweenrg_1
,rg_2
,rg_4
, andri_1
(Corresponding to rules given in ) Formalization of Interstate Traffic Rules in Temporal Logicexp-name
- The name of the experiment (used to create file names)save-root
- The root folder where results will be saved
To run PEM experiments using STL-AMS
, use:
python adaptiveMultilevelSplit.py <num-experiments> <discard-prop> <rule-name> <exp-name> <save-root>
Where arguments are:
num-experiments
- The number of simulations that will be sampleddiscard_prop
- Sets discard amountK
asdiscard_prop * num-experiments
rule-name
- Determines which rule is used for cross-entropy learning. Choose betweenrg_1
,rg_2
,rg_4
, andri_1
(Corresponding to rules given in ) Formalization of Interstate Traffic Rules in Temporal Logicexp-name
- The name of the experiment (used to create file names)save-root
- The root folder where results will be saved
The animate_with_predictions
function (available in anim_utils.py
) can added to the end of a script to produce an animated visual of a sampled scenario: