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
6f6671eb
Commit
6f6671eb
authored
May 07, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
main JSON script set to read the object
parent
9a4bcf81
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
2 deletions
+24
-2
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+24
-2
No files found.
dream/simulation/LineGenerationJSON.py
View file @
6f6671eb
...
@@ -248,6 +248,7 @@ def createObjectInterruptions():
...
@@ -248,6 +248,7 @@ def createObjectInterruptions():
G
.
FailureList
=
[]
G
.
FailureList
=
[]
G
.
BreakList
=
[]
G
.
BreakList
=
[]
G
.
ShiftSchedulerList
=
[]
G
.
ShiftSchedulerList
=
[]
G
.
ScheduledBreakList
=
[]
G
.
EventGeneratorList
=
[]
G
.
EventGeneratorList
=
[]
G
.
CapacityStationControllerList
=
[]
G
.
CapacityStationControllerList
=
[]
G
.
PeriodicMaintenanceList
=
[]
G
.
PeriodicMaintenanceList
=
[]
...
@@ -286,6 +287,7 @@ def createObjectInterruptions():
...
@@ -286,6 +287,7 @@ def createObjectInterruptions():
from
dream.simulation.Failure
import
Failure
from
dream.simulation.Failure
import
Failure
from
dream.simulation.PeriodicMaintenance
import
PeriodicMaintenance
from
dream.simulation.PeriodicMaintenance
import
PeriodicMaintenance
from
dream.simulation.ShiftScheduler
import
ShiftScheduler
from
dream.simulation.ShiftScheduler
import
ShiftScheduler
from
dream.simulation.ScheduledBreak
import
ScheduledBreak
from
dream.simulation.Break
import
Break
from
dream.simulation.Break
import
Break
for
(
element_id
,
element
)
in
nodes
.
iteritems
():
for
(
element_id
,
element
)
in
nodes
.
iteritems
():
element
[
'id'
]
=
element_id
element
[
'id'
]
=
element_id
...
@@ -345,9 +347,29 @@ def createObjectInterruptions():
...
@@ -345,9 +347,29 @@ def createObjectInterruptions():
rolling
=
rolling
,
lastOffShiftDuration
=
lastOffShiftDuration
)
rolling
=
rolling
,
lastOffShiftDuration
=
lastOffShiftDuration
)
G
.
ObjectInterruptionList
.
append
(
SS
)
G
.
ObjectInterruptionList
.
append
(
SS
)
G
.
ShiftSchedulerList
.
append
(
SS
)
G
.
ShiftSchedulerList
.
append
(
SS
)
scheduledBreak
=
element
.
get
(
'interruptions'
,{}).
get
(
'scheduledBreak'
,
None
)
# if there are scheduled breaks assigned initiate them
if
scheduledBreak
:
victim
=
Globals
.
findObjectById
(
element
[
'id'
])
breakPattern
=
list
(
scheduledBreak
.
get
(
'breakPattern'
,
[]))
for
index
,
record
in
enumerate
(
breakPattern
):
if
record
is
breakPattern
[
-
1
]:
break
next
=
breakPattern
[
index
+
1
]
if
record
[
1
]
==
next
[
0
]:
record
[
1
]
=
next
[
1
]
shiftPattern
.
remove
(
next
)
endUnfinished
=
bool
(
int
(
scheduledBreak
.
get
(
'endUnfinished'
,
0
)))
receiveBeforeEndThreshold
=
float
(
scheduledBreak
.
get
(
'receiveBeforeEndThreshold'
,
0
))
rolling
=
bool
(
int
(
scheduledBreak
.
get
(
'rolling'
,
0
)))
lastNoBreakDuration
=
float
(
scheduledBreak
.
get
(
'lastOffShiftDuration'
,
10
))
SB
=
ScheduledBreak
(
victim
=
victim
,
breakPattern
=
breakPattern
,
endUnfinished
=
endUnfinished
,
receiveBeforeEndThreshold
=
receiveBeforeEndThreshold
,
rolling
=
rolling
,
lastNoBreakDuration
=
lastNoBreakDuration
)
G
.
ObjectInterruptionList
.
append
(
SB
)
G
.
ShiftSchedulerList
.
append
(
SB
)
br
=
element
.
get
(
'interruptions'
,{}).
get
(
'break'
,
None
)
br
=
element
.
get
(
'interruptions'
,{}).
get
(
'break'
,
None
)
# if there are breaks assigned
# if there are random breaks assigned initiate them
# initiate them
if
br
:
if
br
:
victim
=
Globals
.
findObjectById
(
element
[
'id'
])
victim
=
Globals
.
findObjectById
(
element
[
'id'
])
endUnfinished
=
bool
(
int
(
br
.
get
(
'endUnfinished'
,
1
)))
endUnfinished
=
bool
(
int
(
br
.
get
(
'endUnfinished'
,
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