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:
@@ -2,7 +2,7 @@
|
||||
Example of setting a
|
||||
Example of a fully programmatic simulation, without definition files.
|
||||
"""
|
||||
from soil import Simulation, agents
|
||||
from soil import Simulation, agents, Environment
|
||||
from soil.time import Delta
|
||||
|
||||
|
||||
@@ -29,11 +29,15 @@ class MyAgent(agents.FSM):
|
||||
return None, Delta(self.random.expovariate(1 / 16))
|
||||
|
||||
|
||||
class RandomEnv(Environment):
|
||||
|
||||
def init(self):
|
||||
self.add_agent(agent_class=MyAgent)
|
||||
|
||||
|
||||
s = Simulation(
|
||||
name="Programmatic",
|
||||
model_params={
|
||||
'agents': [{'agent_class': MyAgent}],
|
||||
},
|
||||
model=RandomEnv,
|
||||
num_trials=1,
|
||||
max_time=100,
|
||||
dry_run=True,
|
Reference in New Issue
Block a user