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
aebe2c89
Commit
aebe2c89
authored
Sep 23, 2014
by
Ioannis Papagiannopoulos
Committed by
Georgios Dagkakis
Nov 03, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
further clean-up in Operator and OperatorRouterManaged
parent
b81ab065
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 @
aebe2c89
...
@@ -130,7 +130,7 @@ class Operator(ObjectResource):
...
@@ -130,7 +130,7 @@ class Operator(ObjectResource):
if
candidateMachines
:
if
candidateMachines
:
# choose the one that waits the most time and give it the chance to grasp the resource
# choose the one that waits the most time and give it the chance to grasp the resource
for
machine
in
candidateMachines
:
for
machine
in
candidateMachines
:
machine
.
critical
=
False
#
machine.critical=False
if
machine
.
broker
.
waitForOperator
:
if
machine
.
broker
.
waitForOperator
:
machine
.
timeWaiting
=
self
.
env
.
now
-
machine
.
broker
.
timeWaitForOperatorStarted
machine
.
timeWaiting
=
self
.
env
.
now
-
machine
.
broker
.
timeWaitForOperatorStarted
else
:
else
:
...
...
dream/simulation/OperatorRouterManaged.py
View file @
aebe2c89
...
@@ -108,9 +108,15 @@ class RouterManaged(Router):
...
@@ -108,9 +108,15 @@ class RouterManaged(Router):
# exit actions
# exit actions
self
.
exitActions
()
self
.
exitActions
()
#===========================================================================
# entry actions on Router call
#===========================================================================
def
entryActions
(
self
):
def
entryActions
(
self
):
pass
pass
#===========================================================================
# routine to allocate the operators to the stations
#===========================================================================
def
allocateOperators
(
self
):
def
allocateOperators
(
self
):
# find the pending objects
# find the pending objects
self
.
findPendingObjects
()
self
.
findPendingObjects
()
...
@@ -124,6 +130,9 @@ class RouterManaged(Router):
...
@@ -124,6 +130,9 @@ class RouterManaged(Router):
# entities that are already in stations have already a receiver
# entities that are already in stations have already a receiver
self
.
findCandidateReceivers
()
self
.
findCandidateReceivers
()
#===========================================================================
# un-assign the exit of the objects that are not to be signalled
#===========================================================================
def
unAssignExits
(
self
):
def
unAssignExits
(
self
):
for
operator
in
[
x
for
x
in
self
.
candidateOperators
if
x
.
isAssignedTo
()]:
for
operator
in
[
x
for
x
in
self
.
candidateOperators
if
x
.
isAssignedTo
()]:
if
not
operator
.
isAssignedTo
()
in
self
.
pendingObjects
:
if
not
operator
.
isAssignedTo
()
in
self
.
pendingObjects
:
...
@@ -136,7 +145,7 @@ class RouterManaged(Router):
...
@@ -136,7 +145,7 @@ class RouterManaged(Router):
object
.
unAssignExit
()
object
.
unAssignExit
()
# =======================================================================
# =======================================================================
# return control to the Machine.run
#
Exit actions
return control to the Machine.run
# =======================================================================
# =======================================================================
def
exitActions
(
self
):
def
exitActions
(
self
):
# reset the candidateEntities of the operators
# 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