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):
from dream.simulation.applications.DemandPlanning.Globals import G
utilisation=G.Utilisation
# XXX current implementation for one bottleneck
bottleNeckUtilization=G.Utilisation['BE_T_BE1S_TEST_EQ_FLEX_T417_3']
dateList=[]
# get the current date from the data
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')
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 bottleneck in ['BE_A_VF78_DSO_3','BE_A_VK18_DKO_5']:
bottleNeckUtilization=G.Utilisation[bottleneck]
dateList=[]
# get the current date from the data
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]])
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
......@@ -62,6 +62,12 @@
"name": "Minimum Delta Utilisation",
"type": "number"
},
"MAProportionality": {
"default": 0.5,
"description": "Mutation Proportionality",
"name": "Mutation Proportionality",
"type": "number"
},
"GA": {
"default": 1,
"description": "GA",
......@@ -142,14 +148,22 @@
"title": "Download Result Spreadsheet",
"type": "object_view"
},
"view_utilization_stats": {
"view_utilization_stats1": {
"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",
"title": "Bottleneck Utilization",
"title": "BE_A_VK18_DKO_5 Utilization",
"type": "object_view"
}
}
},
"post_processing": {
"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