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
dd8ebacc
Commit
dd8ebacc
authored
May 14, 2014
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Router minor correction
parent
7cd4e2f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
19 deletions
+20
-19
dream/simulation/OperatorRouter.py
dream/simulation/OperatorRouter.py
+20
-19
No files found.
dream/simulation/OperatorRouter.py
View file @
dd8ebacc
...
...
@@ -105,7 +105,7 @@ class Router(ObjectInterruption):
# wait until the router is called
yield
waitevent
,
self
,
self
.
isCalled
# print '=-'*15
# print 'router received event'
# print
now(),
'router received event'
# wait till there are no more events, the machines must be blocked
while
1
:
# print Simulation.allEventNotices(sim)
...
...
@@ -191,18 +191,19 @@ class Router(ObjectInterruption):
self
.
toBeSignalled
.
append
(
operator
.
candidateStation
)
#------------------------------------------------------------------------------
else
:
# and if the priorityObject is indeed pending
if
(
operator
.
candidateEntity
.
currentStation
in
self
.
pendingObjects
)
\
and
(
not
operator
in
self
.
conflictingOperators
)
\
and
operator
.
candidateEntity
.
candidateReceiver
:
# assign an operator to the priorityObject
#=======================================================
# # testing
# print 'router will assign', operator.id, 'to', operator.candidateEntity.candidateReceiver.id
#=======================================================
operator
.
assignTo
(
operator
.
candidateEntity
.
candidateReceiver
)
if
not
operator
.
candidateEntity
.
currentStation
in
self
.
toBeSignalled
:
self
.
toBeSignalled
.
append
(
operator
.
candidateEntity
.
currentStation
)
if
operator
.
candidateEntity
:
# and if the priorityObject is indeed pending
if
(
operator
.
candidateEntity
.
currentStation
in
self
.
pendingObjects
)
\
and
(
not
operator
in
self
.
conflictingOperators
)
\
and
operator
.
candidateEntity
.
candidateReceiver
:
# assign an operator to the priorityObject
#=======================================================
# # testing
# print 'router will assign', operator.id, 'to', operator.candidateEntity.candidateReceiver.id
#=======================================================
operator
.
assignTo
(
operator
.
candidateEntity
.
candidateReceiver
)
if
not
operator
.
candidateEntity
.
currentStation
in
self
.
toBeSignalled
:
self
.
toBeSignalled
.
append
(
operator
.
candidateEntity
.
currentStation
)
#===================================================================
# # testing
# print 'router found objects to be signalled'
...
...
@@ -582,9 +583,9 @@ class Router(ObjectInterruption):
return
candidateStation
# TODO: sorting again after choosing candidateEntity
if
self
.
sorting
:
self
.
sortOperators
()
#
# TODO: sorting again after choosing candidateEntity
#
if self.sorting:
#
self.sortOperators()
# for the candidateOperators that do have candidateEntities pick a candidateEntity
for
operator
in
[
x
for
x
in
self
.
candidateOperators
if
x
.
candidateStations
]:
...
...
@@ -682,9 +683,9 @@ class Router(ObjectInterruption):
return
availableReceiver
# TODO: sorting again after choosing candidateEntity
if
self
.
sorting
:
self
.
sortOperators
()
#
# TODO: sorting again after choosing candidateEntity
#
if self.sorting:
#
self.sortOperators()
# for the candidateOperators that do have candidateEntities pick a candidateEntity
for
operator
in
[
x
for
x
in
self
.
candidateOperators
if
x
.
candidateEntities
]:
...
...
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