i think it is working

This commit is contained in:
2023-01-23 11:28:12 +01:00
parent 3a421ceb34
commit 89dc8ed54a
22 changed files with 540 additions and 28 deletions
+27
View File
@@ -0,0 +1,27 @@
import random
class Simulation():
"""
Class for controlling the different calculation steps of the Simulation.
"""
def __init__(self) -> None:
self.tick_funcs={}
pass
def seed(self,a):
"""
Sets the random seed
"""
random.seed(a)
def register_tick(self,id,tickfunc):
self.tick_funcs[id]=tickfunc
def tick_random_order(self):
"""
Ticks all agents in a Random Order
"""
keys=list(self.tick_funcs.keys())
random.shuffle(keys)
for k in keys:
fun=self.tick_funcs[k]
fun()