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
6acc02ef
Commit
6acc02ef
authored
Mar 06, 2015
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor cleanup; comments added
parent
d7b79ac3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
18 deletions
+13
-18
dream/simulation/OperatedPoolBroker.py
dream/simulation/OperatedPoolBroker.py
+0
-3
dream/simulation/OperatorRouter.py
dream/simulation/OperatorRouter.py
+13
-15
No files found.
dream/simulation/OperatedPoolBroker.py
View file @
6acc02ef
...
...
@@ -163,7 +163,6 @@ class Broker(ObjectInterruption):
# if the victim holds an entity (load is already performed)
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
if
self
.
victim
.
currentOperator
.
schedule
[
-
1
].
get
(
"entity"
,
None
)
==
None
:
self
.
victim
.
currentOperator
.
schedule
[
-
1
][
"entity"
]
=
activeEntity
...
...
@@ -171,8 +170,6 @@ class Broker(ObjectInterruption):
try
:
if
activeEntity
.
currentStep
:
if
activeEntity
.
currentStep
.
get
(
"task_id"
,
None
):
# print " ", self.env.now
# print " broker is updating the task_id of the operator", self.victim.currentOperator.id, activeEntity.currentStep["task_id"]
self
.
victim
.
currentOperator
.
schedule
[
-
1
][
"task_id"
]
=
activeEntity
.
currentStep
[
"task_id"
]
except
AttributeError
:
pass
...
...
dream/simulation/OperatorRouter.py
View file @
6acc02ef
...
...
@@ -417,6 +417,14 @@ class Router(ObjectInterruption):
operator
.
candidateEntity
=
None
# scan the entities in the candidateEntities list of the operator
for
index
,
entity
in
enumerate
(
operator
.
candidateEntities
):
# if entity.currentStation in self.pendingMachines:
# try:
# requestedTechnology = entity.currentStep.get("technology", None)
# except AttributeError:
# requestedTechnology = None
# else:
# requestedTechnology = entity.remainingRoute[0].get("technology", None)
# find the entity's the last started task_id
try
:
last_task_id
=
entity
.
schedule
[
-
1
].
get
(
"task_id"
,
None
)
...
...
@@ -442,6 +450,11 @@ class Router(ObjectInterruption):
if
requestedTechnology
:
# if the requested technology is in the operators skillDict
# XXX needs refining (an operator may have INJM in Process but the candidate entity may need setup
# if entity.currentStation in self.pendingMachines:
# pass
# else:
# pass
if
requestedTechnology
in
operator
.
skillDict
[
"process"
].
get
(
"technologyList"
,
[])
or
\
requestedTechnology
in
operator
.
skillDict
[
"setup"
].
get
(
"technologyList"
,
[]):
operator
.
candidateEntity
=
operator
.
candidateEntities
[
index
]
...
...
@@ -453,7 +466,6 @@ class Router(ObjectInterruption):
operator
.
candidateEntity
=
operator
.
candidateEntities
[
index
]
break
# if there is a candidateEntity chosen
if
operator
.
candidateEntity
:
# if the entities currentStation is machine
if
operator
.
candidateEntity
.
currentStation
in
self
.
pendingMachines
:
...
...
@@ -465,17 +477,3 @@ class Router(ObjectInterruption):
break
occupiedStations
.
append
(
operator
.
candidateStation
)
occupiedEntities
.
append
(
operator
.
candidateEntity
)
# operator.candidateEntity = operator.candidateEntities[0]
# print operator.id, self.env.now, [ent.id for ent in operator.candidateEntities]
# print self.env.now, operator.id, operator.candidateEntity.id
# # if the entities currentStation is machine
# if operator.candidateEntity.currentStation in self.pendingMachines:
# operator.candidateStation=operator.candidateEntity.currentStation
# elif operator.candidateEntity.currentStation in self.pendingQueues:
# for station in operator.candidateStations:
# if station in operator.candidateEntity.currentStation.next:
# operator.candidateStation=station
# break
# occupiedStations.append(operator.candidateStation)
# occupiedEntities.append(operator.candidateEntity)
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