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
99d9011d
Commit
99d9011d
authored
Sep 23, 2014
by
Ioannis Papagiannopoulos
Committed by
Jérome Perrin
Feb 04, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
further clean-up in Operator and OperatorRouterManaged
parent
70be870d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
dream/simulation/Operator.py
dream/simulation/Operator.py
+1
-1
dream/simulation/OperatorRouterManaged.py
dream/simulation/OperatorRouterManaged.py
+10
-1
No files found.
dream/simulation/Operator.py
View file @
99d9011d
...
...
@@ -130,7 +130,7 @@ class Operator(ObjectResource):
if
candidateMachines
:
# choose the one that waits the most time and give it the chance to grasp the resource
for
machine
in
candidateMachines
:
machine
.
critical
=
False
#
machine.critical=False
if
machine
.
broker
.
waitForOperator
:
machine
.
timeWaiting
=
self
.
env
.
now
-
machine
.
broker
.
timeWaitForOperatorStarted
else
:
...
...
dream/simulation/OperatorRouterManaged.py
View file @
99d9011d
...
...
@@ -108,9 +108,15 @@ class RouterManaged(Router):
# exit actions
self
.
exitActions
()
#===========================================================================
# entry actions on Router call
#===========================================================================
def
entryActions
(
self
):
pass
#===========================================================================
# routine to allocate the operators to the stations
#===========================================================================
def
allocateOperators
(
self
):
# find the pending objects
self
.
findPendingObjects
()
...
...
@@ -124,6 +130,9 @@ class RouterManaged(Router):
# entities that are already in stations have already a receiver
self
.
findCandidateReceivers
()
#===========================================================================
# un-assign the exit of the objects that are not to be signalled
#===========================================================================
def
unAssignExits
(
self
):
for
operator
in
[
x
for
x
in
self
.
candidateOperators
if
x
.
isAssignedTo
()]:
if
not
operator
.
isAssignedTo
()
in
self
.
pendingObjects
:
...
...
@@ -136,7 +145,7 @@ class RouterManaged(Router):
object
.
unAssignExit
()
# =======================================================================
# return control to the Machine.run
#
Exit actions
return control to the Machine.run
# =======================================================================
def
exitActions
(
self
):
# reset the candidateEntities of the operators
...
...
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