1
0
mirror of https://github.com/gsi-upm/soil synced 2025-08-24 03:52:20 +00:00

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.
This commit is contained in:
J. Fernando Sánchez
2023-04-09 04:19:24 +02:00
parent 2869b1e1e6
commit 73282530fd
45 changed files with 721 additions and 82265 deletions

View File

@@ -1,7 +1,7 @@
"""
Example of a fully programmatic simulation, without definition files.
"""
from soil import Simulation, agents
from soil import Simulation, Environment, agents
from networkx import Graph
import logging
@@ -25,23 +25,18 @@ class MyAgent(agents.FSM):
self.info("This runs 2/10 times on average")
class ProgrammaticEnv(Environment):
def init(self):
self.create_network(generator=mygenerator)
self.populate_network(agent_class=MyAgent)
self.add_agent_reporter('times_run')
simulation = Simulation(
name="Programmatic",
model_params={
'topology': {
'params': {
'generator': mygenerator
},
},
'agents': {
'distribution': [{
'agent_class': MyAgent,
'topology': True,
}]
}
},
model=ProgrammaticEnv,
seed='Program',
agent_reporters={'times_run': 'times_run'},
num_trials=1,
max_time=100,
dry_run=True,