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
f24eb2f1
Commit
f24eb2f1
authored
Sep 04, 2014
by
Ioannis Papagiannopoulos
Committed by
Georgios Dagkakis
Nov 03, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
canAccept of Machine clean-up
parent
ec56ba20
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
15 deletions
+6
-15
dream/simulation/Machine.py
dream/simulation/Machine.py
+6
-15
No files found.
dream/simulation/Machine.py
View file @
f24eb2f1
...
@@ -966,21 +966,11 @@ class Machine(CoreObject):
...
@@ -966,21 +966,11 @@ class Machine(CoreObject):
if
self
.
isLocked
:
if
self
.
isLocked
:
return
False
return
False
activeObjectQueue
=
self
.
Res
.
users
activeObjectQueue
=
self
.
Res
.
users
# if we have only one predecessor just check if there is a place and the machine is up
# local flag that is set only if there is no callerObject or if thecaller is predecessor of the activeObject
# this is done to achieve better (cpu) processing time
theCallerIsPredecessor
=
False
# then we can also use it as a filter for a yield method
if
(
callerObject
==
None
):
if
(
self
.
operatorPool
!=
'None'
and
(
any
(
type
==
'Load'
for
type
in
self
.
multOperationTypeList
)
\
or
any
(
type
==
'Setup'
for
type
in
self
.
multOperationTypeList
))):
return
self
.
operatorPool
.
checkIfResourceIsAvailable
()
\
and
self
.
checkIfMachineIsUp
()
\
and
len
(
activeObjectQueue
)
<
self
.
capacity
\
and
not
self
.
entryIsAssignedTo
()
else
:
return
self
.
checkIfMachineIsUp
()
\
and
len
(
activeObjectQueue
)
<
self
.
capacity
\
and
not
self
.
entryIsAssignedTo
()
thecaller
=
callerObject
thecaller
=
callerObject
if
callerObject
==
None
or
thecaller
in
self
.
previous
:
theCallerIsPredecessor
=
True
# return True ONLY if the length of the activeOjbectQue is smaller than
# return True ONLY if the length of the activeOjbectQue is smaller than
# the object capacity, and the callerObject is not None but the giverObject
# the object capacity, and the callerObject is not None but the giverObject
if
(
self
.
operatorPool
!=
'None'
and
(
any
(
type
==
'Load'
for
type
in
self
.
multOperationTypeList
)
\
if
(
self
.
operatorPool
!=
'None'
and
(
any
(
type
==
'Load'
for
type
in
self
.
multOperationTypeList
)
\
...
@@ -988,13 +978,14 @@ class Machine(CoreObject):
...
@@ -988,13 +978,14 @@ class Machine(CoreObject):
return
self
.
operatorPool
.
checkIfResourceIsAvailable
()
\
return
self
.
operatorPool
.
checkIfResourceIsAvailable
()
\
and
self
.
checkIfMachineIsUp
()
\
and
self
.
checkIfMachineIsUp
()
\
and
len
(
activeObjectQueue
)
<
self
.
capacity
\
and
len
(
activeObjectQueue
)
<
self
.
capacity
\
and
theCallerIsPredecessor
\
and
not
self
.
entryIsAssignedTo
()
and
not
self
.
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
self
.
checkIfMachineIsUp
()
\
return
self
.
checkIfMachineIsUp
()
\
and
len
(
activeObjectQueue
)
<
self
.
capacity
\
and
len
(
activeObjectQueue
)
<
self
.
capacity
\
and
(
thecaller
in
self
.
previous
)
\
and
theCallerIsPredecessor
\
and
not
self
.
entryIsAssignedTo
()
and
not
self
.
entryIsAssignedTo
()
# =======================================================================
# =======================================================================
...
...
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