Commit 17452863 authored by Georgios Dagkakis's avatar Georgios Dagkakis

support NonStarvingEntry in the optimization model

parent b063e29b
...@@ -20,8 +20,8 @@ class AddBatchStations(plugin.InputPreparationPlugin): ...@@ -20,8 +20,8 @@ class AddBatchStations(plugin.InputPreparationPlugin):
# get the number of units for a standard batch # get the number of units for a standard batch
standardBatchUnits=0 standardBatchUnits=0
for node_id, node in nodes.iteritems(): for node_id, node in nodes.iteritems():
if node['_class']=='Dream.BatchSource': if node['_class'] in ['Dream.BatchSource', 'Dream.NonStarvingEntry']:
standardBatchUnits=int(node['batchNumberOfUnits']) standardBatchUnits=int(node['entityData']['numberOfUnits'])
# loop through all the objects and set that the name will be equal to the id # loop through all the objects and set that the name will be equal to the id
for node_id, node in nodes.iteritems(): for node_id, node in nodes.iteritems():
...@@ -69,7 +69,7 @@ class AddBatchStations(plugin.InputPreparationPlugin): ...@@ -69,7 +69,7 @@ class AddBatchStations(plugin.InputPreparationPlugin):
if node['_class']=='Dream.BatchDecompositionBlocking': if node['_class']=='Dream.BatchDecompositionBlocking':
predecessorId=self.getPredecessors(data, node_id)[0] predecessorId=self.getPredecessors(data, node_id)[0]
predecessorClass=nodes[predecessorId]['_class'] predecessorClass=nodes[predecessorId]['_class']
if predecessorClass=='Dream.BatchSource': if predecessorClass in ['Dream.BatchSource', 'Dream.NonStarvingEntry']:
data['graph']['node'][node_id]['_class']='Dream.BatchDecompositionStartTime' data['graph']['node'][node_id]['_class']='Dream.BatchDecompositionStartTime'
# loop through the nodes # loop through the nodes
......
...@@ -24,8 +24,8 @@ class BatchesWIPKEtool(plugin.InputPreparationPlugin): ...@@ -24,8 +24,8 @@ class BatchesWIPKEtool(plugin.InputPreparationPlugin):
# get the number of units for a standard batch # get the number of units for a standard batch
standardBatchUnits=0 standardBatchUnits=0
for node_id, node in nodes.iteritems(): for node_id, node in nodes.iteritems():
if node['_class']=='Dream.BatchSource': if node['_class'] in ['Dream.BatchSource', 'Dream.NonStarvingEntry']:
standardBatchUnits=int(node['batchNumberOfUnits']) standardBatchUnits=int(node['entityData']['numberOfUnits'])
node['wip']=[] node['wip']=[]
data_uri_encoded_input_data = data['input'].get(self.configuration_dict['input_id'], {}) data_uri_encoded_input_data = data['input'].get(self.configuration_dict['input_id'], {})
......
...@@ -23,8 +23,8 @@ class BatchesWIPShort(plugin.InputPreparationPlugin): ...@@ -23,8 +23,8 @@ class BatchesWIPShort(plugin.InputPreparationPlugin):
# get the number of units for a standard batch # get the number of units for a standard batch
standardBatchUnits=0 standardBatchUnits=0
for node_id, node in nodes.iteritems(): for node_id, node in nodes.iteritems():
if node['_class']=='Dream.BatchSource': if node['_class'] in ['Dream.BatchSource', 'Dream.NonStarvingEntry']:
standardBatchUnits=int(node['batchNumberOfUnits']) standardBatchUnits=int(node['entityData']['numberOfUnits'])
node['wip']=[] node['wip']=[]
# remove the titles # remove the titles
......
...@@ -25,8 +25,8 @@ class BatchesWIPSpreadsheet(plugin.InputPreparationPlugin): ...@@ -25,8 +25,8 @@ class BatchesWIPSpreadsheet(plugin.InputPreparationPlugin):
# get the number of units for a standard batch # get the number of units for a standard batch
standardBatchUnits=0 standardBatchUnits=0
for node_id, node in nodes.iteritems(): for node_id, node in nodes.iteritems():
if node['_class']=='Dream.BatchSource': if node['_class'] in ['Dream.BatchSource', 'Dream.NonStarvingEntry']:
standardBatchUnits=int(node['batchNumberOfUnits']) standardBatchUnits=int(node['entityData']['numberOfUnits'])
node['wip']=[] node['wip']=[]
if wipData: if wipData:
......
...@@ -455,7 +455,7 @@ class SkilledRouter(Router): ...@@ -455,7 +455,7 @@ class SkilledRouter(Router):
def getPreviousQueue(self, machine): def getPreviousQueue(self, machine):
predecessor=machine.previous[0] predecessor=machine.previous[0]
while 1: while 1:
if "Source" in str(predecessor.__class__): if "Source" in str(predecessor.__class__) or "NonStarvingEntry" in str(predecessor.__class__):
return None return None
if "Queue" in str(predecessor.__class__) or "Clearance" in str(predecessor.__class__): if "Queue" in str(predecessor.__class__) or "Clearance" in str(predecessor.__class__):
return predecessor return predecessor
......
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