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
0ebf00f8
Commit
0ebf00f8
authored
Apr 19, 2014
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Machine now controls if its entry is assigned before returning True from canAccept
parent
8a609356
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
dream/simulation/Machine.py
dream/simulation/Machine.py
+16
-6
No files found.
dream/simulation/Machine.py
View file @
0ebf00f8
...
...
@@ -454,7 +454,6 @@ class Machine(CoreObject):
if
not
self
.
signalReceiver
():
# if there was no available receiver, get into blocking control
while
1
:
# wait the event canDispose, this means that the station can deliver the item to successor
event
=
yield
waitevent
,
self
,
[
self
.
canDispose
,
self
.
interruptionStart
]
# if there was interruption
...
...
@@ -487,6 +486,10 @@ class Machine(CoreObject):
activeObject
=
self
.
getActiveObject
()
activeObjectQueue
=
activeObject
.
getActiveObjectQueue
()
activeEntity
=
activeObjectQueue
[
0
]
#=======================================================================
# # TESTING
# print activeObject.getActiveObjectQueue()[0].name,"ended processing in "+activeObject.objName
#=======================================================================
# reset the variables used to handle the interruptions timing
self
.
timeRestartingProcessing
=
0
self
.
breakTime
=
0
...
...
@@ -606,14 +609,17 @@ class Machine(CoreObject):
# if we have only one predecessor just check if there is a place and the machine is up
# this is done to achieve better (cpu) processing time
# then we can also use it as a filter for a yield method
if
(
len
(
activeObject
.
previous
)
==
1
or
callerObject
==
None
):
if
(
callerObject
==
None
):
if
(
activeObject
.
operatorPool
!=
'None'
and
(
any
(
type
==
'Load'
for
type
in
activeObject
.
multOperationTypeList
)
\
or
any
(
type
==
'Setup'
for
type
in
activeObject
.
multOperationTypeList
))):
return
activeObject
.
operatorPool
.
checkIfResourceIsAvailable
()
\
and
activeObject
.
checkIfMachineIsUp
()
\
and
len
(
activeObjectQueue
)
<
activeObject
.
capacity
and
len
(
activeObjectQueue
)
<
activeObject
.
capacity
\
and
not
activeObject
.
entryIsAssignedTo
()
else
:
return
activeObject
.
checkIfMachineIsUp
()
and
len
(
activeObjectQueue
)
<
activeObject
.
capacity
\
return
activeObject
.
checkIfMachineIsUp
()
\
and
len
(
activeObjectQueue
)
<
activeObject
.
capacity
\
and
not
activeObject
.
entryIsAssignedTo
()
thecaller
=
callerObject
# return True ONLY if the length of the activeOjbectQue is smaller than
...
...
@@ -622,11 +628,15 @@ class Machine(CoreObject):
or
any
(
type
==
'Setup'
for
type
in
activeObject
.
multOperationTypeList
))):
return
activeObject
.
operatorPool
.
checkIfResourceIsAvailable
()
\
and
activeObject
.
checkIfMachineIsUp
()
\
and
len
(
activeObjectQueue
)
<
activeObject
.
capacity
and
len
(
activeObjectQueue
)
<
activeObject
.
capacity
\
and
not
activeObject
.
entryIsAssignedTo
()
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
.
checkIfMachineIsUp
()
and
len
(
activeObjectQueue
)
<
activeObject
.
capacity
and
(
thecaller
in
activeObject
.
previous
)
return
activeObject
.
checkIfMachineIsUp
()
\
and
len
(
activeObjectQueue
)
<
activeObject
.
capacity
\
and
(
thecaller
in
activeObject
.
previous
)
\
and
not
activeObject
.
entryIsAssignedTo
()
# =======================================================================
# checks if the Machine can accept an entity and there is an entity in
...
...
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