1
0
mirror of https://github.com/gsi-upm/soil synced 2024-11-14 07:22:29 +00:00
soil/benchmarks/noop/soil_step.py
J. Fernando Sánchez 5e93399d58 Initial benchmarking
2023-05-03 12:07:55 +02:00

22 lines
418 B
Python

from soil import BaseAgent, Environment, Simulation
class NoopAgent(BaseAgent):
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")
if __name__ == "__main__":
from _config import *
run_sim(model=NoopEnvironment)