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
900c04af
Commit
900c04af
authored
Sep 18, 2014
by
Ioannis Papagiannopoulos
Committed by
Georgios Dagkakis
Oct 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ConditionalBuffer getEntity correction
parent
3875cef5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
22 deletions
+4
-22
dream/simulation/ConditionalBuffer.py
dream/simulation/ConditionalBuffer.py
+4
-22
No files found.
dream/simulation/ConditionalBuffer.py
View file @
900c04af
...
@@ -56,34 +56,16 @@ class ConditionalBuffer(QueueJobShop):
...
@@ -56,34 +56,16 @@ class ConditionalBuffer(QueueJobShop):
#===========================================================================
#===========================================================================
def
getEntity
(
self
):
def
getEntity
(
self
):
activeEntity
=
QueueJobShop
.
getEntity
(
self
)
activeEntity
=
QueueJobShop
.
getEntity
(
self
)
import
Globals
from
Globals
import
G
# for all the entities in the EntityList
# for all the entities in the EntityList
for
entity
in
G
.
EntityList
:
for
entity
in
G
.
EntityList
:
requiredParts
=
entity
.
getRequiredParts
()
requiredParts
=
entity
.
getRequiredParts
()
if
requiredParts
:
if
requiredParts
:
# if the activeEntity is in the requierdParts of the entity
# if the activeEntity is in the requierdParts of the entity
if
activeEntity
in
requiredParts
:
if
activeEntity
in
requiredParts
:
# if the entity is blocked
# if the entity that requires the activeEntity can proceed then signal the currentStation of the entity
if
not
entity
.
checkIfRequiredPartsReady
():
if
entity
.
checkIfRequiredPartsReady
():
# concluded flag to signal that the required parts have concluded their sequence
self
.
sendSignal
(
receiver
=
entity
.
currentStation
,
signal
=
entity
.
currentStation
.
canDispose
)
allConcluded
=
False
# figure out if the all required parts have concluded their sequences
for
part
in
requiredParts
:
# if the requiredParts have concluded its sequence then the flag must be set to True
# 1. the requiredPart hasn't reached the last step sequence before the requiring entity's sequence
# 2. The requiredPart has reached the last step sequence but not yet finished its current processing
if
(
part
.
nextStepSequence
()
<
entity
.
nextStepSequence
()
\
and
part
.
nextStepSequence
()
>
0
)
\
or
(
part
.
nextStepSequence
()
>=
entity
.
currentStepSequence
()
\
and
part
.
currentStepSequence
()
):
allConcluded
=
False
break
# if all the requiredParts completed the required sequence
if
allConcluded
:
# signal the current station of the blocked entity requesting the parts that it can proceed
# with delivering the blocked entity
entity
.
currentStation
.
canDispose
.
succeed
(
self
.
env
.
now
)
break
return
activeEntity
return
activeEntity
# =======================================================================
# =======================================================================
...
...
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