Commit cce06137 authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Sebastien Robin

topology21 developed to test new objects. LineGenerationJSON.py updated to...

topology21 developed to test new objects. LineGenerationJSON.py updated to read the JSON input for BatchSiurce and BatchDecomposition. Test updated to include topology21
parent ef629a99
{
"_class": "Dream.Simulation",
"edges": {
"0": [
"S1",
"Q1",
{}
],
"1": [
"Q1",
"BD1",
{}
],
"2": [
"BD1",
"M1",
{}
],
"3": [
"M1",
"E1",
{}
]
},
"general": {
"_class": "Dream.Configuration",
"confidenceLevel": "0.95",
"maxSimTime": "1440",
"numberOfReplications": "1",
"trace": "No"
},
"nodes": {
"Q1": {
"_class": "Dream.Queue",
"capacity": "100000",
"left": 0.6968085106382979,
"name": "StartQueue",
"top": 0.7727272727272727
},
"E1": {
"_class": "Dream.Exit",
"left": 0.2978723404255319,
"name": "Stock",
"top": 0.045454545454545414
},
"M1": {
"_class": "Dream.Machine",
"left": 0.4414893617021277,
"name": "Station1",
"failures": {
},
"processingTime": {
"distributionType": "Fixed",
"mean": "0.5"
},
"top": 0.5909090909090908
},
"S1": {
"_class": "Dream.BatchSource",
"entity": "Batch",
"batchNumberOfUnits": 80,
"interarrivalTime": {
"distributionType": "Fixed",
"mean": "0.5"
},
"left": 0.6968085106382979,
"name": "Source",
"top": 0.9545454545454546
},
"BD1": {
"_class": "Dream.BatchDecomposition",
"left": 0.4414893617021277,
"name": "Batch_Decomposition",
"numberOfSubBatches": 4,
"processingTime": {
"distributionType": "Fixed",
"mean": "1"
},
"top": 0.5909090909090908
}
}
}
\ No newline at end of file
......@@ -69,6 +69,9 @@ from QueueJobShop import QueueJobShop
from ExitJobShop import ExitJobShop
from Batch import Batch
from SubBatch import SubBatch
from BatchSource import BatchSource
from BatchDecomposition import BatchDecomposition
import xlwt
import xlrd
import time
......@@ -120,6 +123,8 @@ def createObjects():
G.MachineJobShopList=[]
G.QueueJobShopList=[]
G.ExitJobShopList=[]
G.BatchDecompositionList=[]
G.BatchSourceList=[]
#loop through all the model resources
#search for repairmen in order to create them
......@@ -151,6 +156,20 @@ def createObjects():
G.SourceList.append(S)
G.ObjList.append(S)
if objClass=='Dream.BatchSource':
id=element.get('id', 'not found')
name=element.get('name', 'not found')
interarrivalTime=element.get('interarrivalTime', 'not found')
distributionType=interarrivalTime.get('distributionType', 'not found')
mean=float(interarrivalTime.get('mean', '0'))
entity=str_to_class(element.get('entity', 'not found'))
batchNumberOfUnits=int(element.get('batchNumberOfUnits', 'not found'))
S=BatchSource(id, name, distributionType, mean, entity, batchNumberOfUnits)
S.nextIds=getSuccessorList(id)
G.BatchSourceList.append(S)
G.SourceList.append(S)
G.ObjList.append(S)
elif objClass=='Dream.Machine':
id=element.get('id', 'not found')
name=element.get('name', 'not found')
......@@ -313,7 +332,23 @@ def createObjects():
J=Job(id, name, route, priority=priority, dueDate=dueDate, orderDate=orderDate)
G.JobList.append(J)
G.WipList.append(J)
G.EntityList.append(J)
G.EntityList.append(J)
elif objClass=='Dream.BatchDecomposition':
id=element.get('id', 'not found')
name=element.get('name', 'not found')
processingTime=element.get('processingTime', 'not found')
distributionType=processingTime.get('distributionType', 'not found')
mean=float(processingTime.get('mean', '0'))
stdev=float(processingTime.get('stdev', '0'))
min=float(processingTime.get('min', '0'))
max=float(processingTime.get('max', '0'))
numberOfSubBatches=int(element.get('numberOfSubBatches', '0'))
BD=BatchDecomposition(id, name, distribution=distributionType, numberOfSubBatches=numberOfSubBatches,
mean=mean,stdev=stdev,min=min,max=max)
BD.nextIds=getSuccessorList(id)
G.BatchDecompositionList.append(BD)
G.ObjList.append(BD)
#loop through all the core objects
#to read predecessors
......
{
"elementList": [
{
"_class": "Dream.Exit",
"id": "E1",
"results": {
"throughput": 2303,
"takt_time": 0.6252713851498046,
"lifespan": 720.687581415545
}
},
{
"_class": "Dream.Machine",
"id": "M1",
"results": {
"working_ratio": 79.96527777777777,
"blockage_ratio": 0.0,
"failure_ratio": 0.0,
"waiting_ratio": 20.03472222222222
}
}
],
"_class": "Dream.Simulation",
"general": {
"_class": "Dream.Configuration"
}
}
\ No newline at end of file
......@@ -66,7 +66,7 @@ class SimulationTopology(TestCase):
self.assertEquals(stable_result, dump_result, "outputs are different")
# Automatically create a test method for every topology
for x in range(1, 21):
for x in range(1, 22):
def getTestTopology():
filename = "Topology%02i" % x
def test_topology(self):
......
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