You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
Go to file
J. Fernando Sánchez feab0ba79e Large set of changes for v0.30
The examples weren't being properly tested in the last commit. When we fixed
that a lot of bugs in the new implementation of environment and agent were
found, which accounts for most of these changes.

The main difference is the mechanism to load simulations from a configuration
file. For that to work, we had to rework our module loading code in
`serialization` and add a `source_file` attribute to configurations (and
simulations, for that matter).
1 year ago
docs Large set of changes for v0.30 1 year ago
examples Large set of changes for v0.30 1 year ago
soil Large set of changes for v0.30 1 year ago
tests Large set of changes for v0.30 1 year ago
.dockerignore Fix Windows bug 4 years ago
.gitignore Partial MESA compatibility and several fixes 3 years ago
.gitlab-ci.yml CI: delay PyPI check 2 years ago
CHANGELOG.md Large set of changes for v0.30 1 year ago
Dockerfile Python3.7, testing and bug fixes 6 years ago
LICENSE Create LICENSE 8 years ago
MANIFEST.in 0.13.8 5 years ago
Makefile Avoid writing gexf in test 5 years ago
README.md Clean-up 2 years ago
debug.py WIP soil 7 years ago
docker-compose.yml Python3.7, testing and bug fixes 6 years ago
logo_gsi.png added logos 7 years ago
logo_gsi.svg Added GSI logo 7 years ago
requirements.txt Big refactor v0.30 1 year ago
setup.cfg Python3.7, testing and bug fixes 6 years ago
setup.py WIP: all tests pass 2 years ago
test-requirements.txt WIP 2 years ago

README.md

SOIL

Soil is an extensible and user-friendly Agent-based Social Simulator for Social Networks. Learn how to run your own simulations with our documentation.

Follow our tutorial to develop your own agent models.

Note: Mesa 0.30 introduced many fundamental changes. Check the documention on how to update your simulations to work with newer versions

SOIL vs MESA

SOIL is a batteries-included platform that builds on top of MESA and provides the following out of the box:

  • Integration with (social) networks
  • The ability to more easily assign agents to your model (and optionally to its network):
    • Assigning agents to nodes, and vice versa
    • Using a description (e.g., 2 agents of type Foo, 10% of the network should be agents of type Bar)
  • Several types of abstractions for agents:
    • Finite state machine, where methods can be turned into a state
    • Network agents, which have convenience methods to access the model's topology
    • Generator-based agents, whose state is paused though a yield and resumed on the next step
  • Reporting and data collection:
    • Soil models include data collection and record some data by default (# of agents, state of each agent, etc.)
    • All data collected are exported by default to a SQLite database and a description file
    • Options to export to other formats, such as CSV, or defining your own exporters
    • A summary of the data collected is shown in the command line, for easy inspection
  • An event-based scheduler
    • Agents can be explicit about when their next time/step should be, and not all agents run in every step. This avoids unnecessary computation.
    • Time intervals between each step are flexible.
    • There are primitives to specify when the next execution of an agent should be (or conditions)
  • Actor-inspired message-passing
  • A simulation runner (soil.Simulation) that can:
    • Run models in parallel
    • Save results to different formats
  • Simulation configuration files
  • A command line interface (soil), to run multiple
  • An integrated debugger (soil --debug) with custom functions to print agent states and break at specific states

Nevertheless, most features in SOIL have been designed to integrate with plain Mesa. For instance, it should be possible to run a mesa.Model models using a soil.Simulation and the soil CLI, or to integrate the soil.TimedActivation scheduler on a mesa.Model.

Note that some combinations of mesa and soil components, while technically possible, are much less useful or even wrong. For instance, you may add any soil.agent agent (except for the soil.NetworkAgent, as it needs a topology) on a regular mesa.Model with a vanilla scheduler from mesa.time. But in that case the agents will not get any of the advanced event-based scheduling, and most agent behaviors that depend on that will greatly vary.

Changes in version 0.3

Version 0.3 came packed with many changes to provide much better integration with MESA. For a long time, we tried to keep soil backwards-compatible, but it turned out to be a big endeavour and the resulting code was less readable. This translates to harder maintenance and a worse experience for newcomers. In the end, we decided to make some breaking changes.

If you have an older Soil simulation, you have two options:

  • Update the necessary configuration files and code. You may use the examples in the examples folder for reference, as well as the documentation.
  • Keep using a previous soil version.

Citation

If you use Soil in your research, don't forget to cite this paper:

@inbook{soil-gsi-conference-2017,
    author = "S{\'a}nchez, Jes{\'u}s M. and Iglesias, Carlos A. and S{\'a}nchez-Rada, J. Fernando",
    booktitle = "Advances in Practical Applications of Cyber-Physical Multi-Agent Systems: The PAAMS Collection",
    doi = "10.1007/978-3-319-59930-4_19",
    editor = "Demazeau Y., Davidsson P., Bajo J., Vale Z.",
    isbn = "978-3-319-59929-8",
    keywords = "soil;social networks;agent based social simulation;python",
    month = "June",
    organization = "PAAMS 2017",
    pages = "234-245",
    publisher = "Springer Verlag",
    series = "LNAI",
    title = "{S}oil: {A}n {A}gent-{B}ased {S}ocial {S}imulator in {P}ython for {M}odelling and {S}imulation of {S}ocial {N}etworks",
    url = "https://link.springer.com/chapter/10.1007/978-3-319-59930-4_19",
    volume = "10349",
    year = "2017",
}

@Copyright GSI - Universidad Politécnica de Madrid 2017-2021

SOIL