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
015f2752
Commit
015f2752
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
main script changed so that Operators also output results
parent
0fd23e97
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
8 deletions
+4
-8
dream/simulation/Globals.py
dream/simulation/Globals.py
+0
-1
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+1
-1
dream/simulation/Machine.py
dream/simulation/Machine.py
+1
-5
dream/simulation/OperatedPoolBroker.py
dream/simulation/OperatedPoolBroker.py
+2
-1
No files found.
dream/simulation/Globals.py
View file @
015f2752
...
@@ -169,5 +169,4 @@ def setWIP(entityList):
...
@@ -169,5 +169,4 @@ def setWIP(entityList):
entity
.
remainingRoute
.
pop
(
0
)
# remove data from the remaining route.
entity
.
remainingRoute
.
pop
(
0
)
# remove data from the remaining route.
entity
.
schedule
.
append
([
object
,
now
()])
#append the time to schedule so that it can be read in the result
entity
.
schedule
.
append
([
object
,
now
()])
#append the time to schedule so that it can be read in the result
entity
.
currentStation
=
object
# update the current station of the entity
entity
.
currentStation
=
object
# update the current station of the entity
dream/simulation/LineGenerationJSON.py
View file @
015f2752
...
@@ -201,7 +201,7 @@ def createObjects():
...
@@ -201,7 +201,7 @@ def createObjects():
O
.
coreObjectIds
=
getSuccessorList
(
id
)
# update the list of objects that the operator operates
O
.
coreObjectIds
=
getSuccessorList
(
id
)
# update the list of objects that the operator operates
# calling the getSuccesorList() method on the operator
# calling the getSuccesorList() method on the operator
G
.
OperatorsList
.
append
(
O
)
# add the operator to the RepairmanList
G
.
OperatorsList
.
append
(
O
)
# add the operator to the RepairmanList
#
G.ModelResourceList.append(O)
G
.
ModelResourceList
.
append
(
O
)
# -----------------------------------------------------------------------
# -----------------------------------------------------------------------
# loop through all the model resources
# loop through all the model resources
# search for operatorPools in order to create them
# search for operatorPools in order to create them
...
...
dream/simulation/Machine.py
View file @
015f2752
...
@@ -86,7 +86,6 @@ class Machine(CoreObject):
...
@@ -86,7 +86,6 @@ class Machine(CoreObject):
else
:
else
:
self
.
operatorPool
=
'None'
self
.
operatorPool
=
'None'
#self.operatorPool=operatorPool
#self.operatorPool=operatorPool
#print operatorPool
# update the operatorPool coreObjects list
# update the operatorPool coreObjects list
if
self
.
operatorPool
!=
'None'
:
if
self
.
operatorPool
!=
'None'
:
self
.
operatorPool
.
coreObjectIds
.
append
(
self
.
id
)
self
.
operatorPool
.
coreObjectIds
.
append
(
self
.
id
)
...
@@ -181,8 +180,7 @@ class Machine(CoreObject):
...
@@ -181,8 +180,7 @@ class Machine(CoreObject):
while
1
:
while
1
:
# wait until the machine can accept an entity and one predecessor requests it
# wait until the machine can accept an entity and one predecessor requests it
# canAcceptAndIsRequested is invoked to check when the machine requested to receive an entity
# canAcceptAndIsRequested is invoked to check when the machine requested to receive an entity
yield
waituntil
,
self
,
self
.
canAcceptAndIsRequested
yield
waituntil
,
self
,
self
.
canAcceptAndIsRequested
# here or in the get entity (apart from the loatTimeCurrentEntity)
# here or in the get entity (apart from the loatTimeCurrentEntity)
# in case they are placed inside the getEntity then the initialize of
# in case they are placed inside the getEntity then the initialize of
# the corresponding variables should be moved to the initialize() of the CoreObject
# the corresponding variables should be moved to the initialize() of the CoreObject
...
@@ -272,7 +270,6 @@ class Machine(CoreObject):
...
@@ -272,7 +270,6 @@ class Machine(CoreObject):
# after getting the entity release the operator
# after getting the entity release the operator
# machine has to release the operator
# machine has to release the operator
self
.
releaseOperator
()
self
.
releaseOperator
()
# print self.objName, 'operator released', now()
# wait until the Broker has finished processing
# wait until the Broker has finished processing
yield
waituntil
,
self
,
self
.
broker
.
brokerIsSet
yield
waituntil
,
self
,
self
.
broker
.
brokerIsSet
...
@@ -319,7 +316,6 @@ class Machine(CoreObject):
...
@@ -319,7 +316,6 @@ class Machine(CoreObject):
and
self
.
isOperated
()
\
and
self
.
isOperated
()
\
and
any
(
type
==
"Processing"
for
type
in
self
.
multOperationTypeList
):
and
any
(
type
==
"Processing"
for
type
in
self
.
multOperationTypeList
):
self
.
releaseOperator
()
self
.
releaseOperator
()
# print self.objName, 'operator released due to failure', now()
yield
waituntil
,
self
,
self
.
broker
.
brokerIsSet
yield
waituntil
,
self
,
self
.
broker
.
brokerIsSet
# if there is a failure in the machine it is passivated
# if there is a failure in the machine it is passivated
...
...
dream/simulation/OperatedPoolBroker.py
View file @
015f2752
...
@@ -80,8 +80,9 @@ class Broker(ObjectInterruption):
...
@@ -80,8 +80,9 @@ class Broker(ObjectInterruption):
self
.
victim
.
currentOperator
.
totalWorkingTime
+=
now
()
-
self
.
victim
.
currentOperator
.
timeLastOperationStarted
self
.
victim
.
currentOperator
.
totalWorkingTime
+=
now
()
-
self
.
victim
.
currentOperator
.
timeLastOperationStarted
yield
release
,
self
,
self
.
victim
.
operatorPool
.
getResource
(
self
.
victim
.
currentOperator
)
yield
release
,
self
,
self
.
victim
.
operatorPool
.
getResource
(
self
.
victim
.
currentOperator
)
# the victim current operator must be cleared after the operator is released
# the victim current operator must be cleared after the operator is released
self
.
victim
.
currentOperator
=
None
self
.
timeLastOperationEnded
=
now
()
self
.
timeLastOperationEnded
=
now
()
self
.
victim
.
currentOperator
.
totalWorkingTime
+=
self
.
timeLastOperationEnded
-
self
.
timeOperationStarted
self
.
victim
.
currentOperator
=
None
else
:
else
:
pass
pass
# return the control the machine.run
# return the control the machine.run
...
...
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