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
d73eacee
Commit
d73eacee
authored
Sep 25, 2014
by
Ioannis Papagiannopoulos
Committed by
Georgios Dagkakis
Oct 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correction of checkIfRequiredPartsReady
parent
b4d9828a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
12 deletions
+13
-12
dream/simulation/Job.py
dream/simulation/Job.py
+11
-10
dream/simulation/OperatorRouter.py
dream/simulation/OperatorRouter.py
+2
-2
No files found.
dream/simulation/Job.py
View file @
d73eacee
...
@@ -126,13 +126,14 @@ class Job(Entity): # inherits from the Entity c
...
@@ -126,13 +126,14 @@ class Job(Entity): # inherits from the Entity c
# of the entity's next step in its route
# of the entity's next step in its route
#===========================================================================
#===========================================================================
def
checkIfRequiredPartsReady
(
self
):
def
checkIfRequiredPartsReady
(
self
):
# if the entity is in a queue (currentSeq==0) then return false
if
self
.
currentStepSequence
():
return
False
# find the sequence of the next step in the route of the activeEntity
# find the sequence of the next step in the route of the activeEntity
s
equence
=
self
.
nextStepSequence
()
nextS
equence
=
self
.
nextStepSequence
()
# if no sequence is provided then return true
# if no sequence is provided then return true
if
sequence
==
'not available'
:
if
nextSequence
==
None
:
return
True
return
True
# assert that the sequence is not zero
assert
sequence
,
"the route sequence of the conditionalBuffer successor cannot be zero"
# flag that decides if the entity can proceed to the next station in its route
# flag that decides if the entity can proceed to the next station in its route
mayProceed
=
False
mayProceed
=
False
# find the required parts for the next step in the route (if any)
# find the required parts for the next step in the route (if any)
...
@@ -142,17 +143,17 @@ class Job(Entity): # inherits from the Entity c
...
@@ -142,17 +143,17 @@ class Job(Entity): # inherits from the Entity c
# for each requested part
# for each requested part
for
part
in
requiredParts
:
for
part
in
requiredParts
:
# retrieve the current step sequence of the requiredPart
# retrieve the current step sequence of the requiredPart
curStep
Seq
=
part
.
currentStepSequence
()
partCurrent
Seq
=
part
.
currentStepSequence
()
# retrieve the next step sequence of the requiredParts
# retrieve the next step sequence of the requiredParts
nextStep
Seq
=
part
.
nextStepSequence
()
partNext
Seq
=
part
.
nextStepSequence
()
# if there is no next step sequence (route finished)
# if there is no next step sequence (route finished)
# it means that the part has exhausted its route
# it means that the part has exhausted its route
# if the sequence of the required part next step is smaller than the sequence of activeEntity's next step
# if the sequence of the required part next step is smaller than the sequence of activeEntity's next step
# the activeEntity cannot proceed
# the activeEntity cannot proceed
if
nextStepSeq
>
sequence
or
not
nextStep
Seq
:
if
partNextSeq
>
nextSequence
or
not
partNext
Seq
:
# if the sequence of the requiredPart's currentStation is not zero then the
# if the sequence of the requiredPart's currentStation is not zero then the
# required part is currently being processed and thus the activeEntity cannot proceed
# required part is currently being processed and thus the activeEntity cannot proceed
if
not
curStep
Seq
:
if
not
partCurrent
Seq
:
mayProceed
=
True
mayProceed
=
True
else
:
else
:
mayProceed
=
False
mayProceed
=
False
...
@@ -190,11 +191,11 @@ class Job(Entity): # inherits from the Entity c
...
@@ -190,11 +191,11 @@ class Job(Entity): # inherits from the Entity c
#===========================================================================
#===========================================================================
def
nextStepSequence
(
self
):
def
nextStepSequence
(
self
):
# find the sequence of the next step in the route of the activeEntity
# find the sequence of the next step in the route of the activeEntity
sequence
=
self
.
remainingRoute
[
0
].
get
(
'sequence'
,
'not available'
)
sequence
=
self
.
remainingRoute
[
0
].
get
(
'sequence'
,
None
)
return
sequence
return
sequence
#===========================================================================
#===========================================================================
# method that returns the sequence of the entity's current step
# method that returns the sequence of the entity's current step
(returns zero if the entity is in a queue)
#===========================================================================
#===========================================================================
def
currentStepSequence
(
self
):
def
currentStepSequence
(
self
):
currentStation
=
self
.
currentStation
# the current station of the part
currentStation
=
self
.
currentStation
# the current station of the part
...
...
dream/simulation/OperatorRouter.py
View file @
d73eacee
...
@@ -248,12 +248,12 @@ class Router(ObjectInterruption):
...
@@ -248,12 +248,12 @@ class Router(ObjectInterruption):
object
.
getActiveObjectQueue
().
sort
(
key
=
lambda
x
:
x
.
isCritical
,
reverse
=
True
)
object
.
getActiveObjectQueue
().
sort
(
key
=
lambda
x
:
x
.
isCritical
,
reverse
=
True
)
# search among the pendingEntities
# search among the pendingEntities
for
entity
in
G
.
pendingEntities
:
for
entity
in
G
.
pendingEntities
:
# if the entity resides in a machine
# if the entity resides in a machine
that waits for load operation
if
entity
.
currentStation
in
G
.
MachineList
:
if
entity
.
currentStation
in
G
.
MachineList
:
if
entity
.
currentStation
.
broker
.
waitForOperator
:
if
entity
.
currentStation
.
broker
.
waitForOperator
:
self
.
pendingMachines
.
append
(
entity
.
currentStation
)
self
.
pendingMachines
.
append
(
entity
.
currentStation
)
self
.
pending
.
append
(
entity
)
self
.
pending
.
append
(
entity
)
# otherwise proceed only if the entity is at the head of the
queue
it resides
# otherwise proceed only if the entity is at the head of the
"queue"
it resides
if
entity
.
currentStation
.
getActiveObjectQueue
().
index
(
entity
)
==
0
:
if
entity
.
currentStation
.
getActiveObjectQueue
().
index
(
entity
)
==
0
:
# check the next stations
# check the next stations
for
machine
in
entity
.
currentStation
.
next
:
for
machine
in
entity
.
currentStation
.
next
:
...
...
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