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
6bbaeaf2
Commit
6bbaeaf2
authored
Jul 24, 2014
by
Ioannis Papagiannopoulos
Committed by
Georgios Dagkakis
Sep 01, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
naming conventions for skilledOperator flag and checkForSkilledOperators changed
parent
be502b94
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
dream/simulation/CoreObject.py
dream/simulation/CoreObject.py
+3
-3
dream/simulation/Machine.py
dream/simulation/Machine.py
+7
-7
dream/simulation/OperatedPoolBroker.py
dream/simulation/OperatedPoolBroker.py
+2
-2
No files found.
dream/simulation/CoreObject.py
View file @
6bbaeaf2
...
...
@@ -370,7 +370,7 @@ class CoreObject(object):
# check if the any of the operators are skilled (having a list of skills regarding the machines)
#===========================================================================
@
staticmethod
def
checkFor
Skill
edOperators
():
def
checkFor
Dedicat
edOperators
():
from
Globals
import
G
# XXX this can also be global
# flag used to inform if the operators assigned to the station are skilled (skillsList)
...
...
@@ -412,7 +412,7 @@ class CoreObject(object):
self
.
preemptReceiver
()
# TODO if the station is operated, and the operators have skills defined then the SkilledOperatorRouter should be signalled
# XXX: there may be a case where one machine is not assigned an operator, in that case we do not want to invoke the allocation routine
if
self
.
checkFor
Skill
edOperators
():
if
self
.
checkFor
Dedicat
edOperators
():
allocationNeeded
=
False
for
nextObj
in
self
.
next
:
if
nextObj
.
operatorPool
!=
'None'
:
...
...
@@ -460,7 +460,7 @@ class CoreObject(object):
def
signalRouter
(
receiver
=
None
):
# if an operator is not assigned to the receiver then do not signal the receiver but the Router
try
:
# XXX in the case of
skilledOperators
assignedOperators must be always True in order to avoid invoking the Router
# XXX in the case of
dedicatedOperator
assignedOperators must be always True in order to avoid invoking the Router
if
not
receiver
.
assignedOperator
or
\
(
receiver
.
isPreemptive
and
len
(
receiver
.
Res
.
users
)
>
0
):
if
receiver
.
isLoadRequested
():
...
...
dream/simulation/Machine.py
View file @
6bbaeaf2
...
...
@@ -90,7 +90,7 @@ class Machine(CoreObject):
self
.
MTTR
=
MTTR
self
.
availability
=
availability
# check whether the operators are provided with a skills set
self
.
skilledOperators
=
self
.
checkForSkill
edOperators
()
self
.
dedicatedOperator
=
self
.
checkForDedicat
edOperators
()
# create an operatorPool if needed
self
.
createOperatorPool
(
operatorPool
)
# holds the Operator currently processing the Machine
...
...
@@ -211,7 +211,7 @@ class Machine(CoreObject):
# otherwise
else
:
# if there are operators with skillList
if
self
.
skilledOperators
:
if
self
.
dedicatedOperator
:
id
=
self
.
id
+
'_OP'
name
=
self
.
objName
+
'_operatorPool'
self
.
operatorPool
=
OperatorPool
(
id
,
name
,
operatorsList
=
[])
...
...
@@ -241,8 +241,8 @@ class Machine(CoreObject):
from
Globals
import
G
# if there is no router
if
not
G
.
Router
:
# TODO if the
skilledOperators
flag is raised then create a SkilledRouter (temp)
if
self
.
skilledOperators
:
# TODO if the
dedicatedOperator
flag is raised then create a SkilledRouter (temp)
if
self
.
dedicatedOperator
:
self
.
router
=
SkilledRouter
()
else
:
self
.
router
=
Router
()
...
...
@@ -257,8 +257,8 @@ class Machine(CoreObject):
# initialise the operator pool if any
if
(
self
.
operatorPool
!=
"None"
):
self
.
operatorPool
.
initialize
()
# if the flag
skilledOperators
is true then reset/empty the operators list of the pool
if
self
.
skilledOperators
:
# if the flag
dedicatedOperator
is true then reset/empty the operators list of the pool
if
self
.
dedicatedOperator
:
self
.
operatorPool
.
operators
=
[]
# otherwise update the coreObjectIds/coreObjects list of the operators
else
:
...
...
@@ -876,7 +876,7 @@ class Machine(CoreObject):
self
.
outputTrace
(
self
.
currentOperator
.
objName
,
"released from "
+
self
.
objName
)
# set the flag operatorAssignedTo to None
# XXX in case of skilled operators which stay at the same station should that change
if
not
self
.
checkFor
Skill
edOperators
():
if
not
self
.
checkFor
Dedicat
edOperators
():
self
.
currentOperator
.
unAssign
()
self
.
broker
.
invoke
()
self
.
toBeOperated
=
False
...
...
dream/simulation/OperatedPoolBroker.py
View file @
6bbaeaf2
...
...
@@ -85,7 +85,7 @@ class Broker(ObjectInterruption):
# if the victim already holds an entity that means that the machine's operation type
# is no Load or setup, in that case the router is already invoked and the machine is already assigned an operator
from
Globals
import
G
if
not
self
.
victim
.
checkFor
Skill
edOperators
():
if
not
self
.
victim
.
checkFor
Dedicat
edOperators
():
if
not
self
.
victimQueueIsEmpty
():
# add the currentEntity to the pendingEntities
if
not
self
.
victim
.
currentEntity
in
G
.
pendingEntities
:
...
...
@@ -134,7 +134,7 @@ class Broker(ObjectInterruption):
self
.
isCalled
=
self
.
env
.
event
()
# The operator is released (the router is not called in the case of skilled ops that work constantly on the same machine)
if
not
self
.
victim
.
checkFor
Skill
edOperators
():
if
not
self
.
victim
.
checkFor
Dedicat
edOperators
():
if
not
self
.
victim
.
isOperated
():
self
.
victim
.
currentOperator
.
totalWorkingTime
+=
self
.
env
.
now
-
self
.
victim
.
currentOperator
.
timeLastOperationStarted
# signal the other brokers waiting for the same operators that they are now free
...
...
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