Commit c4ae9e2f authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

checkForManualOperation introduced to assemble() to update the multOperationTypeList

parent b2808808
......@@ -54,11 +54,9 @@ class G:
maxSimTime=0 #the total simulation time
# flag for printing in console
# -----------------------------------------------------------------------
console=""
# data for the trace output in excel
# -----------------------------------------------------------------------
trace="" #this is written from input. If it is "Yes" then you write to trace, else we do not
traceIndex=0 #index that shows in what row we are
sheetIndex=1 #index that shows in what sheet we are
......@@ -67,26 +65,21 @@ class G:
# variables for excel output
# -----------------------------------------------------------------------
outputIndex=0 #index that shows in what row we are
sheetIndex=1 #index that shows in what sheet we are
outputFile = xlwt.Workbook() #create excel file
outputSheet = outputFile.add_sheet('sheet '+str(sheetIndex), cell_overwrite_ok=True) #create excel sheet
#variables for json output
# -----------------------------------------------------------------------
outputJSON={}
outputJSONFile=None
numberOfEntities = 0
#object that routes the operators in the model
#------------------------------------------------------------------------
Router=None
# -----------------------------------------------------------------------
# define the lists of each object type
# -----------------------------------------------------------------------
SourceList=[]
MachineList=[]
ExitList=[]
......@@ -206,7 +199,6 @@ class SetWipTypeError(Exception):
# =======================================================================
# method to set-up the entities in the current stations
# as Work In Progress
# -----------------------------------------
# in this case the current station must be defined!
# otherwise there is no current station but a list of possible stations
# although the entity cannot be in more than one stations
......
......@@ -218,10 +218,8 @@ def createObjectResourcesAndCoreObjects():
# get the successorList for the 'Frames'
coreObject.nextFrameIds=getSuccessorList(element['id'], lambda source, destination, edge_data: edge_data.get('entity') == 'Frame')
# -----------------------------------------------------------------------
# loop through all the core objects
# to read predecessors
# -----------------------------------------------------------------------
for element in G.ObjList:
#loop through all the nextIds of the object
for nextId in element.nextIds:
......@@ -244,12 +242,10 @@ def createObjectInterruptions():
#Read the json data
nodes = json_data['nodes'] # read from the dictionary the dicts with key 'nodes'
# -----------------------------------------------------------------------
# loop through all the nodes to
# search for Event Generator and create them
# this is put last, since the EventGenerator
# may take other objects as argument
# -----------------------------------------------------------------------
for (element_id, element) in nodes.iteritems(): # use an iterator to go through all the nodes
# the key is the element_id and the second is the
# element itself
......
......@@ -202,6 +202,10 @@ class MouldAssembly(MachineJobShop):
break
# create the mould
self.createMould(self.mouldToBeCreated)
# check if there is a need for manual processing
self.checkForManualOperation(type='Processing',entity=self.mouldToBeCreated)
# check if there is a need for manual processing
self.checkForManualOperation(type='Setup',entity=self.mouldToBeCreated)
# set the created mould as WIP
import Globals
Globals.setWIP([self.mouldToBeCreated])
......@@ -225,7 +229,6 @@ class MouldAssembly(MachineJobShop):
id=component.get('id', 'not found')
name=component.get('name', 'not found')
try:
# dummy variable that holds the routes of the jobs the route from the JSON file is a sequence of dictionaries
JSONRoute=component.get('route', [])
# variable that holds the argument used in the Job initiation hold None for each entry in the 'route' list
......@@ -234,27 +237,25 @@ class MouldAssembly(MachineJobShop):
firstStep = route.pop(0)
assert (self.id in firstStep.get('stationIdsList',[])),\
'the assembler must be in the mould-to-be-created route\' initial step'
# normal processing operation
processingTime=firstStep['processingTime']
processingTime=self.getOperationTime(processingTime)
self.rng=RandomNumberGenerator(self, **processingTime)
self.procTime=self.rng.generateNumber()
# update the activeObject's processing time according to the readings in the mould's route
processDistType=processingTime.get('distributionType','not found')
procTime=float(processingTime.get('mean', 0))
processOpType=processingTime.get('operationType','not found') # can be manual/automatic
processingTime=self.getOperationTime(processingTime)
self.rng=RandomNumberGenerator(self, **processingTime)
self.procTime=self.rng.generateNumber()
# setup operation
setupTime=firstStep.get('setupTime',None)
if setupTime:
setupTime=self.getOperationTime(setupTime)
self.stpRng=RandomNumberGenerator(self, **setupTime)
# update the activeObject's processing time according to the readings in the mould's route
setupDistType=setupTime.get('distributionType','not found')
setTime=float(setupTime.get('mean', 0))
setupOpType=setupTime.get('operationType','not found') # can be manual/automatic
setupTime=self.getOperationTime(setupTime)
self.stpRng=RandomNumberGenerator(self, **setupTime)
# update the first step of the route with the activeObjects id as sole element of the stationIdsList
route.insert(0, {'stationIdsList':[str(self.id)],'processingTime':{'distributionType':str(processDistType),\
'mean':str(procTime),\
......
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