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
2a418615
Commit
2a418615
authored
Feb 25, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
operators to keep also off-shift and exit times on schedule
parent
5ac9990b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
dream/simulation/Machine.py
dream/simulation/Machine.py
+1
-0
dream/simulation/Operator.py
dream/simulation/Operator.py
+6
-2
dream/simulation/ShiftScheduler.py
dream/simulation/ShiftScheduler.py
+11
-0
No files found.
dream/simulation/Machine.py
View file @
2a418615
...
...
@@ -1148,6 +1148,7 @@ class Machine(CoreObject):
# this checks if the operator is working on the last element.
# If yes the time that he was set off-shift should be updated
operator
=
self
.
currentOperator
operator
.
schedule
[
-
1
].
append
(
self
.
env
.
now
)
if
not
self
.
currentOperator
.
onShift
:
operator
.
timeLastShiftEnded
=
self
.
env
.
now
operator
.
unAssign
()
# set the flag operatorAssignedTo to None
...
...
dream/simulation/Operator.py
View file @
2a418615
...
...
@@ -286,14 +286,18 @@ class Operator(ObjectResource):
if
self
.
ouputSchedule
:
json
[
'results'
][
'schedule'
]
=
[]
for
record
in
self
.
schedule
:
try
:
stationId
=
record
[
0
].
id
except
AttributeError
:
stationId
=
record
[
0
][
'id'
]
if
len
(
record
)
==
3
:
json
[
'results'
][
'schedule'
].
append
({
'stationId'
:
record
[
0
].
i
d
,
'stationId'
:
stationI
d
,
'entranceTime'
:
record
[
1
],
'exitTime'
:
record
[
2
]})
else
:
json
[
'results'
][
'schedule'
].
append
({
'stationId'
:
record
[
0
].
i
d
,
'stationId'
:
stationI
d
,
'entranceTime'
:
record
[
1
]})
G
.
outputJSON
[
'elementList'
].
append
(
json
)
...
...
dream/simulation/ShiftScheduler.py
View file @
2a418615
...
...
@@ -78,6 +78,10 @@ class ShiftScheduler(ObjectInterruption):
# interrupt the victim only if it was not previously interrupted
self
.
interruptVictim
()
# interrupt the victim
else
:
if
self
.
victim
.
schedule
:
if
len
(
self
.
victim
.
schedule
[
-
1
])
==
2
:
self
.
victim
.
schedule
[
-
1
].
append
(
self
.
env
.
now
)
self
.
victim
.
schedule
.
append
([{
'id'
:
'off-shift'
},
self
.
env
.
now
])
self
.
requestAllocation
()
self
.
victim
.
timeLastShiftEnded
=
self
.
env
.
now
...
...
@@ -98,6 +102,9 @@ class ShiftScheduler(ObjectInterruption):
if
issubclass
(
self
.
victim
.
__class__
,
CoreObject
):
self
.
reactivateVictim
()
# re-activate the victim in case it was interrupted
else
:
if
self
.
victim
.
schedule
:
if
len
(
self
.
victim
.
schedule
[
-
1
])
==
2
:
self
.
victim
.
schedule
[
-
1
].
append
(
self
.
env
.
now
)
self
.
requestAllocation
()
# if the victim has interruptions that measure only the on-shift time, they have to be notified
...
...
@@ -149,6 +156,10 @@ class ShiftScheduler(ObjectInterruption):
if
station
:
if
not
self
.
endUnfinished
and
station
.
expectedSignals
[
'processOperatorUnavailable'
]:
self
.
sendSignal
(
receiver
=
station
,
signal
=
station
.
processOperatorUnavailable
)
if
self
.
victim
.
schedule
:
if
len
(
self
.
victim
.
schedule
[
-
1
])
==
2
:
self
.
victim
.
schedule
[
-
1
].
append
(
self
.
env
.
now
)
self
.
victim
.
schedule
.
append
([{
'id'
:
'off-shift'
},
self
.
env
.
now
])
self
.
requestAllocation
()
# if the victim has interruptions that measure only the on-shift time, they have to be notified
...
...
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