The adaptiveSpreadX
Python Package is a simulation tool designed for modeling and analysing spreading dynamics on adaptive contact networks. It is based on the SSATAN-X algorithm and enables users to simulate various spreading processes with adaptability and precision. This project is a good fit for researchers, developers, and anyone interested in studying the behavior of spreading dynamics.
$ git clone https://github.com/nmalysheva/adaptiveSpreadX
$ pip install ./adaptiveSpreadX
Please note that a C++17 compiler and pybind11 must be installed on your system before you can install adaptiveSpreadX
.
At the moment it is still necessary to provide a configuration file containing all required settings and input variables. Details on the configuration file can be found here
import adaptiveSpreadXas asx
import matplotlib.pyplot as plt
tEnd = 5
timestepsCompare = np.linspace(0, tEnd, int((tEnd - 0.0) / 0.5) + 1)
# Initialize network and configure simulation parameters
config = asx.Configuration("config.txt")
network = asx.ContactNetwork(config)
# Run the simulation
sresult = asx.run(config, network)
# Visualize results
asx.plot_mean_new_state_changes(result_map, timesteps=timestepsCompare)
import adaptiveSpreadXas asx
import matplotlib.pyplot as plt
tEnd = 5
timestepsCompare = np.linspace(0, tEnd, int((tEnd - 0.0) / 0.5) + 1)
if __name__ == "__main__":
config = asx.Configuration("config.txt")
network = asx.ContactNetwork(config)
n_simulations = 10
result_map = asx.run_parallel(5, n_simulations, "config.txt")
# Visualize cumulative esults
asx.plot_mean_cumulative(result_map, timesteps=timestepsCompare)
For any queries or suggestions, please feel free to reach out to us at todo](mailto:todo).