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