Commit 6981dad9 authored by Jérome Perrin's avatar Jérome Perrin

replace simpy2 by their simpy3 equivalents

parent 82b4b0d3
...@@ -27,7 +27,6 @@ Custom object. Maybe we should have a generic method that the objects can call i ...@@ -27,7 +27,6 @@ Custom object. Maybe we should have a generic method that the objects can call i
''' '''
from BatchDecomposition import BatchDecomposition from BatchDecomposition import BatchDecomposition
from SimPy.Simulation import now
class BatchDecompositionStartTime(BatchDecomposition): class BatchDecompositionStartTime(BatchDecomposition):
...@@ -35,7 +34,7 @@ class BatchDecompositionStartTime(BatchDecomposition): ...@@ -35,7 +34,7 @@ class BatchDecompositionStartTime(BatchDecomposition):
#gets an entity from the predecessor #gets an entity from the predecessor
def getEntity(self): def getEntity(self):
activeEntity=BatchDecomposition.getEntity(self) activeEntity=BatchDecomposition.getEntity(self)
activeEntity.startTime=now() activeEntity.startTime=self.env.now
return activeEntity return activeEntity
''' '''
...@@ -45,6 +44,6 @@ class BatchDecompositionStartTime(BatchDecomposition): ...@@ -45,6 +44,6 @@ class BatchDecompositionStartTime(BatchDecomposition):
# assign it as the batch start time # assign it as the batch start time
if len(self.getActiveObjectQueue())==self.numberOfSubBatches: if len(self.getActiveObjectQueue())==self.numberOfSubBatches:
batch=self.getActiveObjectQueue()[0].parentBatch batch=self.getActiveObjectQueue()[0].parentBatch
batch.startTime=now() batch.startTime=self.env.now
activeEntity=BatchDecomposition.removeEntity(self, entity) activeEntity=BatchDecomposition.removeEntity(self, entity)
return activeEntity return activeEntity
...@@ -26,7 +26,6 @@ Inherits from QueueManagedJob. Checks the condition of (a) component(s) before i ...@@ -26,7 +26,6 @@ Inherits from QueueManagedJob. Checks the condition of (a) component(s) before i
''' '''
from QueueManagedJob import QueueManagedJob from QueueManagedJob import QueueManagedJob
from SimPy.Simulation import now
# =========================================================================== # ===========================================================================
# Error in the setting up of the WIP # Error in the setting up of the WIP
......
...@@ -26,7 +26,7 @@ Created on 18 Feb 2013 ...@@ -26,7 +26,7 @@ Created on 18 Feb 2013
models a frame entity. This can flow through the system and carry parts models a frame entity. This can flow through the system and carry parts
''' '''
from SimPy.Simulation import Resource from simpy import Resource
from Globals import G from Globals import G
from Entity import Entity from Entity import Entity
...@@ -45,4 +45,4 @@ class Frame(Entity): ...@@ -45,4 +45,4 @@ class Frame(Entity):
self.lenght=2.0 self.lenght=2.0
def getFrameQueue(self): def getFrameQueue(self):
return self.Res.activeQ return self.Res.users
...@@ -28,7 +28,6 @@ BatchScrapMachine->BatchDecomposition ...@@ -28,7 +28,6 @@ BatchScrapMachine->BatchDecomposition
''' '''
from BatchScrapMachine import BatchScrapMachine from BatchScrapMachine import BatchScrapMachine
from SimPy.Simulation import now
class M3(BatchScrapMachine): class M3(BatchScrapMachine):
......
This diff is collapsed.
...@@ -28,7 +28,6 @@ he checks if the operation that calls him is of higher priority than the one ...@@ -28,7 +28,6 @@ he checks if the operation that calls him is of higher priority than the one
that he is currently in. that he is currently in.
''' '''
from SimPy.Simulation import Resource, now
from Operator import Operator from Operator import Operator
# =========================================================================== # ===========================================================================
...@@ -94,7 +93,7 @@ class OperatorPreemptive(Operator): ...@@ -94,7 +93,7 @@ class OperatorPreemptive(Operator):
# then the receiver must be preemptied before it can receive any entities from the calerObject # then the receiver must be preemptied before it can receive any entities from the calerObject
victim.shouldPreempt=True victim.shouldPreempt=True
victim.preempt() victim.preempt()
victim.timeLastEntityEnded=now() #required to count blockage correctly in the preemptied station victim.timeLastEntityEnded=self.env.now #required to count blockage correctly in the preemptied station
return True return True
# if the entity has no isCritical property then ran the default behaviour # if the entity has no isCritical property then ran the default behaviour
except: except:
......
...@@ -31,7 +31,7 @@ Models an Interruption that schedules the operation of the machines by different ...@@ -31,7 +31,7 @@ Models an Interruption that schedules the operation of the machines by different
import simpy import simpy
from ObjectInterruption import ObjectInterruption from ObjectInterruption import ObjectInterruption
from SimPy.Simulation import waituntil, now, hold, request, release, waitevent #from SimPy.Simulation import waituntil, now, hold, request, release, waitevent
# =========================================================================== # ===========================================================================
......
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