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
7fe3cee6
Commit
7fe3cee6
authored
Sep 25, 2014
by
Ioannis Papagiannopoulos
Committed by
Georgios Dagkakis
Nov 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
corrections in sortEntities of MouldAssemblyBuffer
parent
148abc2b
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 @
7fe3cee6
...
...
@@ -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