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
d7b79ac3
Commit
d7b79ac3
authored
Mar 06, 2015
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
currentStep is used by broker to update operators shedule (task_id)
parent
199044fd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
20 deletions
+12
-20
dream/simulation/OperatedPoolBroker.py
dream/simulation/OperatedPoolBroker.py
+12
-20
No files found.
dream/simulation/OperatedPoolBroker.py
View file @
d7b79ac3
...
@@ -162,28 +162,20 @@ class Broker(ObjectInterruption):
...
@@ -162,28 +162,20 @@ class Broker(ObjectInterruption):
"entranceTime"
:
self
.
env
.
now
})
"entranceTime"
:
self
.
env
.
now
})
# if the victim holds an entity (load is already performed)
# if the victim holds an entity (load is already performed)
if
self
.
victim
.
getActiveObjectQueue
():
if
self
.
victim
.
getActiveObjectQueue
():
activeEntity
=
self
.
victim
.
getActiveObjectQueue
()[
0
]
# print self.env.now, "the victim", self.victim.id, "holds an entity and requests an operator"
# update the entity value of the schedule current step dict
# update the entity value of the schedule current step dict
if
self
.
victim
.
currentOperator
.
schedule
[
-
1
].
get
(
"entity"
,
None
)
==
None
:
if
self
.
victim
.
currentOperator
.
schedule
[
-
1
].
get
(
"entity"
,
None
)
==
None
:
self
.
victim
.
currentOperator
.
schedule
[
-
1
][
"entity"
]
=
self
.
victim
.
getActiveObjectQueue
()[
0
]
self
.
victim
.
currentOperator
.
schedule
[
-
1
][
"entity"
]
=
activeEntity
# update the task_id of the current schedule step dict
# if the entity held by the station has a currentStep
currentStep
=
None
# if the task_id of the last step is not already updated
if
self
.
victim
.
currentOperator
.
schedule
[
-
1
].
get
(
"task_id"
,
None
)
==
None
:
# find the currentStep within the entity's route
try
:
try
:
if
self
.
victim
.
getActiveObjectQueue
()[
0
].
remainingRoute
:
if
activeEntity
.
currentStep
:
nextStep
=
self
.
victim
.
getActiveObjectQueue
()[
0
].
remainingRoute
[
0
]
if
activeEntity
.
currentStep
.
get
(
"task_id"
,
None
):
# if the steps have a task_id key
# print " ", self.env.now
if
nextStep
.
get
(
"task_id"
,
None
):
# print " broker is updating the task_id of the operator", self.victim.currentOperator.id, activeEntity.currentStep["task_id"]
for
step
in
self
.
victim
.
getActiveObjectQueue
()[
0
].
route
:
self
.
victim
.
currentOperator
.
schedule
[
-
1
][
"task_id"
]
=
activeEntity
.
currentStep
[
"task_id"
]
if
step
[
"task_id"
]
==
nextStep
[
"task_id"
]
and
\
except
AttributeError
:
step
.
get
(
"technology"
,
None
)
!=
None
:
currentStep
=
step
break
except
:
pass
pass
if
currentStep
:
self
.
victim
.
currentOperator
.
schedule
[
-
1
][
"task_id"
]
=
currentStep
[
"task_id"
]
# wait till the processing is over
# wait till the processing is over
self
.
expectedSignals
[
'isCalled'
]
=
1
self
.
expectedSignals
[
'isCalled'
]
=
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