Skip to content

Latest commit

 

History

History

simulator

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Contact Simulator

The contact simulator is a simple Java command line tool that can be used to generate a sample contact graph to be used for functional and scale testing.

The simulator is fairly simplistic in the model it uses and emphasizes quickly generating large scale contact graphs over sophisticated movement models. The point of the simulator is not to produce realistic contact graphs but to product large data graphs quickly without a lot of resources.

The simulator uses a simple 1-dimensional model where the individuals that are being simulated are positioned on a circle. Each hour and for each individual we sample uniformly at random to determine if that individual is getting in contact with another individual during that time period. If so, we draw an individual uniformly at random within a specified maximum distance.

Additional parameters can be specified to determine how the length of the exposure is sampled.

Most of the distributions that the simulator samples from are uniform. That is an unrealistic assumption but good enough for test data.

How to run the simulator

mvn package -DskipTests which builds the simulator.

To generate contact data for 100 individuals over a 28 day period into the ../data/ directory, run the following command:

java -jar target/covid19-simulator-0.1-SNAPSHOT-jar-with-dependencies.jar -f ../data/test_ -n 100 -l 672 -d 5 -p 0.02

The command includes the following command line options:

  • f: The prefix of the output files that are being generated. The simulator generates 4 csv files that all share this prefix.
  • n: The number of people to simulate.
  • l: The length of the time period to simulate in hours (672 hours = 4 weeks).
  • d: The maximum distance a person "travels" to contact another person.
  • p: The probability that an individual makes contact within a given hour.

Run the command without any options to see the full list of options with descriptions.