This script contains functions for generating a simulation scene, and also for logging and writing data to a file (given a SceneRecord
per episode.)
For generation of an evaluation scene, the following functions matter:
make_scene(...)
takes a Julia dictionary of parameters to create the simulation scene. If empty, default values are used.dict_to_params(...)
converts the Julia dictionary to a Julia structure of typeHRIParams
.get_vehicle(...)
returns oneVehicle
object to be pushed into the scene.populate_scene(...)
creates the simulation scene based on all parameters.
For logging,
get_sim_data(...)
goes through aSceneRecord
to calculate the metrics of interest.- These include time to merge, minimum distance to other vehicles, average offset from desired lane (assumed to be the one to the right of the starting lane), and the time profile of this offset and the egovehicle's velocity.
write_data(...)
writes the logged data to a file.
The variable DATADIR
must be set properly. The folder should contain subfolders for each simulation experiment (e.g. one folder each for experiments with aggressive, cooperative, and mixed drivers). These subfolders should contain the files generated by write_data(...)
for each episode.
parse.py
will create a folderresults
insideDATADIR
, which in turn will contain subfolders named the same as those inDATADIR
.- These subfolders will contain a few files,
- Histograms of times to merge, minimum distances to other vehicles, and average offsets from desired lane.
- A
summary.dat
file that contains (in order): success percentage, merge time statistics (mean +- stddev), minimum distance statistics (mean +- stddev), average offset statistics (mean +- stddev). - A
metrics.dat
file that contains (in order): number of successes, total number of episodes, merge times, minimum distances, average offsets. - Two
NumPy
matrices that have 3 columns each. The columns, in order, are means, lower bound, and upper bound. The rows correspond to timesteps of episodes.vels.npy
contains the egovehicle velocity profile information, andoffsets.npy
contains the offset from desired lane information.
Logging and parsing has not been tested.
Developed by Dhruv Mauria Saxena as part of his internship at Honda Research Institute, USA.