Version: Jan 2024
This is the source code of a model used to study how uncertainty about performance and safety of autonomous vehicles influences the success of two prototypical strategies governing the producers’ timing of the release of new models.
These instructions will allow you to run the model on your system.
To run the code you need to install Julia (v1.10.0). Additionally, the following packages need to be installed:
- Agents - Version 5.17.1
- ArgParse - Version 1.1.4
- CSV - Version 0.10.11
- DataFrames - Version 1.6.1
- DataStructures - Version 0.18.15
- Distributions - Version 0.25.104
- Plots - Version 1.39.0
- StatsBase - Version 0.34.2
- StatsPlots - Version 0.14.33
- TensorCast - Version 0.4.6
In order to install a package, start julia and execute the following command:
using Pkg; Pkg.add("<package name>")
The model implementation is located in the model/ folder. In order to run the model, the initial state has to be set-up. Our baselinite initialization is specified in the experiments/init_duopoly_survey.jl file. By default, the subset of data stored during a simulation run is defined in the experiments/data_collection_duopoly.jl file.
To conduct an experiment and execute several runs of the model (batches) in parallel, execute run_exp.jl. This requires to set-up the experiment(s) in a configuration file, see experiments/baseline.jl as an example. In order to execute an experiment, use the following command:
julia -p <no_cpus> run_exp.jl <config-file> [--chunk <i>] [--no_chunks <n>]
The julia parameter -p <no_cpus> specifies how many cpu cores will be used in parallel. The --chunk and --no_chunk parameters are optional and can be used to break up the experiment into several chunks, e.g. to distribute execution among different machines.
Plots from experiments can be created by using the following command:
julia plot_exp.jl <config-file>
By default, data and plots will be stored in the data/ folder.
To reproduce the results from the paper by re-simulating the model, use the following commands:
julia -p <no_cpus> run_exp.jl experiments/baseline.jl
julia -p <no_cpus> run_exp.jl experiments/flat_tech.jl
julia -p <no_cpus> run_exp.jl experiments/no_cons_het.jl
julia -p <no_cpus> run_exp.jl experiments/no_uncertainty.jl
julia -p <no_cpus> run_exp.jl experiments/using_uncertainty.jl
julia -p <no_cpus> run_exp.jl experiments/motor_shows_baseline.jl
julia -p <no_cpus> run_exp.jl experiments/motor_shows_experiments.jl
The resulting data will be stored in data/, which by default contains the data used to create the plots in the paper.
In order to recreate all plots from the paper, run:
julia plots_paper.jl
julia plots_motor_shows.jl
We conducted a survey among German car owners and sampled from a kernel density estimation (KDE) to populate the model with heterogenous agents. The original survey data (in SPSS Statistics file format) as well as the data sampled from the KDE (as CSV files) can be found in the data/ folder.
Herbert Dawid, Dirk Kohlweyer, Melina Schleef, Christian Stummer