mirror of https://github.com/gsi-upm/soil
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
418 B
Python
22 lines
418 B
Python
1 year ago
|
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)
|