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
a461b4fe
Commit
a461b4fe
authored
Aug 21, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
further cleanup
parent
12005824
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
23 deletions
+9
-23
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+9
-23
No files found.
dream/simulation/LineGenerationJSON.py
View file @
a461b4fe
...
...
@@ -184,6 +184,7 @@ def createObjects():
G
.
CapacityStationList
=
[]
G
.
CapacityStationExitList
=
[]
G
.
CapacityStationControllerList
=
[]
G
.
ObjectInterruptionList
=
[]
'''
loop through all the model resources
...
...
@@ -330,8 +331,9 @@ def createObjects():
EV
=
EventGenerator
(
id
,
name
,
start
=
start
,
stop
=
stop
,
interval
=
interval
,
duration
=
duration
,
method
=
method
,
argumentDict
=
argumentDict
)
# create the EventGenerator object
# calling the getSuccessorList() method on the repairman
G
.
EventGeneratorList
.
append
(
EV
)
# add the Event Generator to the RepairmanList
G
.
EventGeneratorList
.
append
(
EV
)
G
.
ObjectInterruptionList
.
append
(
EV
)
elif
elementClass
==
'Dream.CapacityStationController'
:
# check the object type
id
=
element
.
get
(
'id'
,
'not found'
)
# get the id of the element / default 'not_found'
...
...
@@ -350,10 +352,10 @@ def createObjects():
# create the CapacityStationController object
CSC
=
CapacityStationController
(
id
,
name
,
start
=
start
,
stop
=
stop
,
interval
=
interval
,
duration
=
duration
,
argumentDict
=
argumentDict
,
dueDateThreshold
=
dueDateThreshold
,
prioritizeIfCanFinish
=
prioritizeIfCanFinish
)
# calling the getSuccessorList() method on the repairman
G
.
EventGeneratorList
.
append
(
CSC
)
# add the Event Generator to the RepairmanList
prioritizeIfCanFinish
=
prioritizeIfCanFinish
)
G
.
EventGeneratorList
.
append
(
CSC
)
G
.
CapacityStationControllerList
.
append
(
CSC
)
G
.
ObjectInterruptionList
.
append
(
CSC
)
# -----------------------------------------------------------------------
# loop through all the core objects
...
...
@@ -411,30 +413,15 @@ def setTopology():
# initializes all the objects that are in the topology
# ===========================================================================
def
initializeObjects
():
for
element
in
G
.
ObjList
:
for
element
in
G
.
ObjList
+
G
.
ModelResourceList
+
G
.
EntityList
+
G
.
ObjectInterruptionList
:
element
.
initialize
()
for
modelResource
in
G
.
ModelResourceList
:
modelResource
.
initialize
()
for
entity
in
G
.
EntityList
:
entity
.
initialize
()
for
ev
in
G
.
EventGeneratorList
:
ev
.
initialize
()
for
oi
in
G
.
ObjectInterruptionList
:
oi
.
initialize
()
# ===========================================================================
# activates all the objects
# ===========================================================================
def
activateObjects
():
for
element
in
G
.
ObjList
:
# activate(element, element.run())
for
element
in
G
.
ObjList
+
G
.
ObjectInterruptionList
:
G
.
env
.
process
(
element
.
run
())
for
ev
in
G
.
EventGeneratorList
:
# activate(ev, ev.run())
G
.
env
.
process
(
ev
.
run
())
for
oi
in
G
.
ObjectInterruptionList
:
# activate(oi, oi.run())
G
.
env
.
process
(
oi
.
run
())
# ===========================================================================
# reads the WIP of the stations
...
...
@@ -770,7 +757,6 @@ def createWIP():
# reads the interruptions of the stations
# ===========================================================================
def
createObjectInterruptions
():
G
.
ObjectInterruptionList
=
[]
G
.
ScheduledMaintenanceList
=
[]
G
.
FailureList
=
[]
G
.
ShiftSchedulerList
=
[]
...
...
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