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
Show 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):
...
@@ -454,7 +454,6 @@ class Machine(CoreObject):
if
not
self
.
signalReceiver
():
if
not
self
.
signalReceiver
():
# if there was no available receiver, get into blocking control
# if there was no available receiver, get into blocking control
while
1
:
while
1
:
# wait the event canDispose, this means that the station can deliver the item to successor
# wait the event canDispose, this means that the station can deliver the item to successor
event
=
yield
waitevent
,
self
,
[
self
.
canDispose
,
self
.
interruptionStart
]
event
=
yield
waitevent
,
self
,
[
self
.
canDispose
,
self
.
interruptionStart
]
# if there was interruption
# if there was interruption
...
@@ -487,6 +486,10 @@ class Machine(CoreObject):
...
@@ -487,6 +486,10 @@ class Machine(CoreObject):
activeObject
=
self
.
getActiveObject
()
activeObject
=
self
.
getActiveObject
()
activeObjectQueue
=
activeObject
.
getActiveObjectQueue
()
activeObjectQueue
=
activeObject
.
getActiveObjectQueue
()
activeEntity
=
activeObjectQueue
[
0
]
activeEntity
=
activeObjectQueue
[
0
]
#=======================================================================
# # TESTING
# print activeObject.getActiveObjectQueue()[0].name,"ended processing in "+activeObject.objName
#=======================================================================
# reset the variables used to handle the interruptions timing
# reset the variables used to handle the interruptions timing
self
.
timeRestartingProcessing
=
0
self
.
timeRestartingProcessing
=
0
self
.
breakTime
=
0
self
.
breakTime
=
0
...
@@ -606,14 +609,17 @@ class Machine(CoreObject):
...
@@ -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
# 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
# this is done to achieve better (cpu) processing time
# then we can also use it as a filter for a yield method
# 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
)
\
if
(
activeObject
.
operatorPool
!=
'None'
and
(
any
(
type
==
'Load'
for
type
in
activeObject
.
multOperationTypeList
)
\
or
any
(
type
==
'Setup'
for
type
in
activeObject
.
multOperationTypeList
))):
or
any
(
type
==
'Setup'
for
type
in
activeObject
.
multOperationTypeList
))):
return
activeObject
.
operatorPool
.
checkIfResourceIsAvailable
()
\
return
activeObject
.
operatorPool
.
checkIfResourceIsAvailable
()
\
and
activeObject
.
checkIfMachineIsUp
()
\
and
activeObject
.
checkIfMachineIsUp
()
\
and
len
(
activeObjectQueue
)
<
activeObject
.
capacity
and
len
(
activeObjectQueue
)
<
activeObject
.
capacity
\
and
not
activeObject
.
entryIsAssignedTo
()
else
:
else
:
return
activeObject
.
checkIfMachineIsUp
()
and
len
(
activeObjectQueue
)
<
activeObject
.
capacity
\
return
activeObject
.
checkIfMachineIsUp
()
\
and
len
(
activeObjectQueue
)
<
activeObject
.
capacity
\
and
not
activeObject
.
entryIsAssignedTo
()
thecaller
=
callerObject
thecaller
=
callerObject
# return True ONLY if the length of the activeOjbectQue is smaller than
# return True ONLY if the length of the activeOjbectQue is smaller than
...
@@ -622,11 +628,15 @@ class Machine(CoreObject):
...
@@ -622,11 +628,15 @@ class Machine(CoreObject):
or
any
(
type
==
'Setup'
for
type
in
activeObject
.
multOperationTypeList
))):
or
any
(
type
==
'Setup'
for
type
in
activeObject
.
multOperationTypeList
))):
return
activeObject
.
operatorPool
.
checkIfResourceIsAvailable
()
\
return
activeObject
.
operatorPool
.
checkIfResourceIsAvailable
()
\
and
activeObject
.
checkIfMachineIsUp
()
\
and
activeObject
.
checkIfMachineIsUp
()
\
and
len
(
activeObjectQueue
)
<
activeObject
.
capacity
and
len
(
activeObjectQueue
)
<
activeObject
.
capacity
\
and
not
activeObject
.
entryIsAssignedTo
()
else
:
else
:
# the operator doesn't have to be present for the loading of the machine as the load operation
# the operator doesn't have to be present for the loading of the machine as the load operation
# is not assigned to operators
# 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
# 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