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
8d2a4e35
Commit
8d2a4e35
authored
Feb 11, 2014
by
Georgios Dagkakis
Committed by
Jérome Perrin
Feb 19, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a methodthat checks if the object is active added in CoreObject
parent
886d5d05
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
dream/simulation/CoreObject.py
dream/simulation/CoreObject.py
+7
-0
dream/simulation/Machine.py
dream/simulation/Machine.py
+8
-8
No files found.
dream/simulation/CoreObject.py
View file @
8d2a4e35
...
...
@@ -54,6 +54,7 @@ class CoreObject(Process):
def
initialize
(
self
):
Process
.
__init__
(
self
)
self
.
Up
=
True
#Boolean that shows if the machine is in failure ("Down") or not ("up")
self
.
onShift
=
True
self
.
currentEntity
=
None
# ============================== total times ===============================================
self
.
totalBlockageTime
=
0
#holds the total blockage time
...
...
@@ -389,3 +390,9 @@ class CoreObject(Process):
#ToDO make a generic method
pass
# =======================================================================
# checks if the object is in an active position
# =======================================================================
def
checkIfActive
(
self
):
return
self
.
Up
and
self
.
onShift
dream/simulation/Machine.py
View file @
8d2a4e35
...
...
@@ -488,7 +488,7 @@ class Machine(CoreObject):
activeObject
.
operatorPool
.
receivingObject
=
activeObject
if
activeObject
.
operatorPool
.
checkIfResourceIsAvailable
()
\
and
activeObject
.
Up
and
len
(
activeObjectQueue
)
<
activeObject
.
capacity
\
and
activeObject
.
checkIfActive
()
and
len
(
activeObjectQueue
)
<
activeObject
.
capacity
\
and
not
giverObject
.
exitIsAssigned
():
activeObject
.
giver
.
assignExit
()
return
True
...
...
@@ -498,14 +498,14 @@ class Machine(CoreObject):
# the operator performs no load and the entity is received by the machine while there is
# no need for operators presence. The operator needs to be present only where the load Type
# operation is assigned
return
activeObject
.
Up
and
len
(
activeObjectQueue
)
<
activeObject
.
capacity
\
return
activeObject
.
checkIfActive
()
and
len
(
activeObjectQueue
)
<
activeObject
.
capacity
\
and
giverObject
.
haveToDispose
(
activeObject
)
# TODO: if the set-up performance needs be first performed before the transfer of the entity to
# the machine then the presence of an operator to setup the machine before the getEntity()
# is requested
# return (activeObject.operatorPool=='None'\
# or activeObject.operatorPool.checkIfResourceIsAvailable())\
# and activeObject.
Up
and len(activeObjectQueue)<activeObject.capacity\
# and activeObject.
checkIfActive()
and len(activeObjectQueue)<activeObject.capacity\
# and giverObject.haveToDispose()
# dummy variables that help prioritise the objects requesting to give objects to the Machine (activeObject)
...
...
@@ -541,7 +541,7 @@ class Machine(CoreObject):
activeObject
.
operatorPool
.
receivingObject
=
activeObject
if
activeObject
.
operatorPool
.
checkIfResourceIsAvailable
()
\
and
activeObject
.
Up
and
len
(
activeObjectQueue
)
<
activeObject
.
capacity
\
and
activeObject
.
checkIfActive
()
and
len
(
activeObjectQueue
)
<
activeObject
.
capacity
\
and
isRequested
and
not
activeObject
.
giver
.
exitIsAssigned
():
activeObject
.
giver
.
assignExit
()
return
True
...
...
@@ -550,11 +550,11 @@ class Machine(CoreObject):
else
:
# the operator doesn't have to be present for the loading of the machine as the load operation
# is not assigned to operators
return
activeObject
.
Up
and
len
(
activeObjectQueue
)
<
activeObject
.
capacity
and
isRequested
return
activeObject
.
checkIfActive
()
and
len
(
activeObjectQueue
)
<
activeObject
.
capacity
and
isRequested
# while if the set up is performed before the (automatic) loading of the machine then the availability of the
# operator is requested
# return (activeObject.operatorPool=='None' or activeObject.operatorPool.checkIfResourceIsAvailable())\
# and activeObject.
Up
and len(activeObjectQueue)<activeObject.capacity and isRequested
# and activeObject.
checkIfActive()
and len(activeObjectQueue)<activeObject.capacity and isRequested
# =======================================================================
# checks if the machine down or it can dispose the object
...
...
@@ -583,7 +583,7 @@ class Machine(CoreObject):
#if we have only one successor just check if machine waits to dispose and also is up
# this is done to achieve better (cpu) processing time
if
(
len
(
activeObject
.
next
)
==
1
or
callerObject
==
None
):
return
len
(
activeObjectQueue
)
>
0
and
activeObject
.
waitToDispose
and
activeObject
.
Up
return
len
(
activeObjectQueue
)
>
0
and
activeObject
.
waitToDispose
and
activeObject
.
checkIfActive
()
# # if the Machine is empty it returns false right away
# if(len(activeObjectQueue)==0):
...
...
@@ -601,7 +601,7 @@ class Machine(CoreObject):
activeObject
.
receiver
=
object
# set the receiver as the longest waiting possible receiver
# in the next loops, check the other successors in the previous list
return
len
(
activeObjectQueue
)
>
0
and
activeObject
.
waitToDispose
\
and
activeObject
.
Up
and
(
thecaller
is
self
.
receiver
)
and
activeObject
.
checkIfActive
()
and
(
thecaller
is
self
.
receiver
)
# =======================================================================
# calculates the setup time
...
...
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