Commit 071661ca authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Sebastien Robin

1st version of conveyer object - not working properly

parent b5814f12
...@@ -84,7 +84,7 @@ class Assembly(Process): ...@@ -84,7 +84,7 @@ class Assembly(Process):
def run(self): def run(self):
while 1: while 1:
yield waituntil, self, self.canAcceptAndIsRequested #wait until the Assembly can accept a frame yield waituntil, self, self.canAcceptAndIsRequested #wait until the Assembly can accept a frame
#and one "frame" predecessor requests it #and one "frame" predecessor requests it
self.getEntity("Frame") #get the Frame self.getEntity("Frame") #get the Frame
for i in range(self.Res.activeQ[0].numOfParts): #this loop will be carried until the Frame is full with the parts for i in range(self.Res.activeQ[0].numOfParts): #this loop will be carried until the Frame is full with the parts
......
This diff is collapsed.
...@@ -93,9 +93,8 @@ class Exit(Process): ...@@ -93,9 +93,8 @@ class Exit(Process):
#gets an entity from the predecessor #gets an entity from the predecessor
def getEntity(self): def getEntity(self):
name=self.previous[self.predecessorIndex].Res.activeQ[0].name #get the name of the entity for the trace name=self.previous[0].Res.activeQ[0].name #get the name of the entity for the trace
self.totalLifespan+=now()-self.previous[self.predecessorIndex].Res.activeQ[0].startTime #Add the entity's lifespan to the total one. self.previous[0].removeEntity() #remove the entity from the previous object
self.previous[self.predecessorIndex].removeEntity() #remove the entity from the previous object
self.outputTrace(name) self.outputTrace(name)
#actions to be taken after the simulation ends #actions to be taken after the simulation ends
......
...@@ -22,5 +22,9 @@ class Frame(object): ...@@ -22,5 +22,9 @@ class Frame(object):
self.creationTime=0 self.creationTime=0
self.startTime=0 #holds the startTime for the lifespan self.startTime=0 #holds the startTime for the lifespan
self.Res=Resource(self.numOfParts) self.Res=Resource(self.numOfParts)
#dimension data
self.width=2
self.height=2
self.lenght=2
{"_class": "Dream.Simulation",
"general": {
"_class": "Dream.Configuration",
"numberOfReplications": "1",
"maxSimTime": "60",
"trace": "Yes",
"confidenceLevel": "0.95"
},
"modelResource": [
{"_class": "Dream.Repairman",
"id": "W1",
"name": "W1",
"capacity": "1"
}
],
"coreObject": [
{"_class": "Dream.Source",
"id": "S1",
"name": "Raw Material",
"interarrivalTime":
{
"distributionType": "Fixed",
"mean": "0.5"
},
"entity": "Part",
"successorList": ["DummyQ"]
},
{"_class": "Dream.Machine",
"id": "M1",
"name": "Machine1",
"processingTime": {
"distributionType": "Fixed",
"mean": "0.25"
},
"failures":{
"failureDistribution": "No",
"MTTF": "60",
"MTTR": "5",
"repairman": "W1"
},
"predecessorList": ["DummyQ"],
"successorList": ["C1"]
},
{"_class": "Dream.Machine",
"id": "M2",
"name": "Machine2",
"processingTime": {
"distributionType": "Fixed",
"mean": "1.5"
},
"failures":{
"failureDistribution": "No",
"MTTF": "40",
"MTTR": "10",
"repairman": "W1"
},
"predecessorList": ["C1"],
"successorList": ["E1"]
},
{"_class": "Dream.Queue",
"id": "DummyQ",
"name": "DummyQ",
"isDummy": "1",
"capacity": "1",
"predecessorList": ["S1"],
"successorList": ["M1"]
},
{"_class": "Dream.Conveyer",
"id": "C1",
"name": "C1",
"length": "8",
"speed": "1",
"predecessorList": ["M1"],
"successorList": ["M2"]
},
{"_class": "Dream.Exit",
"id": "E1",
"name": "Stock",
"predecessorList": ["M2"]
}
]
}
...@@ -19,6 +19,7 @@ from Part import Part ...@@ -19,6 +19,7 @@ from Part import Part
from Frame import Frame from Frame import Frame
from Assembly import Assembly from Assembly import Assembly
from Dismantle import Dismantle from Dismantle import Dismantle
from Conveyer import Conveyer
import xlwt import xlwt
import xlrd import xlrd
import time import time
...@@ -49,6 +50,7 @@ def createObjects(): ...@@ -49,6 +50,7 @@ def createObjects():
G.RepairmanList=[] G.RepairmanList=[]
G.AssemblyList=[] G.AssemblyList=[]
G.DismantleList=[] G.DismantleList=[]
G.ConveyerList=[]
#loop through all the model resources #loop through all the model resources
#read the data and create them #read the data and create them
...@@ -167,6 +169,19 @@ def createObjects(): ...@@ -167,6 +169,19 @@ def createObjects():
D.previousIds=predecessorList D.previousIds=predecessorList
G.DismantleList.append(D) G.DismantleList.append(D)
G.ObjList.append(D) G.ObjList.append(D)
elif objClass=='Dream.Conveyer':
id=coreObject[i].get('id', 'not found')
name=coreObject[i].get('name', 'not found')
length=float(coreObject[i].get('length', '10'))
speed=float(coreObject[i].get('speed', '1'))
successorList=coreObject[i].get('successorList', 'not found')
predecessorList=coreObject[i].get('predecessorList', 'not found')
C=Conveyer(id, name, length, speed)
C.previousIds=predecessorList
C.nextIds=successorList
G.ObjList.append(C)
G.ConveyerList.append(C)
#defines the topology (predecessors and successors for all the objects) #defines the topology (predecessors and successors for all the objects)
def setTopology(): def setTopology():
......
...@@ -22,6 +22,10 @@ class Part(object): ...@@ -22,6 +22,10 @@ class Part(object):
self.currentStop=None #contains the current object that the material is in self.currentStop=None #contains the current object that the material is in
self.creationTime=0 self.creationTime=0
self.startTime=0 #holds the startTime for the lifespan self.startTime=0 #holds the startTime for the lifespan
#dimension data
self.width=1
self.height=1
self.length=1
def __del__(self): def __del__(self):
pass pass
......
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