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
76363b51
Commit
76363b51
authored
Jul 23, 2014
by
Ioannis Papagiannopoulos
Committed by
Georgios Dagkakis
Sep 01, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
in case of single-machine-dedicated-skilled operators, the broker does not invoke the Router.
parent
bb51d0ad
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
46 deletions
+46
-46
dream/simulation/OperatedPoolBroker.py
dream/simulation/OperatedPoolBroker.py
+46
-46
No files found.
dream/simulation/OperatedPoolBroker.py
View file @
76363b51
...
@@ -80,11 +80,12 @@ class Broker(ObjectInterruption):
...
@@ -80,11 +80,12 @@ class Broker(ObjectInterruption):
and
any
(
type
==
'Load'
or
type
==
'Setup'
or
type
==
'Processing'
\
and
any
(
type
==
'Load'
or
type
==
'Setup'
or
type
==
'Processing'
\
for
type
in
self
.
victim
.
multOperationTypeList
):
for
type
in
self
.
victim
.
multOperationTypeList
):
# update the time that the station is waiting for the operator
# update the time that the station is waiting for the operator
self
.
timeWaitForOperatorStarted
=
self
.
env
.
now
#()
self
.
timeWaitForOperatorStarted
=
self
.
env
.
now
#===============================================================
#===============================================================
# if the victim already holds an entity that means that the machine's operation type
# if the victim already holds an entity that means that the machine's operation type
# is no Load or setup, in that case the router is already invoked and the machine is already assigned an operator
# is no Load or setup, in that case the router is already invoked and the machine is already assigned an operator
from
Globals
import
G
from
Globals
import
G
if
not
self
.
victim
.
checkForSkilledOperators
():
if
not
self
.
victimQueueIsEmpty
():
if
not
self
.
victimQueueIsEmpty
():
# add the currentEntity to the pendingEntities
# add the currentEntity to the pendingEntities
if
not
self
.
victim
.
currentEntity
in
G
.
pendingEntities
:
if
not
self
.
victim
.
currentEntity
in
G
.
pendingEntities
:
...
@@ -132,8 +133,8 @@ class Broker(ObjectInterruption):
...
@@ -132,8 +133,8 @@ class Broker(ObjectInterruption):
assert
self
.
isCalled
.
value
==
self
.
env
.
now
,
'the broker should be granted control instantly'
assert
self
.
isCalled
.
value
==
self
.
env
.
now
,
'the broker should be granted control instantly'
self
.
isCalled
=
self
.
env
.
event
()
self
.
isCalled
=
self
.
env
.
event
()
# The operator is released
# The operator is released
(the router is not called in the case of skilled ops that work constantly on the same machine)
if
not
self
.
victim
.
checkForSkilledOperators
():
if
not
self
.
victim
.
isOperated
():
if
not
self
.
victim
.
isOperated
():
self
.
victim
.
currentOperator
.
totalWorkingTime
+=
self
.
env
.
now
-
self
.
victim
.
currentOperator
.
timeLastOperationStarted
self
.
victim
.
currentOperator
.
totalWorkingTime
+=
self
.
env
.
now
-
self
.
victim
.
currentOperator
.
timeLastOperationStarted
# signal the other brokers waiting for the same operators that they are now free
# signal the other brokers waiting for the same operators that they are now free
...
@@ -144,7 +145,6 @@ class Broker(ObjectInterruption):
...
@@ -144,7 +145,6 @@ class Broker(ObjectInterruption):
if
not
self
.
victim
.
router
.
invoked
:
if
not
self
.
victim
.
router
.
invoked
:
self
.
victim
.
printTrace
(
self
.
victim
.
id
,
signal
=
'router (broker)'
)
self
.
victim
.
printTrace
(
self
.
victim
.
id
,
signal
=
'router (broker)'
)
self
.
victim
.
router
.
invoked
=
True
self
.
victim
.
router
.
invoked
=
True
# self.victim.router.isCalled.signal(now())
self
.
victim
.
router
.
isCalled
.
succeed
(
self
.
env
.
now
)
self
.
victim
.
router
.
isCalled
.
succeed
(
self
.
env
.
now
)
# TODO: signalling the router will give the chance to it to take the control, but when will it eventually receive it.
# TODO: signalling the router will give the chance to it to take the control, but when will it eventually receive it.
# after signalling the broker will signal it's victim that it has finished it's processes
# after signalling the broker will signal it's victim that it has finished it's processes
...
...
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