Commit 795e0b24 authored by Jérome Perrin's avatar Jérome Perrin

DemandPlanning: port to Simpy3

Conflicts:
	dream/simulation/LineGenerationJSON.py
parent 16248954
...@@ -14,7 +14,6 @@ import xlrd ...@@ -14,7 +14,6 @@ import xlrd
from AllocationRoutine import AllocationRoutine from AllocationRoutine import AllocationRoutine
from CoreObject import CoreObject from CoreObject import CoreObject
from Globals import G from Globals import G
from SimPy.Simulation import hold
from ObjectInterruption import ObjectInterruption from ObjectInterruption import ObjectInterruption
from FutureDemandCreator import FutureDemandCreator from FutureDemandCreator import FutureDemandCreator
...@@ -29,7 +28,7 @@ class AllocationManagement(ObjectInterruption): ...@@ -29,7 +28,7 @@ class AllocationManagement(ObjectInterruption):
def run(self): def run(self):
self.FDC.run() self.FDC.run()
yield hold,self,0 yield G.env.timeout(0)
for kWeek in range(int(G.maxSimTime)): for kWeek in range(int(G.maxSimTime)):
# activate allocation procedure for future items at target week # activate allocation procedure for future items at target week
procedureFuture = AllocationRoutine(initialWeek=kWeek, itemType=1) procedureFuture = AllocationRoutine(initialWeek=kWeek, itemType=1)
......
...@@ -382,6 +382,7 @@ def createObjectInterruptions(): ...@@ -382,6 +382,7 @@ def createObjectInterruptions():
G.ObjectInterruptionList.append(SS) G.ObjectInterruptionList.append(SS)
G.ShiftSchedulerList.append(SS) G.ShiftSchedulerList.append(SS)
# =========================================================================== # ===========================================================================
# creates the entities that are wip # creates the entities that are wip
# =========================================================================== # ===========================================================================
...@@ -541,9 +542,10 @@ def initializeObjects(): ...@@ -541,9 +542,10 @@ def initializeObjects():
# activates all the objects # activates all the objects
# =========================================================================== # ===========================================================================
def activateObjects(): def activateObjects():
for element in G.ObjList + G.ObjectInterruptionList: # XXX EventGeneratorList
G.env.process(element.run()) for element in G.ObjList + G.ObjectInterruptionList + G.AllocationManagementList:
G.env.process(element.run())
# =========================================================================== # ===========================================================================
# the main script that is ran # the main script that is ran
# =========================================================================== # ===========================================================================
......
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