Commit 7c768330 authored by Georgios Dagkakis's avatar Georgios Dagkakis

instance and plugin updated to output 2 lines

parent 93b606e8
...@@ -11,46 +11,48 @@ class DemandPlanningLine(plugin.OutputPreparationPlugin, TimeSupportMixin): ...@@ -11,46 +11,48 @@ class DemandPlanningLine(plugin.OutputPreparationPlugin, TimeSupportMixin):
from dream.simulation.applications.DemandPlanning.Globals import G from dream.simulation.applications.DemandPlanning.Globals import G
utilisation=G.Utilisation utilisation=G.Utilisation
# XXX current implementation for one bottleneck # XXX current implementation for one bottleneck
bottleNeckUtilization=G.Utilisation['BE_T_BE1S_TEST_EQ_FLEX_T417_3'] for bottleneck in ['BE_A_VF78_DSO_3','BE_A_VK18_DKO_5']:
dateList=[] bottleNeckUtilization=G.Utilisation[bottleneck]
# get the current date from the data dateList=[]
for record_id,record in bottleNeckUtilization.iteritems(): # get the current date from the data
year=str(record_id)[0:4]
week=str(record_id)[4:]
fullDate=datetime.strptime(year+'-'+week+'-0', '%Y-%W-%w')
dateList.append(fullDate)
currentDate=str(min(dateList))
currentDate=currentDate.replace('-', '/')
data['general']['currentDate']=currentDate
data['general']['timeUnit']='week'
self.initializeTimeSupport(data)
result = data['result']['result_list'][-1]
series = []
options = {
"xaxis": {
"mode": "time",
"minTickSize": [1, self.getTimeUnitText()],
}
}
result[self.configuration_dict['output_id']] = {
"series": series,
"options": options
}
# create the 3 lines
for utilizationType in ['averageUtilization','minUtilization','maxUtilization']:
utilizationList=[]
for record_id,record in bottleNeckUtilization.iteritems(): for record_id,record in bottleNeckUtilization.iteritems():
year=str(record_id)[0:4] year=str(record_id)[0:4]
week=str(record_id)[4:] week=str(record_id)[4:]
fullDate=datetime.strptime(year+'-'+week+'-0', '%Y-%W-%w') fullDate=datetime.strptime(year+'-'+week+'-0', '%Y-%W-%w')
utilizationList.append([fullDate,record[utilizationType]]) dateList.append(fullDate)
currentDate=str(min(dateList))
currentDate=currentDate.replace('-', '/')
data['general']['currentDate']=currentDate
data['general']['timeUnit']='week'
self.initializeTimeSupport(data)
result = data['result']['result_list'][-1]
series = []
options = {
"xaxis": {
"mode": "time",
"minTickSize": [1, self.getTimeUnitText()],
}
}
result[bottleneck] = {
"series": series,
"options": options
}
# create the 3 lines
for utilizationType in ['averageUtilization','minUtilization','maxUtilization']:
utilizationList=[]
for record_id,record in bottleNeckUtilization.iteritems():
year=str(record_id)[0:4]
week=str(record_id)[4:]
fullDate=datetime.strptime(year+'-'+week+'-0', '%Y-%W-%w')
utilizationList.append([fullDate,record[utilizationType]])
utilizationList.sort(key=lambda x: x[0], reverse=True)
series.append({
"label": utilizationType,
"data": [((time-datetime(1970, 1, 1)).total_seconds()*1000, value) for (time, value) in utilizationList]
})
utilizationList.sort(key=lambda x: x[0], reverse=True)
series.append({
"label": utilizationType,
"data": [((time-datetime(1970, 1, 1)).total_seconds()*1000, value) for (time, value) in utilizationList]
})
return data return data
...@@ -62,6 +62,12 @@ ...@@ -62,6 +62,12 @@
"name": "Minimum Delta Utilisation", "name": "Minimum Delta Utilisation",
"type": "number" "type": "number"
}, },
"MAProportionality": {
"default": 0.5,
"description": "Mutation Proportionality",
"name": "Mutation Proportionality",
"type": "number"
},
"GA": { "GA": {
"default": 1, "default": 1,
"description": "GA", "description": "GA",
...@@ -142,14 +148,22 @@ ...@@ -142,14 +148,22 @@
"title": "Download Result Spreadsheet", "title": "Download Result Spreadsheet",
"type": "object_view" "type": "object_view"
}, },
"view_utilization_stats": { "view_utilization_stats1": {
"configuration": { "configuration": {
"output_id": "bottleneck_utilization" "output_id": "BE_A_VF78_DSO_3"
},
"gadget": "Output_viewGraph",
"title": "BE_A_VF78_DSO_3 Utilization",
"type": "object_view"
},
"view_utilization_stats2": {
"configuration": {
"output_id": "BE_A_VK18_DKO_5"
}, },
"gadget": "Output_viewGraph", "gadget": "Output_viewGraph",
"title": "Bottleneck Utilization", "title": "BE_A_VK18_DKO_5 Utilization",
"type": "object_view" "type": "object_view"
} }
}, },
"post_processing": { "post_processing": {
"plugin_list": [ "plugin_list": [
......
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