Commit 6aaa08e1 authored by Georgios Dagkakis's avatar Georgios Dagkakis

plugin made more generic

parent bb5c7477
...@@ -35,6 +35,8 @@ class CreateCapacityStations(plugin.InputPreparationPlugin): ...@@ -35,6 +35,8 @@ class CreateCapacityStations(plugin.InputPreparationPlugin):
} }
if requireFullProject: if requireFullProject:
data['graph']['node'][bufferId]['notRequiredOperations']=self.findNotRequiredOperations(originalData,stationId) data['graph']['node'][bufferId]['notRequiredOperations']=self.findNotRequiredOperations(originalData,stationId)
data['graph']['node'][stationId]['notProcessOutsideThreshold']=1
# create an edge that connects the CapacityStationBuffer to the CapacityStation # create an edge that connects the CapacityStationBuffer to the CapacityStation
data['graph']['edge'][bufferId+'_to_'+stationId]={ data['graph']['edge'][bufferId+'_to_'+stationId]={
...@@ -60,19 +62,22 @@ class CreateCapacityStations(plugin.InputPreparationPlugin): ...@@ -60,19 +62,22 @@ class CreateCapacityStations(plugin.InputPreparationPlugin):
"_class": "Dream.Edge" "_class": "Dream.Edge"
} }
# XXX another patch, these should be inputted # if projects shares from a pool read which others share resources and create
if stationId=='PPASB': # the sharedResources element
data['graph']['node'][stationId]['sharedResources']={ pool = data['graph']['node'][stationId].get('pool','')
"stationIds": ["ASBTST"], if pool:
"priority": 3 sharingStations=[]
} priority=data['graph']['node'][stationId].get('priority',None)
data['graph']['node'][stationId]['notProcessOutsideThreshold']=1 for other_id, other_node in originalData['graph']['node'].iteritems():
if stationId=='ASBTST': if other_id==stationId:
continue
otherPool=other_node.get('pool','')
if otherPool==pool:
sharingStations.append(other_id)
data['graph']['node'][stationId]['sharedResources']={ data['graph']['node'][stationId]['sharedResources']={
"stationIds": ["PPASB"], "stationIds": sharingStations,
"priority": 2 "priority": priority
} }
data['graph']['node'][stationId]['notProcessOutsideThreshold']=1
# add also a CapacityStationController # add also a CapacityStationController
# XXX some of the attributes should be inputted by the user # XXX some of the attributes should be inputted by the user
......
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