Commit c29f9168 authored by Georgios Dagkakis's avatar Georgios Dagkakis

nonStarvingEntry to be able to accept other types of entities and their args....

nonStarvingEntry to be able to accept other types of entities and their args. One test with Batches added
parent c501105b
{
"_class": "Dream.Simulation",
"edges": {
"0": [
"NS1",
"M1",
{}
],
"1": [
"M1",
"E1",
{}
]
},
"general": {
"_class": "Dream.Configuration",
"confidenceLevel": "0.95",
"maxSimTime": "10",
"numberOfReplications": "1",
"trace": "No"
},
"nodes": {
"E1": {
"_class": "Dream.Exit",
"left": 0.5,
"name": "Stock",
"top": 0.10215053763440862
},
"M1": {
"_class": "Dream.BatchScrapMachine",
"failures": {
"failureDistribution": "No"
},
"left": 0.5,
"name": "Moulding",
"processingTime": {
"distributionType": "Fixed",
"mean": 0.02
},
"top": 0.5
},
"NS1": {
"_class": "Dream.NonStarvingEntry",
"entityData": {
"_class": "Dream.Batch",
"numberOfUnits":"100"
},
"left": 0.5,
"name": "Raw Material",
"top": 0.8978494623655914
}
}
}
\ No newline at end of file
...@@ -59,12 +59,15 @@ class NonStarvingEntry(Queue): ...@@ -59,12 +59,15 @@ class NonStarvingEntry(Queue):
from Globals import G from Globals import G
import Globals import Globals
entityType=self.entityData.get('_class', None) entityType=self.entityData.get('_class', None)
extraArgs=dict(self.entityData)
extraArgs.pop('_class')
assert entityType, 'the entity type of the non starving buffer could not be identified' assert entityType, 'the entity type of the non starving buffer could not be identified'
entityType=Globals.getClassFromName(entityType) entityType=Globals.getClassFromName(entityType)
Eargs={'id':G.numberOfEntities, Eargs={'id':G.numberOfEntities,
'name':str(entityType)+str(G.numberOfEntities), 'name':str(entityType)+str(G.numberOfEntities),
'currentStation':self 'currentStation':self
} }
Eargs.update(extraArgs)
E=entityType(**Eargs) E=entityType(**Eargs)
Globals.setWIP([E]) Globals.setWIP([E])
G.numberOfEntities+=1 G.numberOfEntities+=1
......
{
"_class": "Dream.Simulation",
"elementList": [
{
"_class": "Dream.Exit",
"family": "Exit",
"id": "E1",
"results": {
"lifespan": 5.0,
"takt_time": 2.0,
"throughput": 4,
"unitsThroughput": 400
}
},
{
"_class": "Dream.BatchScrapMachine",
"family": "Server",
"id": "M1",
"results": {
"blockage_ratio": 0.0,
"failure_ratio": 0.0,
"waiting_ratio": 0.0,
"working_ratio": 100.0
}
},
{
"_class": "Dream.NonStarvingEntry",
"family": "Entry",
"id": "NS1",
"results": {}
}
],
"general": {
"_class": "Dream.Configuration"
}
}
\ No newline at end of file
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