Commit 606cf427 authored by Georgios Dagkakis's avatar Georgios Dagkakis

methods that EventGenerator calls do not need to take arguments as dicts

parent cc5d571e
......@@ -56,7 +56,7 @@ class EventGenerator(ObjectInterruption):
if self.stop:
if self.env.now>self.stop:
break
self.method(self.argumentDict) #call the method
self.method(**self.argumentDict) #call the method
yield self.env.timeout(self.interval) #wait for the predetermined interval
......
......@@ -134,11 +134,11 @@ class G:
# =======================================================================
# method to move entities exceeding a certain safety stock
# =======================================================================
def moveExcess(argumentDict={}):
giver=findObjectById(argumentDict.get('from', None))
receiver=findObjectById(argumentDict.get('to', None))
safetyStock=int(argumentDict.get('safetyStock', 10))
consumption=int(argumentDict.get('consumption', 1))
def moveExcess(consumption=1,safetyStock=70, giverId=None, receiverId=None):
giver=findObjectById(giverId)
receiver=findObjectById(receiverId)
safetyStock=int(safetyStock)
consumption=int(consumption)
if giver and receiver:
if len(giver.getActiveObjectQueue())>safetyStock:
giver.receiver=receiver
......@@ -285,8 +285,9 @@ def setWIP(entityList):
if not (entity.currentStation.initialWIP.triggered):
entity.currentStation.initialWIP.succeed(G.env)
from Exit import Exit
def countIntervalThroughput(argumentDict={}):
def countIntervalThroughput():
from Exit import Exit
currentExited=0
for obj in G.ObjList:
if isinstance(obj, Exit):
......
......@@ -40,9 +40,9 @@
"_class": "Dream.EventGenerator",
"argumentDict": {
"consumption": 20,
"from": "Q2",
"giverId": "Q2",
"safetyStock": 70,
"to": "E1"
"receiverId": "E1"
},
"interval": "60",
"method": "Dream.Globals.moveExcess",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment