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
dba3f3da
Commit
dba3f3da
authored
May 14, 2014
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new method added to Machine, searching for candidate operators. Clean-up in operator
parent
6d3b4df6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
23 deletions
+27
-23
dream/simulation/Machine.py
dream/simulation/Machine.py
+12
-0
dream/simulation/OperatorRouter.py
dream/simulation/OperatorRouter.py
+15
-23
No files found.
dream/simulation/Machine.py
View file @
dba3f3da
...
@@ -778,6 +778,18 @@ class Machine(CoreObject):
...
@@ -778,6 +778,18 @@ class Machine(CoreObject):
self
.
inPositionToGet
=
True
self
.
inPositionToGet
=
True
if
not
self
.
router
.
isCalled
():
if
not
self
.
router
.
isCalled
():
self
.
router
.
invoke
()
self
.
router
.
invoke
()
#===========================================================================
# find candidate operators within the free operators
#===========================================================================
def
findCandidateOperator
(
self
):
activeObject
=
self
.
getActiveObject
()
# TODO: this way no sorting is performed
# find an available operator
candidateOperator
=
activeObject
.
operatorPool
.
findAvailableOperator
()
# append the station into its candidateStations
candidateOperator
.
candidateStations
.
append
(
activeObject
)
return
candidateOperator
# =======================================================================
# =======================================================================
# prepare the machine to be operated
# prepare the machine to be operated
...
...
dream/simulation/OperatorRouter.py
View file @
dba3f3da
...
@@ -357,31 +357,23 @@ class Router(ObjectInterruption):
...
@@ -357,31 +357,23 @@ class Router(ObjectInterruption):
# if we are not dealing with managed entities
# if we are not dealing with managed entities
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
if
not
self
.
managed
:
if
not
self
.
managed
:
# if there are pendingEntities
# for each pendingMachine
if
self
.
pendingObjects
:
for
object
in
self
.
pendingMachines
:
# for each pendingObject
# find candidateOperators for each object operator
# for each pendingMachine
candidateOperator
=
object
.
findCandidateOperator
()
for
object
in
self
.
pendingMachines
:
# TODO: this way no sorting is performed
# if object in self.pendingMachines:
if
not
candidateOperator
in
self
.
candidateOperators
:
# find an available operator
self
.
candidateOperators
.
append
(
candidateOperator
)
candidateOperator
=
object
.
operatorPool
.
findAvailableOperator
()
# for each pendingQueue
# TODO: this way no sorting is performed
for
object
in
self
.
pendingQueues
:
# find available operator for then machines that follow
for
nextobject
in
object
.
findReceivers
():
candidateOperator
=
nextobject
.
findCandidateOperator
()
if
not
candidateOperator
in
self
.
candidateOperators
:
if
not
candidateOperator
in
self
.
candidateOperators
:
self
.
candidateOperators
.
append
(
candidateOperator
)
self
.
candidateOperators
.
append
(
candidateOperator
)
# for each operator append the station into its candidateStations
# update the schedulingRule/multipleCriterionList of the Router
candidateOperator
.
candidateStations
.
append
(
object
)
if
self
.
sorting
:
# for each pendingQueue
self
.
updateSchedulingRule
()
for
object
in
self
.
pendingQueues
:
# elif object in self.pendingQueues:
# find available operator for then machines that follow
for
nextobject
in
object
.
findReceivers
():
candidateOperator
=
nextobject
.
operatorPool
.
findAvailableOperator
()
if
not
candidateOperator
in
self
.
candidateOperators
:
self
.
candidateOperators
.
append
(
candidateOperator
)
candidateOperator
.
candidateStations
.
append
(
nextobject
)
# update the schedulingRule/multipleCriterionList of the Router
if
self
.
sorting
:
self
.
updateSchedulingRule
()
# in case the router deals with managed entities
# in case the router deals with managed entities
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
else
:
else
:
...
...
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