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
2259bd6a
Commit
2259bd6a
authored
Oct 22, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BatchReassemblyBlocking to calculate blocking correctly
parent
15c8c6ed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
dream/simulation/BatchReassemblyBlocking.py
dream/simulation/BatchReassemblyBlocking.py
+33
-0
No files found.
dream/simulation/BatchReassemblyBlocking.py
View file @
2259bd6a
...
@@ -49,3 +49,36 @@ class BatchReassemblyBlocking(BatchReassembly):
...
@@ -49,3 +49,36 @@ class BatchReassemblyBlocking(BatchReassembly):
station
=
previous
station
=
previous
return
activeEntity
return
activeEntity
# =======================================================================
# adds the blockage time to totalBlockageTime
# each time an Entity is removed
# =======================================================================
def
addBlockage
(
self
):
# find the previous station
station
=
self
.
previous
[
0
]
from
Globals
import
G
from
ShiftScheduler
import
ShiftScheduler
shift
=
[]
# find the shiftPattern of the previous station
for
oi
in
G
.
ObjectInterruptionList
:
if
issubclass
(
oi
.
__class__
,
ShiftScheduler
):
if
oi
.
victim
is
station
:
shift
=
oi
.
shiftPattern
break
if
self
.
timeLastBlockageStarted
:
# calculate how much time the previous station was offShift
offShift
=
0
for
i
,
record
in
enumerate
(
shift
):
start
=
record
[
0
]
end
=
record
[
1
]
if
start
>
self
.
env
.
now
:
break
if
end
<
self
.
timeLastBlockageStarted
:
continue
# if the there is offShift time in the blockage
if
end
<
self
.
env
.
now
:
try
:
offShift
+=
shift
[
i
+
1
][
0
]
-
end
except
IndexError
:
pass
self
.
totalBlockageTime
+=
self
.
env
.
now
-
self
.
timeLastBlockageStarted
-
offShift
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