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

black formatting

This commit is contained in:
J. Fernando Sánchez
2022-10-17 20:23:57 +02:00
parent 227fdf050e
commit 880a9f2a1c
19 changed files with 431 additions and 329 deletions

View File

@@ -1,6 +1,6 @@
'''
"""
Example of a fully programmatic simulation, without definition files.
'''
"""
from soil import Simulation, agents
from networkx import Graph
import logging
@@ -14,21 +14,22 @@ def mygenerator():
class MyAgent(agents.FSM):
@agents.default_state
@agents.state
def neutral(self):
self.debug('I am running')
self.debug("I am running")
if agents.prob(0.2):
self.info('This runs 2/10 times on average')
self.info("This runs 2/10 times on average")
s = Simulation(name='Programmatic',
network_params={'generator': mygenerator},
num_trials=1,
max_time=100,
agent_class=MyAgent,
dry_run=True)
s = Simulation(
name="Programmatic",
network_params={"generator": mygenerator},
num_trials=1,
max_time=100,
agent_class=MyAgent,
dry_run=True,
)
# By default, logging will only print WARNING logs (and above).