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
987e5ccd
Commit
987e5ccd
authored
Mar 03, 2014
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inline comments - OperatorRouter
parent
2d5a2f91
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
dream/simulation/OperatorRouter.py
dream/simulation/OperatorRouter.py
+13
-0
No files found.
dream/simulation/OperatorRouter.py
View file @
987e5ccd
...
...
@@ -89,8 +89,12 @@ class Router(ObjectInterruption):
# for all the called operators find those available
# sort the objects for each one of them
# and assign the operator to those with the highest priority
# for all the operators that are requested
for
operator
in
self
.
calledOperators
:
priorityObject
=
None
# check if they are available
if
operator
.
checkIfResourceIsAvailable
():
#===========================================================
# # TESTING
...
...
@@ -98,6 +102,8 @@ class Router(ObjectInterruption):
# for caller in operator.activeCallersList:
# print ' ', caller.id
#===========================================================
# sort the activeCallersList of the operator
operator
.
sortEntities
()
#===========================================================
# # TESTING
...
...
@@ -105,17 +111,24 @@ class Router(ObjectInterruption):
# for caller in operator.activeCallersList:
# print ' ', caller.id
#===========================================================
# find the activeCaller that has priority
priorityObject
=
next
(
x
for
x
in
operator
.
activeCallersList
if
x
in
self
.
pendingObjects
)
#===========================================================
# # TESTING
# print ' the PRIORITY object is', priorityObject.id
#===========================================================
# and if the priorityObject is indeed pending
if
priorityObject
in
self
.
pendingObjects
:
# assign an operator to it
operator
.
operatorAssignedTo
=
priorityObject
#=======================================================
# # TESTING
# print now(), operator.objName, 'got assigned to', priorityObject.id
#=======================================================
# and let it proceed withGetEntity
priorityObject
.
canProceedWithGetEntity
=
True
priorityObject
.
inPositionToGet
=
False
# if an object cannot proceed with getEntity, unAssign the exit of its giver
...
...
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