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
4e5c9b56
Commit
4e5c9b56
authored
Jun 04, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
version of Capacity Stations enumeration added. Calculcation of scenario score is still dummy
parent
a0466d64
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
dream/plugins/CapacityStations/CapacityStationsEnumeration.py
...m/plugins/CapacityStations/CapacityStationsEnumeration.py
+49
-0
No files found.
dream/plugins/CapacityStations/CapacityStationsEnumeration.py
0 → 100644
View file @
4e5c9b56
from
dream.plugins.Enumeration
import
Enumeration
from
pprint
import
pformat
from
copy
import
copy
,
deepcopy
import
json
import
time
import
random
import
operator
import
xmlrpclib
import
signal
from
multiprocessing
import
Pool
# # run an ant in a subrocess. Can be parrallelized.
# def runAntInSubProcess(ant):
# ant['result'] = plugin.ExecutionPlugin.runOneScenario(ant['input'])['result']
# return ant
# enumeration in order to search for the optimal threshold
class
CapacityStationsEnumeration
(
Enumeration
):
def
calculateScenarioScore
(
self
,
scenario
):
return
1
# creates the collated scenarios, i.e. the list
# of options collated into a dictionary for ease of referencing in ManPy
def
createScenarioList
(
self
,
data
):
scenarioList
=
[]
step
=
data
[
'general'
].
get
(
'thresholdStep'
,
7
)
dueDates
=
[]
for
project
in
data
[
'input'
][
'BOM'
][
'productionOrders'
]:
dueDates
.
append
(
project
[
'dueDate'
])
minimum
=
min
(
dueDates
)
maximum
=
max
(
dueDates
)
thresholds
=
[]
for
i
in
range
(
0
,
int
(
maximum
-
minimum
),
step
):
thresholds
.
append
(
i
)
thresholds
.
append
(
int
(
maximum
-
minimum
)
+
1
)
for
threshold
in
thresholds
:
scenarioList
.
append
({
'key'
:
str
(
threshold
),
'threshold'
:
threshold
})
return
scenarioList
# creates the ant scenario based on what ACO randomly selected
def
createScenarioData
(
self
,
data
,
scenario
):
scenarioData
=
deepcopy
(
data
)
scenarioData
[
'graph'
][
'node'
][
'CSC'
][
'dueDateThreshold'
]
=
scenario
[
'threshold'
]
return
scenarioData
# checks if the algorithm should terminate. Default is set to False so that the algorithm
# terminates only when all scenarios are considered
def
checkIfShouldTerminate
(
self
,
data
,
scenarioList
):
return
False
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