8000 GitHub - nmalysheva/adaptiveSpreadX
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

nmalysheva/adaptiveSpreadX

Repository files navigation

adaptiveSpreadX

Description

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.

Installation

$ 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.

Quick start

Configuration file

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

One trajectory simulation and visualisation

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)

Parallel simulation of several trajectories and aggregated visualisation

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)

Contact

For any queries or suggestions, please feel free to reach out to us at todo](mailto:todo).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0