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
f12db0b0
Commit
f12db0b0
authored
Feb 04, 2014
by
Georgios Dagkakis
Committed by
Jérome Perrin
Feb 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor changes
parent
25ab8b6d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
20 deletions
+7
-20
dream/simulation/MachineManagedJob.py
dream/simulation/MachineManagedJob.py
+5
-20
dream/simulation/OperatedPoolBroker.py
dream/simulation/OperatedPoolBroker.py
+2
-0
No files found.
dream/simulation/MachineManagedJob.py
View file @
f12db0b0
...
...
@@ -47,6 +47,7 @@ class MachineManagedJob(MachineJobShop):
name
=
self
.
objName
+
'_operatorPool'
self
.
operatorPool
=
OperatorPool
(
id
,
name
,
operatorsList
=
[])
self
.
operatorPool
.
initialize
()
self
.
operatorPool
.
operators
=
[]
#create a Broker
self
.
broker
=
Broker
(
self
)
activate
(
self
.
broker
,
self
.
broker
.
run
())
...
...
@@ -61,22 +62,6 @@ class MachineManagedJob(MachineJobShop):
activeObject
=
self
.
getActiveObject
()
activeObjectQueue
=
self
.
getActiveObjectQueue
()
giverObject
=
self
.
getGiverObject
()
# if we have only one predecessor just check if there is a place,
# the machine is up and the predecessor has an entity to dispose
# if the machine has to compete for an Operator that loads the entities onto it
# check if the predecessor if blocked by an other Machine
# if not then the machine has to block the predecessor giverObject to avoid conflicts
# with other competing machines
if
(
len
(
activeObject
.
previous
)
==
1
):
if
(
any
(
type
==
'Load'
for
type
in
activeObject
.
multOperationTypeList
)):
if
activeObject
.
Up
and
len
(
activeObjectQueue
)
<
activeObject
.
capacity
\
and
giverObject
.
haveToDispose
(
activeObject
)
and
not
giverObject
.
exitIsAssigned
():
activeObject
.
giver
.
assignExit
()
#make the operatorsList so that it holds only the manager of the current order
activeObject
.
operatorPool
.
operatorsList
=
[
activeObject
.
giver
.
getActiveObjectQueue
()[
0
].
manager
]
return
True
else
:
return
False
# dummy variables that help prioritise the objects requesting to give objects to the Machine (activeObject)
isRequested
=
False
# is requested is dummyVariable checking if it is requested to accept an item
...
...
@@ -109,13 +94,13 @@ class MachineManagedJob(MachineJobShop):
# TODOD:
# update the last object calling the operatorPool
activeObject
.
operatorPool
.
receivingObject
=
activeObject
if
activeObject
.
operatorPool
.
checkIfResourceIsAvailable
()
\
and
activeObject
.
Up
and
len
(
activeObjectQueue
)
<
activeObject
.
capacity
\
if
activeObject
.
Up
and
len
(
activeObjectQueue
)
<
activeObject
.
capacity
\
and
isRequested
and
not
activeObject
.
giver
.
exitIsAssigned
():
activeObject
.
giver
.
assignExit
()
#make the operatorsList so that it holds only the manager of the current order
activeObject
.
operatorPool
.
operatorsList
=
[
activeObject
.
giver
.
getActiveObjectQueue
()[
0
].
manager
]
activeObject
.
operatorPool
.
operators
=
[
activeObject
.
giver
.
getActiveObjectQueue
()[
0
].
manager
]
return
True
else
:
return
False
...
...
@@ -127,4 +112,4 @@ class MachineManagedJob(MachineJobShop):
# operator is requested
# return (activeObject.operatorPool=='None' or activeObject.operatorPool.checkIfResourceIsAvailable())\
# and activeObject.Up and len(activeObjectQueue)<activeObject.capacity and isRequested
\ No newline at end of file
dream/simulation/OperatedPoolBroker.py
View file @
f12db0b0
...
...
@@ -74,10 +74,12 @@ class Broker(ObjectInterruption):
self
.
timeWaitForOperatorStarted
=
0
# update the time that the operation started
self
.
timeOperationStarted
=
now
()
#self.victim.outputTrace(self.victim.currentOperator.objName, "started work "+self.victim.objName)
self
.
victim
.
currentOperator
.
timeLastOperationStarted
=
now
()
# ======= release a resource
elif
not
self
.
victim
.
isOperated
():
self
.
victim
.
currentOperator
.
totalWorkingTime
+=
now
()
-
self
.
victim
.
currentOperator
.
timeLastOperationStarted
#self.victim.outputTrace(self.victim.currentOperator.objName, "finished work "+self.victim.objName)
yield
release
,
self
,
self
.
victim
.
operatorPool
.
getResource
(
self
.
victim
.
currentOperator
)
# the victim current operator must be cleared after the operator is released
self
.
timeLastOperationEnded
=
now
()
...
...
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