Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
comp-sci-project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
nguyed99
comp-sci-project
Commits
adeaff5e
Commit
adeaff5e
authored
1 year ago
by
nguyed99
Browse files
Options
Downloads
Plain Diff
Merge branch 'nicoa96-main-patch-47348' into 'main'
Update bht_algorithm_3D.py See merge request
!9
parents
5ee7d1a3
8ac38b6a
Branches
Branches containing commit
No related tags found
2 merge requests
!11
Revert "Merge branch 'nicoa96-main-patch-47348' into 'main'"
,
!9
Update bht_algorithm_3D.py
Pipeline
#59653
passed
1 year ago
Stage: test-jobs
Stage: build-page
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
jobs/src/bht_algorithm_3D.py
+4
-4
4 additions, 4 deletions
jobs/src/bht_algorithm_3D.py
with
4 additions
and
4 deletions
jobs/src/bht_algorithm_3D.py
+
4
−
4
View file @
adeaff5e
...
@@ -22,7 +22,7 @@ class MainApp:
...
@@ -22,7 +22,7 @@ class MainApp:
self
.
rootNode
.
insert
(
particle
)
self
.
rootNode
.
insert
(
particle
)
def
ResetTree
(
self
,
particles
):
def
ResetTree
(
self
,
particles
):
"""
Reset the
Quad
tree by reinitializing the root node.
"""
"""
Reset the
Oc
tree by reinitializing the root node.
"""
# Define the size of the rootNode based on the positions of the particles
# Define the size of the rootNode based on the positions of the particles
#min_x = min([particle.x for particle in particles])
#min_x = min([particle.x for particle in particles])
#min_y = min([particle.y for particle in particles])
#min_y = min([particle.y for particle in particles])
...
@@ -161,8 +161,8 @@ class TreeNode:
...
@@ -161,8 +161,8 @@ class TreeNode:
mid_x
=
self
.
x
+
self
.
width
/
2
mid_x
=
self
.
x
+
self
.
width
/
2
mid_y
=
self
.
y
+
self
.
height
/
2
mid_y
=
self
.
y
+
self
.
height
/
2
mid_z
=
self
.
z
+
self
.
depth
/
2
mid_z
=
self
.
z
+
self
.
depth
/
2
quad
_index
=
(
particle
.
x
>=
mid_x
)
+
2
*
(
particle
.
y
>=
mid_y
)
+
4
*
(
particle
.
z
>=
mid_z
)
oct
_index
=
(
particle
.
x
>=
mid_x
)
+
2
*
(
particle
.
y
>=
mid_y
)
+
4
*
(
particle
.
z
>=
mid_z
)
return
quad
_index
return
oct
_index
def
print_tree
(
self
,
depth_
=
0
):
def
print_tree
(
self
,
depth_
=
0
):
"""
Print the structure of the Octree.
"""
Print the structure of the Octree.
...
@@ -363,4 +363,4 @@ class TreeNode:
...
@@ -363,4 +363,4 @@ class TreeNode:
self
.
mass
=
total_mass
self
.
mass
=
total_mass
else
:
else
:
self
.
center_of_mass
=
np
.
array
([
0.0
,
0.0
,
0.0
])
self
.
center_of_mass
=
np
.
array
([
0.0
,
0.0
,
0.0
])
self
.
mass
=
0
self
.
mass
=
0
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment