Skip to content

Latest commit

 

History

History

simulation

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

COVID-19 simulation of the initial phase in Slovakia

The simulation is for the initial phase of the epidemic in Slovakia, based on Stochastic Simulation of the Initial Phase of the COVID-19 Epidemic in Slovakia by the statistician Radoslav Harman. Some visualization tools for the simulation also sit in the ../python/ directory.

Simulation of total confirmed COVID-19 cases in Slovakia

Building using Conan

Conan is able to download the dependencies and compile the project. However, you still need OpenMP on your system, though that usually comes installed with the compiler (for Clang, you need to also install libomp).

If you've never used Conan, you need to configure it first.

conan profile new default --detect
conan profile update settings.compiler.libcxx=libstdc++11 default

Once configured, you can create the package.

conan create .
# Alternatively, adding '-o growth_type=exponential' creates a binary with simulated exponential growth.

Running and viewing protobuf files

conan install -g virtualrunenv 'COVID-19-simulation/1.0.0@'
source activate_run.sh
simulation Slovakia.data
source deactivate_run.sh  # deactivate once you're done
# The simulation creates a proto file 'polynomial.sim' or 'exponential.sim', which can be examined using protoc
cat polynomial.sim | protoc --decode SimulationResults src/simulation_results.proto

You can visualize the simulation in graphs. See the covid_graphs README for examples.

Conan can be used to install protoc. This is especially useful on Debian-based systems, which have an old version.

conan install -g virtualrunenv 'protoc_installer/[>=0]@bincrafters/stable'
source activate_run.sh && protoc --decode ...  # More information on protoc usage is above
...
source deactivate_run.sh  # deactivate once you're done

Building using CMake [NOT RECOMMENDED]

This method is not recommended, since Debian-based systems including Ubuntu ship a very old version of the protobuf library (3.6). This clashes with the version used by our visualizations. If you do not want to create any graphs or your system runs a newer version of the protobuf library (we tested 3.9 and 3.11), then the CMake method works too.

You need googletest, protobuf and OpenMP installed (usually comes with the compiler). You can also use the Dockerfile in the root of the repository, which has all the dependencies installed.

mkdir build && cd $_
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .