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
4f239696
Commit
4f239696
authored
Jul 23, 2014
by
Ioannis Papagiannopoulos
Committed by
Georgios Dagkakis
Sep 01, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
createOpeatorPool corrected + minor updates
parent
e088ab7e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
20 deletions
+12
-20
dream/simulation/Machine.py
dream/simulation/Machine.py
+12
-20
No files found.
dream/simulation/Machine.py
View file @
4f239696
...
@@ -89,6 +89,8 @@ class Machine(CoreObject):
...
@@ -89,6 +89,8 @@ class Machine(CoreObject):
self
.
MTTF
=
MTTF
self
.
MTTF
=
MTTF
self
.
MTTR
=
MTTR
self
.
MTTR
=
MTTR
self
.
availability
=
availability
self
.
availability
=
availability
# check whether the operators are provided with a skills set
self
.
skilledOperators
=
self
.
checkForSkilledOpertors
()
# create an operatorPool if needed
# create an operatorPool if needed
self
.
createOperatorPool
(
operatorPool
)
self
.
createOperatorPool
(
operatorPool
)
# holds the Operator currently processing the Machine
# holds the Operator currently processing the Machine
...
@@ -184,10 +186,6 @@ class Machine(CoreObject):
...
@@ -184,10 +186,6 @@ class Machine(CoreObject):
self
.
preemptQueue
=
self
.
env
.
event
()
self
.
preemptQueue
=
self
.
env
.
event
()
# signal used for informing objectInterruption objects that the current entity processed has finished processnig
# signal used for informing objectInterruption objects that the current entity processed has finished processnig
self
.
endedLastProcessing
=
self
.
env
.
event
()
self
.
endedLastProcessing
=
self
.
env
.
event
()
# flag used to inform if the operators assigned to the station are skilled (skillsList)
self
.
skilledOperators
=
False
#===========================================================================
#===========================================================================
# create an operatorPool if needed
# create an operatorPool if needed
...
@@ -199,8 +197,6 @@ class Machine(CoreObject):
...
@@ -199,8 +197,6 @@ class Machine(CoreObject):
the list of operators provided
the list of operators provided
if the list is empty create operator pool with empty list
if the list is empty create operator pool with empty list
'''
'''
# flag used to inform if the operators assigned to the station are skilled (skillsList)
self
.
skilledOperators
=
False
from
Globals
import
G
from
Globals
import
G
# XXX operatorPool is not None ?
# XXX operatorPool is not None ?
# if a list of operators is provided as argument
# if a list of operators is provided as argument
...
@@ -214,18 +210,14 @@ class Machine(CoreObject):
...
@@ -214,18 +210,14 @@ class Machine(CoreObject):
self
.
operatorPool
=
operatorPool
self
.
operatorPool
=
operatorPool
# otherwise
# otherwise
else
:
else
:
# find out whether the operators are provided a list of skills
# if there are operators with skillList
for
operator
in
G
.
OperatorsList
:
if
self
.
skilledOperators
:
# in that case create an empty operatorPool
if
operator
.
skillsList
:
id
=
self
.
id
+
'_OP'
id
=
self
.
id
+
'_OP'
name
=
self
.
objName
+
'_operatorPool'
name
=
self
.
objName
+
'_operatorPool'
self
.
operatorPool
=
OperatorPool
(
id
,
name
,
operatorsList
=
[])
self
.
operatorPool
=
OperatorPool
(
id
,
name
,
operatorsList
=
[])
G
.
OperatorPoolsList
.
append
(
self
.
operatorPool
)
G
.
OperatorPoolsList
.
append
(
self
.
operatorPool
)
# and update the flag skilledOperators so whenever the OperatorPool is re-initialised to reset the operators list of the Pool
# otherwise create no operatorPool
self
.
skilledOperators
=
True
else
:
break
if
not
self
.
skilledOperators
:
self
.
operatorPool
=
'None'
self
.
operatorPool
=
'None'
# update the operatorPool coreObjects list
# update the operatorPool coreObjects list
if
self
.
operatorPool
!=
'None'
:
if
self
.
operatorPool
!=
'None'
:
...
@@ -624,16 +616,15 @@ class Machine(CoreObject):
...
@@ -624,16 +616,15 @@ class Machine(CoreObject):
# in case Machine just performed the last work before the scheduled maintenance signal the corresponding object
# in case Machine just performed the last work before the scheduled maintenance signal the corresponding object
if
self
.
isWorkingOnTheLast
:
if
self
.
isWorkingOnTheLast
:
# for the scheduled Object interruptions
# for the scheduled Object interruptions
# XXX add the SkilledOperatorRouter to this list and perform the signalling only once
for
interruption
in
(
G
.
ShiftSchedulerList
+
G
.
ScheduledMaintenanceList
):
for
interruption
in
(
G
.
ShiftSchedulerList
+
G
.
ScheduledMaintenanceList
):
# if the objectInterruption is waiting for a a signal
# if the objectInterruption is waiting for a a signal
if
interruption
.
victim
==
self
and
interruption
.
waitingSignal
:
if
interruption
.
victim
==
self
and
interruption
.
waitingSignal
:
# signal it and reset the flags
# signal it and reset the flags
# interruption.victimEndedLastProcessing.succeed(self.env.now)
self
.
endedLastProcessing
.
succeed
(
self
.
env
.
now
)
self
.
endedLastProcessing
.
succeed
(
self
.
env
.
now
)
interruption
.
waitinSignal
=
False
interruption
.
waitinSignal
=
False
self
.
isWorkingOnTheLast
=
False
self
.
isWorkingOnTheLast
=
False
# =======================================================================
# =======================================================================
# actions to be carried out when the processing of an Entity ends
# actions to be carried out when the processing of an Entity ends
# =======================================================================
# =======================================================================
...
@@ -884,6 +875,7 @@ class Machine(CoreObject):
...
@@ -884,6 +875,7 @@ class Machine(CoreObject):
def
releaseOperator
(
self
):
def
releaseOperator
(
self
):
self
.
outputTrace
(
self
.
currentOperator
.
objName
,
"released from "
+
self
.
objName
)
self
.
outputTrace
(
self
.
currentOperator
.
objName
,
"released from "
+
self
.
objName
)
# set the flag operatorAssignedTo to None
# set the flag operatorAssignedTo to None
# XXX in case of skilled operators which stay at the same station should that change
self
.
currentOperator
.
operatorAssignedTo
=
None
self
.
currentOperator
.
operatorAssignedTo
=
None
self
.
broker
.
invoke
()
self
.
broker
.
invoke
()
self
.
toBeOperated
=
False
self
.
toBeOperated
=
False
...
...
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