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
26361c3a
Commit
26361c3a
authored
Nov 03, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
view to download the ACO details in Excel added. Details not inserted yet
parent
a274e551
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
2 deletions
+30
-2
dream/plugins/Batches/BatchesStochasticACO.py
dream/plugins/Batches/BatchesStochasticACO.py
+20
-2
dream/simulation/Examples/GUI_models/BatchesStochasticACO.json
.../simulation/Examples/GUI_models/BatchesStochasticACO.json
+10
-0
No files found.
dream/plugins/Batches/BatchesStochasticACO.py
View file @
26361c3a
...
...
@@ -12,6 +12,10 @@ from dream.simulation.Operator import Operator
from
dream.simulation.Globals
import
getClassFromName
from
dream.plugins.Batches.BatchesACO
import
BatchesACO
import
xlwt
import
StringIO
class
BatchesStochasticACO
(
BatchesACO
):
# def run(self, data):
...
...
@@ -67,8 +71,12 @@ class BatchesStochasticACO(BatchesACO):
def
run
(
self
,
data
):
"""Preprocess the data.
"""
print
'I am IN'
outputFile
=
xlwt
.
Workbook
()
outputSheet
=
outputFile
.
add_sheet
(
'ACO Results'
,
cell_overwrite_ok
=
True
)
rowIndex
=
0
columnIndex
=
0
outputSheet
.
write
(
rowIndex
,
columnIndex
,
'Test'
)
distributor_url
=
data
[
'general'
].
get
(
'distributorURL'
)
distributor
=
None
if
distributor_url
:
...
...
@@ -231,5 +239,15 @@ class BatchesStochasticACO(BatchesACO):
result
[
'key'
]
=
ant
[
'key'
]
result_list
.
append
(
result
)
# return the workbook as encoded
outputStringIO
=
StringIO
.
StringIO
()
outputFile
.
save
(
outputStringIO
)
encodedOutputFile
=
outputStringIO
.
getvalue
().
encode
(
'base64'
)
data
[
'result'
][
'result_list'
][
-
1
][
'output_ACO_spreadsheet'
]
=
{
'name'
:
'ACO details.xls'
,
'mime_type'
:
'application/vnd.ms-excel'
,
'data'
:
encodedOutputFile
}
self
.
logger
.
info
(
"ACO finished, execution time %0.2fs"
%
(
time
.
time
()
-
start
))
return
data
\ No newline at end of file
dream/simulation/Examples/GUI_models/BatchesStochasticACO.json
View file @
26361c3a
...
...
@@ -400,6 +400,16 @@
"priority"
:
6
,
"title"
:
"Station Utilization"
,
"type"
:
"object_view"
},
"view_output_ACO_spreadsheet"
:
{
"configuration"
:
{
"handsontable_options"
:
{},
"output_id"
:
"output_ACO_spreadsheet"
},
"gadget"
:
"Output_viewDownloadFile"
,
"priority"
:
20
,
"title"
:
"ACO Details"
,
"type"
:
"object_view"
}
},
"post_processing"
:
{
...
...
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