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
fd00b518
Commit
fd00b518
authored
Sep 25, 2014
by
Ioannis Papagiannopoulos
Committed by
Jérome Perrin
Feb 04, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
corrections in sortEntities of MouldAssemblyBuffer
parent
9a28f2ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
dream/simulation/MouldAssemblyBuffer.py
dream/simulation/MouldAssemblyBuffer.py
+7
-6
No files found.
dream/simulation/MouldAssemblyBuffer.py
View file @
fd00b518
...
...
@@ -27,7 +27,6 @@ Only if all the mould (order) components are present, will it be able to dispose
'''
from
ConditionalBuffer
import
ConditionalBuffer
# from SimPy.Simulation import now
import
simpy
# ===========================================================================
...
...
@@ -65,12 +64,13 @@ class MouldAssemblyBuffer(ConditionalBuffer):
are present in other MouldAssemblyBuffers
'''
# execute default behaviour
from
Globals
import
G
activeObject
=
self
.
getActiveObject
()
activeObjectQueue
=
activeObject
.
getActiveObjectQueue
()
activeEntity
=
ConditionalBuffer
.
getEntity
(
self
)
# if the activeEntity is of type orderComponent
try
:
if
activeEntity
.
componentType
in
assemblyValidTypes
:
if
activeEntity
.
componentType
in
self
.
assemblyValidTypes
:
activeEntity
.
readyForAssembly
=
1
# for all the components that have the same parent Order as the activeEntity
activeEntity
.
order
.
componentsReadyForAssembly
=
1
...
...
@@ -143,8 +143,9 @@ class MouldAssemblyBuffer(ConditionalBuffer):
activeObjectQueue
=
activeObject
.
getActiveObjectQueue
()
# if all the components of the same mould are present then move them to the front of the activeQ
activeObjectQueue
.
sort
(
key
=
lambda
x
:
x
.
order
.
componentsReadyForAssembly
,
reverse
=
True
)
# keep the first entity of the activeQ
activeEntity
=
activeObjectQueue
[
0
]
# bring the entities that have the same parentOrder as the first entity to the front
activeObjectQueue
.
sort
(
key
=
lambda
x
:
not
x
.
order
.
name
==
activeEntity
.
order
.
name
)
if
activeObjectQueue
:
# keep the first entity of the activeQ
activeEntity
=
activeObjectQueue
[
0
]
# bring the entities that have the same parentOrder as the first entity to the front
activeObjectQueue
.
sort
(
key
=
lambda
x
:
not
x
.
order
.
name
==
activeEntity
.
order
.
name
)
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