Commit 6ae44a72 authored by Jérome Perrin's avatar Jérome Perrin

make Machine use consisitent format for setupTime and loadTime

parent 8acb32e5
......@@ -127,9 +127,9 @@ class Simulation(ACO.Simulation):
route_list.append(route)
route = {"stationIdsList": list(self.getMachineNameSet(sequence_step)),
"processingTime": {"distributionType": "Fixed",
"mean": "%i" % int(processing_time_list[j])},
"setupTime": {"setupDistribution": "Fixed",
"setupMean": "0.5"}, # XXX hardcoded value
"mean": int(processing_time_list[j])},
"setupTime": {"distributionType": "Fixed",
"mean": .5}, # XXX hardcoded value
}
if prerequisite_list:
route["prerequisites"] = prerequisite_list
......
......@@ -42,8 +42,8 @@
"M1": {
"_class": "Dream.Machine",
"loadTime": {
"loadDistribution": "Fixed",
"loadMean": "0"
"distributionType": "Fixed",
"mean": 0.0
},
"name": "Machine1",
"operationType": "MT-Load-Processing",
......@@ -56,8 +56,8 @@
"_class": "Dream.Machine",
"failures": {},
"loadTime": {
"loadDistribution": "Fixed",
"loadMean": "0"
"distributionType": "Fixed",
"mean": 0.0
},
"name": "Machine2",
"operationType": "MT-Load-Setup-Processing",
......@@ -66,8 +66,8 @@
"mean": 2.0
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.25"
"distributionType": "Fixed",
"mean": 0.25
}
},
"O1": {
......
......@@ -51,8 +51,8 @@
"operationType": "MT-Setup-Processing",
"processingTime": {},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0"
"distributionType": "Fixed",
"mean": 0.0
}
},
"M3": {
......@@ -71,8 +71,8 @@
"operationType": "MT-Setup-Processing",
"processingTime": {},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0"
"distributionType": "Fixed",
"mean": 0.0
}
},
"O1": {
......
......@@ -75,8 +75,8 @@
"mean": 1.0
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "2"
"distributionType": "Fixed",
"mean": 2.0
},
"stationIdsList": [
"M2"
......@@ -116,8 +116,8 @@
"mean": 1.0
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": 0.5
},
"stationIdsList": [
"M2"
......
......@@ -56,8 +56,8 @@
"mean": 0.25
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": 0.5
},
"stationIdsList": [
"M1"
......@@ -111,8 +111,8 @@
"mean": 1.0
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": 0.5
},
"stationIdsList": [
"M2"
......
......@@ -118,8 +118,8 @@
"mean": "2"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": "0.5"
},
"stationIdsList": [
"CAM1",
......@@ -137,8 +137,8 @@
"mean": "2"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": "0.5"
},
"stationIdsList": [
"MILL1",
......@@ -156,8 +156,8 @@
"mean": "2"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": "0.5"
},
"stationIdsList": [
"EDM"
......@@ -199,8 +199,8 @@
"mean": "1"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.6"
"distributionType": "Fixed",
"mean": "0.6"
},
"stationIdsList": [
"CAM1",
......@@ -218,8 +218,8 @@
"mean": "4"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.4"
"distributionType": "Fixed",
"mean": "0.4"
},
"stationIdsList": [
"MILL1",
......@@ -237,8 +237,8 @@
"mean": "1"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.6"
"distributionType": "Fixed",
"mean": "0.6"
},
"stationIdsList": [
"EDM"
......@@ -285,8 +285,8 @@
"mean": "2"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": "0.5"
},
"stationIdsList": [
"IM"
......@@ -315,8 +315,8 @@
"mean": 1.0
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": 0.5
},
"stationIdsList": [
"CAD1",
......
......@@ -118,8 +118,8 @@
"mean": "2"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": "0.5"
},
"stationIdsList": [
"CAM1",
......@@ -137,8 +137,8 @@
"mean": "2"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": "0.5"
},
"stationIdsList": [
"MILL1",
......@@ -156,8 +156,8 @@
"mean": "2"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": "0.5"
},
"stationIdsList": [
"EDM"
......@@ -199,8 +199,8 @@
"mean": "1"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.6"
"distributionType": "Fixed",
"mean": "0.6"
},
"stationIdsList": [
"CAM1",
......@@ -218,8 +218,8 @@
"mean": "4"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.4"
"distributionType": "Fixed",
"mean": "0.4"
},
"stationIdsList": [
"MILL1",
......@@ -237,8 +237,8 @@
"mean": "1"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.6"
"distributionType": "Fixed",
"mean": "0.6"
},
"stationIdsList": [
"EDM"
......@@ -285,8 +285,8 @@
"mean": "2"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": "0.5"
},
"stationIdsList": [
"IM"
......@@ -315,8 +315,8 @@
"mean": 1.0
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": 0.5
},
"stationIdsList": [
"CAD1",
......
......@@ -123,8 +123,8 @@
"mean": "2"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": "0.5"
},
"stationIdsList": [
"CAM1",
......@@ -142,8 +142,8 @@
"mean": "2"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": "0.5"
},
"stationIdsList": [
"MILL1",
......@@ -161,8 +161,8 @@
"mean": "2"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": "0.5"
},
"stationIdsList": [
"EDM"
......@@ -204,8 +204,8 @@
"mean": "1"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.6"
"distributionType": "Fixed",
"mean": "0.6"
},
"stationIdsList": [
"CAM1",
......@@ -223,8 +223,8 @@
"mean": "4"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.4"
"distributionType": "Fixed",
"mean": "0.4"
},
"stationIdsList": [
"MILL1",
......@@ -242,8 +242,8 @@
"mean": "1"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.6"
"distributionType": "Fixed",
"mean": "0.6"
},
"stationIdsList": [
"EDM"
......@@ -290,8 +290,8 @@
"mean": "2"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": "0.5"
},
"stationIdsList": [
"IM"
......@@ -320,8 +320,8 @@
"mean": 1.0
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": 0.5
},
"stationIdsList": [
"CAD1",
......@@ -355,8 +355,8 @@
"mean": "0.3"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.1"
"distributionType": "Fixed",
"mean": "0.1"
},
"stationIdsList": [
"CAM1",
......@@ -374,8 +374,8 @@
"mean": "3"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "1.2"
"distributionType": "Fixed",
"mean": "1.2"
},
"stationIdsList": [
"MILL1",
......@@ -393,8 +393,8 @@
"mean": "0.9"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.3"
"distributionType": "Fixed",
"mean": "0.3"
},
"stationIdsList": [
"EDM"
......@@ -436,8 +436,8 @@
"mean": "0.8"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.2"
"distributionType": "Fixed",
"mean": "0.2"
},
"stationIdsList": [
"CAM1",
......@@ -455,8 +455,8 @@
"mean": "0.4"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.1"
"distributionType": "Fixed",
"mean": "0.1"
},
"stationIdsList": [
"MILL1",
......@@ -474,8 +474,8 @@
"mean": "1.4"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.3"
"distributionType": "Fixed",
"mean": "0.3"
},
"stationIdsList": [
"EDM"
......@@ -522,8 +522,8 @@
"mean": "0.7"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.1"
"distributionType": "Fixed",
"mean": "0.1"
},
"stationIdsList": [
"IM"
......@@ -552,8 +552,8 @@
"mean": 1.4
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.7"
"distributionType": "Fixed",
"mean": 0.7
},
"stationIdsList": [
"CAD1",
......
......@@ -118,8 +118,8 @@
"mean": "2"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": "0.5"
},
"stationIdsList": [
"CAM1",
......@@ -137,8 +137,8 @@
"mean": "2"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": "0.5"
},
"stationIdsList": [
"MILL1",
......@@ -156,8 +156,8 @@
"mean": "2"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": "0.5"
},
"stationIdsList": [
"EDM"
......@@ -199,8 +199,8 @@
"mean": "1"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.6"
"distributionType": "Fixed",
"mean": "0.6"
},
"stationIdsList": [
"CAM1",
......@@ -218,8 +218,8 @@
"mean": "4"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.4"
"distributionType": "Fixed",
"mean": "0.4"
},
"stationIdsList": [
"MILL1",
......@@ -237,8 +237,8 @@
"mean": "1"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.6"
"distributionType": "Fixed",
"mean": "0.6"
},
"stationIdsList": [
"EDM"
......@@ -285,8 +285,8 @@
"mean": "2"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": "0.5"
},
"stationIdsList": [
"IM"
......@@ -315,8 +315,8 @@
"mean": 1.0
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": 0.5
},
"stationIdsList": [
"CAD1",
......@@ -350,8 +350,8 @@
"mean": "0.3"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.1"
"distributionType": "Fixed",
"mean": "0.1"
},
"stationIdsList": [
"CAM1",
......@@ -369,8 +369,8 @@
"mean": "3"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "1.2"
"distributionType": "Fixed",
"mean": "1.2"
},
"stationIdsList": [
"MILL1",
......@@ -388,8 +388,8 @@
"mean": "0.9"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.3"
"distributionType": "Fixed",
"mean": "0.3"
},
"stationIdsList": [
"EDM"
......@@ -431,8 +431,8 @@
"mean": "0.8"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.2"
"distributionType": "Fixed",
"mean": "0.2"
},
"stationIdsList": [
"CAM1",
......@@ -450,8 +450,8 @@
"mean": "0.4"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.1"
"distributionType": "Fixed",
"mean": "0.1"
},
"stationIdsList": [
"MILL1",
......@@ -469,8 +469,8 @@
"mean": "1.4"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.3"
"distributionType": "Fixed",
"mean": "0.3"
},
"stationIdsList": [
"EDM"
......@@ -517,8 +517,8 @@
"mean": "0.7"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.1"
"distributionType": "Fixed",
"mean": "0.1"
},
"stationIdsList": [
"IM"
......@@ -547,8 +547,8 @@
"mean": 1.4
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.7"
"distributionType": "Fixed",
"mean": 0.7
},
"stationIdsList": [
"CAD1",
......
......@@ -119,8 +119,8 @@
"mean": "2"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": "0.5"
},
"stationIdsList": [
"CAM1",
......@@ -138,8 +138,8 @@
"mean": "2"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": "0.5"
},
"stationIdsList": [
"MILL1",
......@@ -157,8 +157,8 @@
"mean": "2"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": "0.5"
},
"stationIdsList": [
"EDM"
......@@ -200,8 +200,8 @@
"mean": "1"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.6"
"distributionType": "Fixed",
"mean": "0.6"
},
"stationIdsList": [
"CAM1",
......@@ -219,8 +219,8 @@
"mean": "4"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.4"
"distributionType": "Fixed",
"mean": "0.4"
},
"stationIdsList": [
"MILL1",
......@@ -238,8 +238,8 @@
"mean": "1"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.6"
"distributionType": "Fixed",
"mean": "0.6"
},
"stationIdsList": [
"EDM"
......@@ -286,8 +286,8 @@
"mean": "2"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": "0.5"
},
"stationIdsList": [
"IM"
......@@ -317,8 +317,8 @@
"mean": 1.0
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": 0.5
},
"stationIdsList": [
"CAD1",
......@@ -352,8 +352,8 @@
"mean": "0.3"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.1"
"distributionType": "Fixed",
"mean": "0.1"
},
"stationIdsList": [
"CAM1",
......@@ -371,8 +371,8 @@
"mean": "3"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "1.2"
"distributionType": "Fixed",
"mean": "1.2"
},
"stationIdsList": [
"MILL1",
......@@ -390,8 +390,8 @@
"mean": "0.9"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.3"
"distributionType": "Fixed",
"mean": "0.3"
},
"stationIdsList": [
"EDM"
......@@ -433,8 +433,8 @@
"mean": "0.8"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.2"
"distributionType": "Fixed",
"mean": "0.2"
},
"stationIdsList": [
"CAM1",
......@@ -452,8 +452,8 @@
"mean": "0.4"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.1"
"distributionType": "Fixed",
"mean": "0.1"
},
"stationIdsList": [
"MILL1",
......@@ -471,8 +471,8 @@
"mean": "1.4"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.3"
"distributionType": "Fixed",
"mean": "0.3"
},
"stationIdsList": [
"EDM"
......@@ -519,8 +519,8 @@
"mean": "0.7"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.1"
"distributionType": "Fixed",
"mean": "0.1"
},
"stationIdsList": [
"IM"
......@@ -550,8 +550,8 @@
"mean": 1.4
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.7"
"distributionType": "Fixed",
"mean": 0.7
},
"stationIdsList": [
"CAD1",
......
......@@ -119,8 +119,8 @@
"mean": "2"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": "0.5"
},
"stationIdsList": [
"CAM1",
......@@ -138,8 +138,8 @@
"mean": "2"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": "0.5"
},
"stationIdsList": [
"MILL1",
......@@ -157,8 +157,8 @@
"mean": "2"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": "0.5"
},
"stationIdsList": [
"EDM"
......@@ -200,8 +200,8 @@
"mean": "1"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.6"
"distributionType": "Fixed",
"mean": "0.6"
},
"stationIdsList": [
"CAM1",
......@@ -219,8 +219,8 @@
"mean": "4"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.4"
"distributionType": "Fixed",
"mean": "0.4"
},
"stationIdsList": [
"MILL1",
......@@ -238,8 +238,8 @@
"mean": "1"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.6"
"distributionType": "Fixed",
"mean": "0.6"
},
"stationIdsList": [
"EDM"
......@@ -286,8 +286,8 @@
"mean": "2"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": "0.5"
},
"stationIdsList": [
"IM"
......@@ -317,8 +317,8 @@
"mean": 1.0
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.5"
"distributionType": "Fixed",
"mean": 0.5
},
"stationIdsList": [
"CAD1",
......@@ -352,8 +352,8 @@
"mean": "0.3"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.1"
"distributionType": "Fixed",
"mean": "0.1"
},
"stationIdsList": [
"CAM1",
......@@ -371,8 +371,8 @@
"mean": "3"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "1.2"
"distributionType": "Fixed",
"mean": "1.2"
},
"stationIdsList": [
"MILL1",
......@@ -390,8 +390,8 @@
"mean": "0.9"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.3"
"distributionType": "Fixed",
"mean": "0.3"
},
"stationIdsList": [
"EDM"
......@@ -433,8 +433,8 @@
"mean": "0.8"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.2"
"distributionType": "Fixed",
"mean": "0.2"
},
"stationIdsList": [
"CAM1",
......@@ -452,8 +452,8 @@
"mean": "0.4"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.1"
"distributionType": "Fixed",
"mean": "0.1"
},
"stationIdsList": [
"MILL1",
......@@ -471,8 +471,8 @@
"mean": "1.4"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.3"
"distributionType": "Fixed",
"mean": "0.3"
},
"stationIdsList": [
"EDM"
......@@ -519,8 +519,8 @@
"mean": "0.7"
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.1"
"distributionType": "Fixed",
"mean": "0.1"
},
"stationIdsList": [
"IM"
......@@ -550,8 +550,8 @@
"mean": 1.4
},
"setupTime": {
"setupDistribution": "Fixed",
"setupMean": "0.7"
"distributionType": "Fixed",
"mean": 0.7
},
"stationIdsList": [
"CAD1",
......
......@@ -303,18 +303,8 @@ def createObjects():
availability=float(failures.get('availability') or 0)
# type of operation and related times
operationType=element.get('operationType','not found')
setupTime = element.get('setupTime',{})
setupDistribution = setupTime.get('setupDistribution','not found')
setupMean = float(setupTime.get('setupMean') or 0)
setupStdev=float(setupTime.get('setupStdev') or 0)
setupMin=float(setupTime.get('setupMin') or 0)
setupMax=float(setupTime.get('setupMax') or mean+5*stdev)
loadTime = element.get('loadTime',{})
loadDistribution = loadTime.get('loadDistribution','not found')
loadMean = float(loadTime.get('loadMean') or 0)
loadStdev = float(loadTime.get('loadStdev') or 0)
loadMin=float(loadTime.get('loadMin') or 0)
loadMax=float(loadTime.get('loadMax') or mean+5*stdev)
setupTime = element.get('setupTime', None)
loadTime = element.get('loadTime', None)
preemption=element.get('preemption',{})
isPreemptive=resetOnPreemption=False
if len(preemption)>0:
......@@ -344,9 +334,8 @@ def createObjects():
M=Machine(id, name, 1, processingTime, failureDistribution=failureDistribution,
MTTF=MTTF, MTTR=MTTR, availability=availability, #repairman=r,
operatorPool=machineOperatorPoolList, operationType=operationType,
loadDistribution=loadDistribution, setupDistribution=setupDistribution,
setupMean=setupMean,setupStdev=setupStdev,setupMin=setupMin,setupMax=setupMax,
loadMean=loadMean,loadStdev=loadStdev,loadMin=loadMin,loadMax=loadMax,
setupTime=setupTime,
loadTime=loadTime,
repairman=r, isPreemptive=isPreemptive, resetOnPreemption=resetOnPreemption)
M.nextIds=getSuccessorList(id) # update the nextIDs list of the machine
G.MachineList.append(M) # add machine to global MachineList
......@@ -429,18 +418,8 @@ def createObjects():
availability=float(failures.get('availability') or 0)
# type of operation and related times
operationType=element.get('operationType','not found')
setupTime = element.get('setupTime',{})
setupDistribution = setupTime.get('setupDistribution','not found')
setupMean = float(setupTime.get('setupMean') or 0)
setupStdev=float(setupTime.get('setupStdev') or 0)
setupMin=float(setupTime.get('setupMin') or 0)
setupMax=float(setupTime.get('setupMax') or setupMean+5*setupStdev)
loadTime = element.get('loadTime',{})
loadDistribution = loadTime.get('loadDistribution','not found')
loadMean = float(loadTime.get('loadMean') or 0)
loadStdev = float(loadTime.get('loadStdev') or 0)
loadMin=float(loadTime.get('loadMin') or 0)
loadMax=float(loadTime.get('loadMax') or loadMean+5*loadStdev)
setupTime = element.get('setupTime', None)
loadTime = element.get('loadTime', None)
preemption=element.get('preemption',{})
isPreemptive=resetOnPreemption=False
if len(preemption)>0:
......@@ -471,9 +450,8 @@ def createObjects():
M=MachineJobShop(id, name, 1, processingTime=processingTime, failureDistribution=failureDistribution,
MTTF=MTTF, MTTR=MTTR, availability=availability, #repairman=r,
operatorPool=machineOperatorPoolList, operationType=operationType,
loadDistribution=loadDistribution, setupDistribution=setupDistribution,
setupMean=setupMean,setupStdev=setupStdev,setupMin=setupMin,setupMax=setupMax,
loadMean=loadMean,loadStdev=loadStdev,loadMin=loadMin,loadMax=loadMax,
setupTime=setupTime,
loadTime=loadTime,
repairman=r, isPreemptive=isPreemptive, resetOnPreemption=resetOnPreemption)
M.nextIds=getSuccessorList(id)
G.MachineJobShopList.append(M)
......@@ -493,18 +471,8 @@ def createObjects():
availability=float(failures.get('availability') or 0)
# type of operation and related times
operationType=element.get('operationType','not found')
setupTime = element.get('setupTime',{})
setupDistribution = setupTime.get('setupDistribution','not found')
setupMean = float(setupTime.get('setupMean') or 0)
setupStdev=float(setupTime.get('setupStdev') or 0)
setupMin=float(setupTime.get('setupMin') or 0)
setupMax=float(setupTime.get('setupMax') or setupMean+5*setupStdev)
loadTime = element.get('loadTime',{})
loadDistribution = loadTime.get('loadDistribution','not found')
loadMean = float(loadTime.get('loadMean') or 0)
loadStdev = float(loadTime.get('loadStdev') or 0)
loadMin=float(loadTime.get('loadMin') or 0)
loadMax=float(loadTime.get('loadMax') or setupMean+5*setupStdev)
setupTime = element.get('setupTime', None)
loadTime = element.get('loadTime', None)
preemption=element.get('preemption',{})
isPreemptive=resetOnPreemption=False
if len(preemption)>0:
......@@ -535,9 +503,8 @@ def createObjects():
M=MachineManagedJob(id, name, 1, processingTime=processingTime, failureDistribution=failureDistribution,
MTTF=MTTF, MTTR=MTTR, availability=availability, #repairman=r,
operatorPool=machineOperatorPoolList, operationType=operationType,
loadDistribution=loadDistribution, setupDistribution=setupDistribution,
setupMean=setupMean,setupStdev=setupStdev,setupMin=setupMin,setupMax=setupMax,
loadMean=loadMean,loadStdev=loadStdev,loadMin=loadMin,loadMax=loadMax,
setupTime=setupTime,
loadTime=loadTime,
repairman=r, isPreemptive=isPreemptive, resetOnPreemption=resetOnPreemption)
M.nextIds=getSuccessorList(id)
G.MachineManagedJobList.append(M)
......@@ -719,18 +686,8 @@ def createObjects():
availability=float(failures.get('availability') or 0)
operationType=element.get('operationType','not found')
setupTime = element.get('setupTime',{})
setupDistribution = setupTime.get('setupDistribution','not found')
setupMean = float(setupTime.get('setupMean') or 0)
setupStdev=float(setupTime.get('setupStdev') or 0)
setupMin=float(setupTime.get('setupMin') or 0)
setupMax=float(setupTime.get('setupMax') or mean+5*stdev)
loadTime = element.get('loadTime',{})
loadDistribution = loadTime.get('loadDistribution','not found')
loadMean = float(loadTime.get('loadMean') or 0)
loadStdev = float(loadTime.get('loadStdev') or 0)
loadMin=float(loadTime.get('loadMin') or 0)
loadMax=float(loadTime.get('loadMax') or mean+5*stdev)
setupTime = element.get('setupTime', None)
loadTime = element.get('loadTime', None)
if len(G.OperatorPoolsList)>0:
for operatorPool in G.OperatorPoolsList: # find the operatorPool assigned to the machine
......@@ -771,10 +728,8 @@ def createObjects():
MTTF=MTTF, MTTR=MTTR, availability=availability, #repairman=r,
mean=mean,stdev=stdev,min=min,max=max,
operatorPool=machineOperatorPoolList, operationType=operationType,
loadDistribution=loadDistribution, setupDistribution=setupDistribution,
setupMean=setupMean,setupStdev=setupStdev,setupMin=setupMin,setupMax=setupMax,
loadMean=loadMean,loadStdev=loadStdev,loadMin=loadMin,loadMax=loadMax,
repairman=r)
setupTime=setupTime,
loadTime=loadTime, repairman=r)
OM.nextIds=getSuccessorList(id) # update the nextIDs list of the machine
G.OperatedMachineList.append(OM) # add the machine to the operatedMachines List
G.MachineList.append(OM) # add machine to global MachineList
......@@ -820,18 +775,8 @@ def createObjects():
resetOnPreemption=bool(int(element.get('resetOnPreemption') or 0))
# type of operation and related times
operationType=element.get('operationType','not found')
setupTime = element.get('setupTime',{})
setupDistribution = setupTime.get('setupDistribution','not found')
setupMean = float(setupTime.get('setupMean') or 0)
setupStdev=float(setupTime.get('setupStdev') or 0)
setupMin=float(setupTime.get('setupMin') or 0)
setupMax=float(setupTime.get('setupMax') or setupMean+5*setupStdev)
loadTime = element.get('loadTime',{})
loadDistribution = loadTime.get('loadDistribution','not found')
loadMean = float(loadTime.get('loadMean') or 0)
loadStdev = float(loadTime.get('loadStdev') or 0)
loadMin=float(loadTime.get('loadMin') or 0)
loadMax=float(loadTime.get('loadMax') or loadMean+5*loadStdev)
setupTime = element.get('setupTime', None)
loadTime = element.get('loadTime', None)
resetOnPreemption=bool(int(element.get('resetOnPreemption') or 0))
if len(G.OperatorPoolsList)>0:
......@@ -858,10 +803,8 @@ def createObjects():
MA=MouldAssembly(id, name, 1, processingTime=processingTime, failureDistribution=failureDistribution,
MTTF=MTTF, MTTR=MTTR, availability=availability, #repairman=r,
operatorPool=machineOperatorPoolList, operationType=operationType,
loadDistribution=loadDistribution, setupDistribution=setupDistribution,
setupMean=setupMean,setupStdev=setupStdev,setupMin=setupMin,setupMax=setupMax,
loadMean=loadMean,loadStdev=loadStdev,loadMin=loadMin,loadMax=loadMax,
repairman=r, resetOnPreemption=resetOnPreemption)
setupTime=setupTime,
loadTime=loadTime, repairman=r, resetOnPreemption=resetOnPreemption)
MA.nextIds=getSuccessorList(id)
G.MachineJobShopList.append(MA)
G.MachineList.append(MA)
......
......@@ -49,22 +49,32 @@ class Machine(CoreObject):
def __init__(self, id, name, capacity=1, processingTime=None,
failureDistribution='No', MTTF=0, MTTR=0, availability=0, repairman='None',\
operatorPool='None',operationType='None',\
loadDistribution="No",loadMean=0, loadStdev=0, loadMin=0, loadMax=10,
setupDistribution="No",setupMean=0, setupStdev=0, setupMin=0, setupMax=10,
setupTime=None, loadTime=None,
isPreemptive=False, resetOnPreemption=False):
CoreObject.__init__(self, id, name)
self.type="Machine" #String that shows the type of object
if not processingTime:
processingTime = {'distributionType': 'Fixed',
'mean': 1,
'stdev': 0,
'min': 0,
}
processingTime = { 'distributionType': 'Fixed',
'mean': 1, }
if processingTime['distributionType'] == 'Normal' and\
processingTime.get('max', None) is None:
processingTime['max'] = processingTime['mean'] + 5 * processingTime['stdev']
if not setupTime:
setupTime = { 'distributionType': 'Fixed',
'mean': 1, }
if setupTime['distributionType'] == 'Normal' and\
setupTime.get('max', None) is None:
setupTime['max'] = setupTime['mean'] + 5 * setupTime['stdev']
if not loadTime:
loadTime = { 'distributionType': 'Fixed',
'mean': 1, }
if loadTime['distributionType'] == 'Normal' and\
loadTime.get('max', None) is None:
loadTime['max'] = loadTime['mean'] + 5 * loadTime['stdev']
# holds the capacity of the machine
self.capacity=capacity
# define the distribution types of the processing and failure times respectively
......@@ -103,21 +113,11 @@ class Machine(CoreObject):
# boolean to check whether the machine is being operated
self.toBeOperated = False
# define the load times
self.loadDistType=loadDistribution
self.loadRng=RandomNumberGenerator(self, self.loadDistType)
self.loadRng.mean=loadMean
self.loadRng.stdev=loadStdev
self.loadRng.min=loadMin
self.loadRng.max=loadMax
self.loadRng = RandomNumberGenerator(self, **loadTime)
# variable that informs on the need for setup
self.setUp=True
# define the setup times
self.setupDistType=setupDistribution
self.stpRng=RandomNumberGenerator(self, self.setupDistType)
self.stpRng.mean=setupMean
self.stpRng.stdev=setupStdev
self.stpRng.min=setupMin
self.stpRng.max=setupMax
self.stpRng = RandomNumberGenerator(self, **setupTime)
# examine if there are multiple operation types performed by the operator
# there can be Setup/Processing operationType
# or the combination of both (MT-Load-Setup-Processing)
......
......@@ -85,8 +85,8 @@ class MachineJobShop(Machine):
self.procTime=float(processingTime.get('mean', 0))
setupTime=activeEntity.remainingRoute[0].get('setupTime',{})
self.distType=setupTime.get('setupDistribution','Fixed')
self.setupTime=float(setupTime.get('setupMean', 0))
self.distType=setupTime.get('distributionType','Fixed')
self.setupTime=float(setupTime.get('mean', 0))
import Globals
# read the list of next stations
......@@ -237,8 +237,8 @@ class MachineJobShop(Machine):
self.giver.sortEntities()
activeEntity=self.giver.getActiveObjectQueue()[0]
loadTime=activeEntity.remainingRoute[0].get('loadTime',{})
self.distType=loadTime.get('loadDistribution','Fixed')
self.loadTime=float(loadTime.get('loadMean', 0))
self.distType=loadTime.get('distributionType','Fixed')
self.loadTime=float(loadTime.get('mean', 0))
# =======================================================================
# removes an entity from the Machine
......
......@@ -44,13 +44,18 @@ class OperatedMachine(Machine):
# =======================================================================
# initialise the id the capacity, of the resource and the distribution
# =======================================================================
def __init__(self, id, name, capacity=1, distribution='Fixed', mean=1, stdev=0, min=0, max=10,\
def __init__(self, id, name, capacity=1, processingTime=None,
failureDistribution='No', MTTF=0, MTTR=0, availability=0, repairman='None',\
operatorPool='None',operationType='None',\
loadDistribution="No",loadMean=0, loadStdev=0, loadMin=0, loadMax=10,
setupDistribution="No",setupMean=0, setupStdev=0, setupMin=0, setupMax=10):
Machine.__init__(self, id, name, capacity, distribution, mean, stdev, min, max,\
failureDistribution, MTTF, MTTR, availability, repairman)
operatorPool='None',operationType='None',
setupTime=None, loadTime=None):
Machine.__init__(self, id, name, capacity=capacity,
processingTime=processingTime,
failureDistribution=failureDistribution, MTTF=MTTF,
MTTR=MTTR, availability=availability,
repairman=repairman, operatorPool=operatorPool,
operationType=operationType, setupTime=setupTime,
loadTime=loadTime,)
# type of the machine
self.type = "OperatedMachine"
# sets the operator resource of the Machine
......@@ -76,22 +81,7 @@ class OperatedMachine(Machine):
self.operationType=operationType
# boolean to check weather the machine is being operated
self.toBeOperated = False
# define the load times
self.loadDistType=loadDistribution
self.loadRng=RandomNumberGenerator(self, self.loadDistType)
self.loadRng.mean=loadMean
self.loadRng.stdev=loadStdev
self.loadRng.min=loadMin
self.loadRng.max=loadMax
# variable that informs on the need for setup
self.setUp=True
# define the setup times
self.setupDistType=setupDistribution
self.stpRng=RandomNumberGenerator(self, self.setupDistType)
self.stpRng.mean=setupMean
self.stpRng.stdev=setupStdev
self.stpRng.min=setupMin
self.stpRng.max=setupMax
# examine if there are multiple operation types performed by the operator
# there can be Setup/Processing operationType
# or the combination of both (MT-Load-Setup-Processing)
......
......@@ -57,6 +57,14 @@ def positionGraph(g):
def format(m):
for node in m['nodes'].values():
if 'setupTime' in node:
setupTime = node['setupTime']
if 'mean' in setupTime:
setupTime['mean'] = float(setupTime['mean'])
if 'loadTime' in node:
loadTime = node['loadTime']
if 'mean' in loadTime:
loadTime['mean'] = float(loadTime['mean'])
if 'processingTime' in node:
processingTime = node['processingTime']
if 'mean' in processingTime:
......@@ -75,6 +83,14 @@ def format(m):
processingTime = r['processingTime']
if 'mean' in processingTime:
processingTime['mean'] = float(processingTime['mean'])
if 'loadTime' in r:
loadTime = r['loadTime']
if 'mean' in loadTime:
loadTime['mean'] = float(loadTime['mean'])
if 'setupTime' in r:
setupTime = r['setupTime']
if 'mean' in setupTime:
setupTime['mean'] = float(setupTime['mean'])
for component in job.get('componentsList', []):
for r in component['route']:
r.pop("stepNumber", None)
......
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