Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
b49f75a6
Commit
b49f75a6
authored
Feb 24, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
batches instance set with two more post processing plugins (empty for now)
parent
2a951bc7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
172 additions
and
10 deletions
+172
-10
dream/plugins/BatchesOperatorGantt.py
dream/plugins/BatchesOperatorGantt.py
+55
-0
dream/plugins/BatchesOperatorUtilization.py
dream/plugins/BatchesOperatorUtilization.py
+93
-0
dream/simulation/Examples/GUI_instances/BatchAllInOneEmpty.json
...simulation/Examples/GUI_instances/BatchAllInOneEmpty.json
+24
-10
No files found.
dream/plugins/BatchesOperatorGantt.py
0 → 100644
View file @
b49f75a6
from
datetime
import
datetime
import
random
from
pprint
import
pformat
from
dream.plugins
import
plugin
from
dream.plugins.TimeSupport
import
TimeSupportMixin
class
BatchesOperatorGantt
(
plugin
.
OutputPreparationPlugin
,
TimeSupportMixin
):
def
postprocess
(
self
,
data
):
"""Post process the data for Gantt gadget
"""
print
2
# # in this instance there is not need to define start time
# data['general']['dateFormat']='%Y/%m/%d'
# self.initializeTimeSupport(data)
# date_format = '%d-%m-%Y %H:%M'
# resultElements=data['result']['result_list'][-1]['elementList']
# task_dict = {}
# # loop in the results to find CapacityProjects
# for element in resultElements:
# if element['_class']=="Dream.CapacityProject":
# # add the project in the task_dict
# task_dict[element['id']] = dict(
# id=element['id'],
# text='Project %s' % element['id'],
# type='project',
# open=False)
#
# # loop in the project schedule to create the sub-tasks
# projectSchedule=element['results'].get('schedule',{})
#
# for record in projectSchedule:
# task_dict[element['id']+record['stationId']] = dict(
# id=element['id']+record['stationId'],
# parent=element['id'],
# text=record['stationId'],
# start_date=self.convertToRealWorldTime(
# record['entranceTime']).strftime(date_format),
# stop_date=self.convertToRealWorldTime(
# record['exitTime']).strftime(date_format),
# open=False,
# duration=int(record['exitTime'])-int(record['entranceTime']),
# entranceTime=record['entranceTime']
# )
#
# # return the result to the gadget
# result = data['result']['result_list'][-1]
# result[self.configuration_dict['output_id']] = dict(
# time_unit=self.getTimeUnitText(),
# task_list=sorted(task_dict.values(),
# key=lambda task: (task.get('parent'),
# task.get('type') == 'project',
# task.get('entranceTime'),task.get('id'))))
return
data
dream/plugins/BatchesOperatorUtilization.py
0 → 100644
View file @
b49f75a6
from
dream.plugins
import
plugin
from
copy
import
copy
class
BatchesOperatorUtilization
(
plugin
.
OutputPreparationPlugin
):
""" Output the station utilization metrics in a format compatible with
"""
def
postprocess
(
self
,
data
):
result
=
data
[
'result'
][
'result_list'
][
-
1
]
print
1
# ticks = []
# working_data = []
# waiting_data = []
# failure_data = []
# blockage_data = []
# off_shift_data = []
#
# options = {
# "xaxis": {
# "minTickSize": 1,
# "ticks": ticks
# },
# "yaxis": {
# "max": 100
# },
# "series": {
# "bars": {
# "show": True,
# "barWidth": 0.8,
# "align": "center"
# },
# "stack": True
# }
# }
#
# series = [{
# "label": "Working",
# "data": working_data
# }, {
# "label": "Waiting",
# "data": waiting_data
# }, {
# "label": "Failures",
# "data": failure_data
# }, {
# "label": "Blockage",
# "data": blockage_data
# },
# {
# "label": "off_shift",
# "data": off_shift_data
# }];
#
# out = result[self.configuration_dict['output_id']] = {
# "series": series,
# "options": options
# }
#
# i = 0
# for obj in result['elementList']:
# if obj.get('_class').startswith('Dream.BatchScrapMachine') or obj.get('_class')=='Dream.M3':
# nextId=self.getSuccessors(data, obj['id'])[0]
# nextClass=data['graph']['node'][nextId]['_class']
# objResults=copy(obj['results'])
#
# # if a station is before batch-reassembly then the blockage of reassembly is added to the station
# # and reducted from its waiting
# nextResults={}
# if nextClass.startswith('Dream.BatchReassembly'):
# for nextObj in result['elementList']:
# if nextObj['id']==nextId:
# nextResults=nextObj["results"]
# if nextResults:
# nextBlockage=nextResults['blockage_ratio'][0]
# objResults['blockage_ratio'][0]=nextBlockage
# objResults['waiting_ratio'][0]-=nextBlockage
#
# if objResults['working_ratio']:
# working_data.append((i, objResults['working_ratio'][0]))
# if objResults['waiting_ratio']:
# waiting_data.append((i, objResults['waiting_ratio'][0]))
# if objResults['failure_ratio']:
# failure_data.append((i, objResults['failure_ratio'][0]))
# if objResults['blockage_ratio']:
# blockage_data.append((i, objResults['blockage_ratio'][0]))
# if objResults['off_shift_ratio']:
# off_shift_data.append((i, objResults['off_shift_ratio'][0]))
#
# ticks.append((i, obj.get('name', self.getNameFromId(data, obj['id']))))
# i += 1
#
return
data
dream/simulation/Examples/GUI_instances/BatchAllInOneEmpty.json
View file @
b49f75a6
...
...
@@ -221,12 +221,10 @@
},
"view_operator_gantt"
:
{
"configuration"
:
{
"data"
:
{
"Operator"
:
[]
}
"output_id"
:
"operator_gantt"
},
"gadget"
:
"Output_viewGantt"
,
"title"
:
"Operator Gantt
"
,
"title"
:
"Operator Schedule
"
,
"type"
:
"object_view"
},
"view_queue_stats"
:
{
...
...
@@ -244,6 +242,14 @@
"gadget"
:
"Output_viewGraph"
,
"title"
:
"Station Utilization"
,
"type"
:
"object_view"
},
"view_operator_utilization"
:
{
"configuration"
:
{
"output_id"
:
"operator_utilization"
},
"gadget"
:
"Output_viewGraph"
,
"title"
:
"Operator Utilization"
,
"type"
:
"object_view"
}
},
"post_processing"
:
{
...
...
@@ -265,6 +271,14 @@
{
"_class"
:
"dream.plugins.BatchesTabularQueues.BatchesTabularQueues"
,
"output_id"
:
"buffer_output"
},
{
"_class"
:
"dream.plugins.BatchesOperatorUtilization.BatchesOperatorUtilization"
,
"output_id"
:
"operator_utilization"
},
{
"_class"
:
"dream.plugins.BatchesOperatorGantt.BatchesOperatorGantt"
,
"output_id"
:
"operator_gantt"
}
]
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment