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
cbd6fab6
Commit
cbd6fab6
authored
Jun 17, 2016
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes to make stochastic simulation lighter
parent
c1c384a3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
7 deletions
+14
-7
dream/plugins/Batches/AddBatchStations.py
dream/plugins/Batches/AddBatchStations.py
+4
-3
dream/plugins/Batches/BatchesStochasticACO.py
dream/plugins/Batches/BatchesStochasticACO.py
+9
-3
dream/plugins/Batches/ReadSkilledOperators.py
dream/plugins/Batches/ReadSkilledOperators.py
+1
-1
No files found.
dream/plugins/Batches/AddBatchStations.py
View file @
cbd6fab6
...
@@ -60,7 +60,8 @@ class AddBatchStations(plugin.InputPreparationPlugin):
...
@@ -60,7 +60,8 @@ class AddBatchStations(plugin.InputPreparationPlugin):
for
node_id
,
node
in
nodes
.
iteritems
():
for
node_id
,
node
in
nodes
.
iteritems
():
if
node
[
'_class'
]
==
'Dream.BatchReassembly'
:
if
node
[
'_class'
]
==
'Dream.BatchReassembly'
:
data
[
'graph'
][
'node'
][
node_id
][
'_class'
]
=
'Dream.BatchReassemblyBlocking'
data
[
'graph'
][
'node'
][
node_id
][
'_class'
]
=
'Dream.BatchReassemblyBlocking'
data
[
'graph'
][
'node'
][
node_id
][
'outputResults'
]
=
1
if
node_id
.
startswith
(
'St8R'
):
data
[
'graph'
][
'node'
][
node_id
][
'outputResults'
]
=
1
# loop in BatchDecompositions to change the classes to BatchDecompositionStartTime for the ones that
# loop in BatchDecompositions to change the classes to BatchDecompositionStartTime for the ones that
# are just after the source
# are just after the source
...
@@ -113,7 +114,7 @@ class AddBatchStations(plugin.InputPreparationPlugin):
...
@@ -113,7 +114,7 @@ class AddBatchStations(plugin.InputPreparationPlugin):
"mean"
:
0
"mean"
:
0
}
}
},
},
"outputResults"
:
1
,
"outputResults"
:
0
,
"numberOfSubBatches"
:
numberOfSubBatches
,
"numberOfSubBatches"
:
numberOfSubBatches
,
"wip"
:
[],
"wip"
:
[],
"_class"
:
"Dream.BatchReassemblyBlocking"
,
"_class"
:
"Dream.BatchReassemblyBlocking"
,
...
@@ -133,7 +134,7 @@ class AddBatchStations(plugin.InputPreparationPlugin):
...
@@ -133,7 +134,7 @@ class AddBatchStations(plugin.InputPreparationPlugin):
# set all the Queue types to gether wip data
# set all the Queue types to gether wip data
for
node
in
data
[
"graph"
][
"node"
].
values
():
for
node
in
data
[
"graph"
][
"node"
].
values
():
if
node
[
'_class'
]
in
[
'Dream.Queue'
,
'Dream.LineClearance'
,
'Dream.RoutingQueue'
]:
if
node
[
'_class'
]
in
[
'Dream.Queue'
,
'Dream.LineClearance'
,
'Dream.RoutingQueue'
]:
node
[
'gatherWipStat'
]
=
1
node
[
'gatherWipStat'
]
=
0
return
data
return
data
...
...
dream/plugins/Batches/BatchesStochasticACO.py
View file @
cbd6fab6
...
@@ -233,7 +233,8 @@ class BatchesStochasticACO(BatchesACO):
...
@@ -233,7 +233,8 @@ class BatchesStochasticACO(BatchesACO):
for
ant
in
antsInCurrentGeneration
:
for
ant
in
antsInCurrentGeneration
:
if
ant
[
'evaluationType'
]
==
'deterministic'
:
if
ant
[
'evaluationType'
]
==
'deterministic'
:
ant
[
'score'
]
=
0
ant
[
'score'
]
=
0
# ants.remove(ant)
# if we had stochastic evaluation keep only those ants in sorting
# if we had stochastic evaluation keep only those ants in sorting
if
numberOfAntsForStochasticEvaluationInGeneration
:
if
numberOfAntsForStochasticEvaluationInGeneration
:
uniqueAntsInThisGeneration
=
dict
()
uniqueAntsInThisGeneration
=
dict
()
...
@@ -241,10 +242,15 @@ class BatchesStochasticACO(BatchesACO):
...
@@ -241,10 +242,15 @@ class BatchesStochasticACO(BatchesACO):
ant_result
,
=
copy
(
ant
[
'result'
][
'result_list'
])
ant_result
,
=
copy
(
ant
[
'result'
][
'result_list'
])
ant_result
=
json
.
dumps
(
ant_result
,
sort_keys
=
True
)
ant_result
=
json
.
dumps
(
ant_result
,
sort_keys
=
True
)
uniqueAntsInThisGeneration
[
ant_result
]
=
ant
uniqueAntsInThisGeneration
[
ant_result
]
=
ant
antsForNextGeneration
=
sorted
(
uniqueAntsInThisGeneration
.
values
(),
antsForNextGeneration
=
sorted
(
uniqueAntsInThisGeneration
.
values
(),
key
=
operator
.
itemgetter
(
'score'
))[:
numberOfAntsForNextGeneration
]
key
=
operator
.
itemgetter
(
'score'
))[:
numberOfAntsForNextGeneration
]
# Keep only ants that carry pheromone at the ants list
for
ant
in
antsInCurrentGeneration
:
if
not
ant
in
antsForNextGeneration
:
ants
.
remove
(
ant
)
for
l
in
antsForNextGeneration
:
for
l
in
antsForNextGeneration
:
self
.
outputSheet
.
write
(
self
.
rowIndex
,
1
,
'Ant to carry pheromone to next generation'
)
self
.
outputSheet
.
write
(
self
.
rowIndex
,
1
,
'Ant to carry pheromone to next generation'
)
self
.
outputSheet
.
write
(
self
.
rowIndex
,
2
,
l
[
'key'
])
self
.
outputSheet
.
write
(
self
.
rowIndex
,
2
,
l
[
'key'
])
...
...
dream/plugins/Batches/ReadSkilledOperators.py
View file @
cbd6fab6
...
@@ -71,7 +71,7 @@ class ReadSkilledOperators(plugin.InputPreparationPlugin):
...
@@ -71,7 +71,7 @@ class ReadSkilledOperators(plugin.InputPreparationPlugin):
node
[
'SkilledRouter01'
]
=
{
#(random id)
node
[
'SkilledRouter01'
]
=
{
#(random id)
"_class"
:
"dream.simulation.SkilledOperatorRouter.SkilledRouter"
,
"_class"
:
"dream.simulation.SkilledOperatorRouter.SkilledRouter"
,
"name"
:
"SkilledRouter01"
,
"name"
:
"SkilledRouter01"
,
"outputSolutions"
:
1
,
"outputSolutions"
:
0
,
"twoPhaseSearch"
:
int
(
data
[
'general'
].
get
(
'twoPhaseSearch'
,
0
)),
"twoPhaseSearch"
:
int
(
data
[
'general'
].
get
(
'twoPhaseSearch'
,
0
)),
"checkCondition"
:
1
"checkCondition"
:
1
}
}
...
...
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