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
'''
from BatchDecomposition import BatchDecomposition
from SimPy.Simulation import now
class BatchDecompositionStartTime(BatchDecomposition):
......@@ -35,7 +34,7 @@ class BatchDecompositionStartTime(BatchDecomposition):
#gets an entity from the predecessor
def getEntity(self):
activeEntity=BatchDecomposition.getEntity(self)
activeEntity.startTime=now()
activeEntity.startTime=self.env.now
return activeEntity
'''
......@@ -45,6 +44,6 @@ class BatchDecompositionStartTime(BatchDecomposition):
# assign it as the batch start time
if len(self.getActiveObjectQueue())==self.numberOfSubBatches:
batch=self.getActiveObjectQueue()[0].parentBatch
batch.startTime=now()
batch.startTime=self.env.now
activeEntity=BatchDecomposition.removeEntity(self, entity)
return activeEntity
......@@ -26,7 +26,6 @@ Inherits from QueueManagedJob. Checks the condition of (a) component(s) before i
'''
from QueueManagedJob import QueueManagedJob
from SimPy.Simulation import now
# ===========================================================================
# Error in the setting up of the WIP
......@@ -156,4 +155,4 @@ class ConditionalBuffer(QueueManagedJob):
activeEntity.proceed=True
activeEntity.candidateReceivers.append(nextObject)
mayProceed=True
return mayProceed
\ No newline at end of file
return mayProceed
......@@ -26,7 +26,7 @@ Created on 18 Feb 2013
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 Entity import Entity
......@@ -45,4 +45,4 @@ class Frame(Entity):
self.lenght=2.0
def getFrameQueue(self):
return self.Res.activeQ
return self.Res.users
......@@ -28,7 +28,6 @@ BatchScrapMachine->BatchDecomposition
'''
from BatchScrapMachine import BatchScrapMachine
from SimPy.Simulation import now
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
that he is currently in.
'''
from SimPy.Simulation import Resource, now
from Operator import Operator
# ===========================================================================
......@@ -94,7 +93,7 @@ class OperatorPreemptive(Operator):
# then the receiver must be preemptied before it can receive any entities from the calerObject
victim.shouldPreempt=True
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
# if the entity has no isCritical property then ran the default behaviour
except:
......
......@@ -31,7 +31,7 @@ Models an Interruption that schedules the operation of the machines by different
import simpy
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