Commit Graph

53 Commits (master)

Author SHA1 Message Date
J. Fernando Sánchez 25d042f16c v1.0.0rc11 4 weeks ago
J. Fernando Sánchez f49be3af68 1.0pre4 1 year ago
J. Fernando Sánchez 55bbc76b2a Improve tutorial
* Improve text
* Move to docs
* Autogenerate with sphinx
* Fix naming issue `environment.run` (double name)
* Add to tests
1 year ago
J. Fernando Sánchez 93d23e4cab Add tutorial test to CI/CD 1 year ago
J. Fernando Sánchez 4e296e0cf1 Merge branch 'mesa' 1 year ago
J. Fernando Sánchez cc238d84ec Pre-release version of v1.0 1 year ago
J. Fernando Sánchez be65592055 Default parameters terroristnetwork 1 year ago
J. Fernando Sánchez 1d882dcff6 Update easy function 1 year ago
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
J. Fernando Sánchez 73282530fd Big refactor v0.30
All test pass, except for the TestConfig suite, which is not too critical as the
plan for this version onwards is to avoid configuration as much as possible.
1 year ago
J. Fernando Sánchez bf481f0f88 v0.20.8 fix bugs 1 year ago
J. Fernando Sánchez 2869b1e1e6 Clean-up
* Removed old/unnecessary models
* Added a `simulation.{iter_}from_py` method to load simulations from python
files
* Changed tests of examples to run programmatic simulations
* Fixed programmatic examples
2 years ago
J. Fernando Sánchez d3cee18635 Add seed to cars example 2 years ago
J. Fernando Sánchez c09e480d37 black formatting 2 years ago
J. Fernando Sánchez a1262edd2a Refactored time
Treating time and conditions as the same entity was getting confusing, and it
added a lot of unnecessary abstraction in a critical part (the scheduler).

The scheduling queue now has the time as a floating number (faster), the agent
id (for ties) and the condition, as well as the agent. The first three
elements (time, id, condition) can be considered as the "key" for the event.

To allow for agent execution to be "randomized" within every step, a new
parameter has been added to the scheduler, which makes it add a random number to
the key in order to change the ordering.

`EventedAgent.received` now checks the messages before returning control to the
user by default.
2 years ago
J. Fernando Sánchez 2f5e5d0a74 Black formatting 2 years ago
J. Fernando Sánchez a2fb25c160 Version 0.30.0rc2
* Fix CLI arguments not being used when easy is passed a simulation instance
* Docs for `examples/events_and_messages/cars.py`
2 years ago
J. Fernando Sánchez 159c9a9077 Add events 2 years ago
J. Fernando Sánchez 3776c4e5c5 Refactor
* Removed references to `set_state`
* Split some functionality from `agents` into separate files (`fsm` and
`network_agents`)
* Rename `neighboring_agents` to `neighbors`
* Delete some spurious functions
2 years ago
J. Fernando Sánchez 880a9f2a1c black formatting 2 years ago
J. Fernando Sánchez 227fdf050e Fix conditionals 2 years ago
J. Fernando Sánchez 77d08fc592 Agent step can be a generator 2 years ago
J. Fernando Sánchez 0efcd24d90 Improve exporters 2 years ago
J. Fernando Sánchez d9947c2c52 WIP: all tests pass
Documentation needs some improvement

The API has been simplified to only allow for ONE topology per
NetworkEnvironment.
This covers the main use case, and simplifies the code.
2 years ago
J. Fernando Sánchez cd62c23cb9 WIP: all tests pass 2 years ago
J. Fernando Sánchez f811ee18c5 WIP 2 years ago
J. Fernando Sánchez 0a9c6d8b19 WIP: removed stats 2 years ago
J. Fernando Sánchez 3dc56892c1 WIP: working config 2 years ago
J. Fernando Sánchez e41dc3dae2 WIP 2 years ago
J. Fernando Sánchez bbaed636a8 WIP 2 years ago
J. Fernando Sánchez 2116fe6f38 Bug fixes and minor improvements 2 years ago
J. Fernando Sánchez affeeb9643 Update examples 2 years ago
J. Fernando Sánchez c02e6ea2e8 Fix die bug 2 years ago
J. Fernando Sánchez cb72aac980 Add random activation example 2 years ago
J. Fernando Sánchez 6c4f44b4cb Partial MESA compatibility and several fixes
Documentation for the new APIs is still a work in progress :)
3 years ago
J. Fernando Sánchez af9a392a93 WIP: mesa compat
All tests pass but some features are still missing/unclear:

- Mesa agents do not have a `state`, so their "metrics" don't get stored. I will
probably refactor this to remove some magic in this regard. This should get rid
of the `_state` dictionary and the setitem/getitem magic.
- Simulation is still different from a runner. So far only Agent and
Environment/Model have been updated.
3 years ago
J. Fernando Sánchez 5d7e57675a WIP: mesa compatibility 3 years ago
J. Fernando Sánchez 05f7f49233 Refactoring v0.15.1
See CHANGELOG.md for a full list of changes

* Removed nxsim
* Refactored `agents.NetworkAgent` and `agents.BaseAgent`
* Refactored exporters
* Added stats to history
4 years ago
J. Fernando Sánchez 6690b6ee5f Fix incompatibility and bug in get_agents 5 years ago
J. Fernando Sánchez d1006bd55c WIP: exporters 5 years ago
J. Fernando Sánchez 9bc036d185 WIP: exporters 5 years ago
J. Fernando Sánchez a3ea434f23 0.13.8 5 years ago
J. Fernando Sánchez 65f6aa72f3 fix timeout in FSM. Improve logs 5 years ago
J. Fernando Sánchez 09e14c6e84 Add generator and programmatic examples 5 years ago
J. Fernando Sánchez b41927d7bf remove leftover import in example 5 years ago
J. Fernando Sánchez 2e28b36f6e Python3.7, testing and bug fixes
* Upgrade to python3.7 and pandas 0.3.4 because pandas has dropped support for
python 3.4 -> There are some API changes in pandas, and I've update the code
accordingly.
* Set pytest as the default test runner
5 years ago
J. Fernando Sánchez ff1df62eec All tests pass 5 years ago
J. Fernando Sánchez fc48ed7e09 Added history class
Now the environment does not deal with history directly, it delegates it to a
specific class. The analysis also uses history instances instead of either
using the database directly or creating a proxy environment.

This should make it easier to change the implementation in the future.

In fact, the change was motivated by the large size of the csv files in previous
versions. This new implementation only stores results in deltas, and it fills
any necessary values when needed.
6 years ago
J. Fernando Sánchez 7d1c800490 Parallelism and granular exporting options
* Graphs are not saved by default (not backwards compatible)
* Modified newsspread examples
* More granular options to save results (exporting to CSV and GEXF are now
optional)
* Updated tutorial to include exporting options
* Removed references from environment to simulation
* Added parallelism to simulations (can be turned off with a flag or argument).
7 years ago
J. Fernando Sánchez a7c51742f6 Improved docs
Fixed several bugs
Added convenience methods in soil.analysis
7 years ago