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
8146ec5a
Commit
8146ec5a
authored
Mar 24, 2014
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TODOs added
parent
d86425de
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
dream/simulation/OperatorPreemptive.py
dream/simulation/OperatorPreemptive.py
+1
-0
dream/simulation/OperatorRouter.py
dream/simulation/OperatorRouter.py
+6
-4
No files found.
dream/simulation/OperatorPreemptive.py
View file @
8146ec5a
...
...
@@ -104,6 +104,7 @@ class OperatorPreemptive(Operator):
# =======================================================================
# override the default method so that Entities
# that are critical got served first
# TODO: NOT USED!
# =======================================================================
def
sortEntities
(
self
):
Operator
.
sortEntities
(
self
)
#do the default sorting first
...
...
dream/simulation/OperatorRouter.py
View file @
8146ec5a
...
...
@@ -49,8 +49,8 @@ class Router(ObjectInterruption):
# list that holds all the objects that can receive
self
.
pendingObjects
=
[]
self
.
calledOperators
=
[]
# TODO: consider if there must be an argument set for the schedulingRules of the Router
self
.
schedulingRule
=
''
#
# TODO: consider if there must be an argument set for the schedulingRules of the Router
#
self.schedulingRule=''
# list of the operators that may handle a machine at the current simulation time
self
.
candidateOperators
=
[]
# list of criteria
...
...
@@ -399,12 +399,14 @@ class Router(ObjectInterruption):
# if there operators that have only one option then sort the candidateOperators according to the first one of these
# TODO: find out what happens if there are many operators with one option
# TODO: incorporate that to sortOperators() method
# TODO: incorporate that to
# self.sortOperators()
# sort the operators according to their waiting time
self
.
candidateOperators
.
sort
(
key
=
lambda
x
:
x
.
totalWorkingTime
)
# sort according to the number of options
if
operatorsWithOneOption
:
self
.
candidateOperators
.
sort
(
key
=
lambda
x
:
x
in
operatorsWithOneOption
,
reverse
=
True
)
# sort according to the number of options
self
.
candidateOperators
.
sort
(
key
=
lambda
x
:
x
in
operatorsWithOneOption
,
reverse
=
True
)
#=======================================================================
# Find candidate entities and their receivers
...
...
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