1
0
mirror of https://github.com/gsi-upm/soil synced 2024-12-23 08:28:13 +00:00
soil/benchmarks/noop/soil_step.py

21 lines
375 B
Python
Raw Normal View History

2023-05-19 14:19:50 +00:00
from soil import Agent, Environment, Simulation
2023-05-03 10:07:55 +00:00
2023-05-19 14:19:50 +00:00
class NoopAgent(Agent):
2023-05-03 10:07:55 +00:00
num_calls = 0
def step(self):
self.num_calls += 1
class NoopEnvironment(Environment):
num_agents = 100
def init(self):
self.add_agents(NoopAgent, k=self.num_agents)
self.add_agent_reporter("num_calls")
2023-05-19 14:19:50 +00:00
from _config import *
2023-05-03 10:07:55 +00:00
2023-05-19 14:19:50 +00:00
run_sim(model=NoopEnvironment)