Commit 4e2f73fd authored by Georgios Dagkakis's avatar Georgios Dagkakis

now corrected in globals. Also env is defined there

parent 676e5b9f
...@@ -32,7 +32,7 @@ from Repairman import Repairman ...@@ -32,7 +32,7 @@ from Repairman import Repairman
import xlwt import xlwt
import xlrd import xlrd
from random import Random, expovariate, gammavariate, normalvariate from random import Random, expovariate, gammavariate, normalvariate
from SimPy.Simulation import now import simpy
# =========================================================================== # ===========================================================================
# globals # globals
...@@ -126,6 +126,7 @@ class G: ...@@ -126,6 +126,7 @@ class G:
# entities that just finished processing in a station # entities that just finished processing in a station
# and have to enter the next machine # and have to enter the next machine
pendingEntities=[] pendingEntities=[]
env=simpy.Environment()
# ======================================================================= # =======================================================================
...@@ -192,7 +193,7 @@ def setWIP(entityList): ...@@ -192,7 +193,7 @@ def setWIP(entityList):
if entity.type=='Part' or entity.type=='Batch' or entity.type=='SubBatch': if entity.type=='Part' or entity.type=='Batch' or entity.type=='SubBatch':
object=entity.currentStation #identify the object object=entity.currentStation #identify the object
object.getActiveObjectQueue().append(entity) #append the entity to its Queue object.getActiveObjectQueue().append(entity) #append the entity to its Queue
entity.schedule.append([object,now()]) #append the time to schedule so that it can be read in the result entity.schedule.append([object,G.env.now]) #append the time to schedule so that it can be read in the result
# if the entity is of type Job/OrderComponent/Order/Mould # if the entity is of type Job/OrderComponent/Order/Mould
...@@ -225,7 +226,7 @@ def setWIP(entityList): ...@@ -225,7 +226,7 @@ def setWIP(entityList):
object.next.append(nextObject) object.next.append(nextObject)
entity.remainingRoute.pop(0) # remove data from the remaining route. entity.remainingRoute.pop(0) # remove data from the remaining route.
entity.schedule.append([object,now()]) #append the time to schedule so that it can be read in the result entity.schedule.append([object,G.env.now]) #append the time to schedule so that it can be read in the result
entity.currentStation=object # update the current station of the entity entity.currentStation=object # update the current station of the entity
# if the currentStation of the entity is of type Machine then the entity # if the currentStation of the entity is of type Machine then the entity
# must be processed first and then added to the pendingEntities list # must be processed first and then added to the pendingEntities list
...@@ -259,7 +260,7 @@ from Queue import Queue ...@@ -259,7 +260,7 @@ from Queue import Queue
def countQueueMetrics(argumentDict={}): def countQueueMetrics(argumentDict={}):
for obj in G.ObjList: for obj in G.ObjList:
if isinstance(obj, Queue): if isinstance(obj, Queue):
obj.wip_stat_list.append((now(), len(obj.Res.activeQ))) obj.wip_stat_list.append((G.env.now, len(obj.Res.activeQ)))
# ======================================================================= # =======================================================================
...@@ -285,7 +286,7 @@ def getConfidenceIntervals(value_list): ...@@ -285,7 +286,7 @@ def getConfidenceIntervals(value_list):
# def printTrace(entity='',station='', **kw): # def printTrace(entity='',station='', **kw):
# assert len(kw)==1, 'only one phrase per printTrace supported for the moment' # assert len(kw)==1, 'only one phrase per printTrace supported for the moment'
# from Globals import G # from Globals import G
# time=now() # time=G.env.now
# charLimit=60 # charLimit=60
# remainingChar=charLimit-len(entity)-len(str(time)) # remainingChar=charLimit-len(entity)-len(str(time))
# if(G.console=='Yes'): # if(G.console=='Yes'):
......
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