Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
René Søndergaard Nilsson
LEGO
Commits
3ee12ab8
Commit
3ee12ab8
authored
Jun 01, 2015
by
lildholdt
Browse files
Working partical swarm
parent
3ffad4cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Lesson11/Programs/RobotMonitor/src/Particle.java
View file @
3ee12ab8
...
...
@@ -25,7 +25,7 @@ public class Particle
private
static
Random
rand
=
new
Random
();
private
Pose
pose
;
private
float
weight
=
1
;
private
int
blackWhiteThreshold
=
42
;
private
int
blackWhiteThreshold
=
500
;
/**
* Create a particle with a specific pose
...
...
@@ -76,7 +76,7 @@ public class Particle
{
if
(
m
.
getColor
(
pose
)
==
Color
.
BLACK
)
{
if
(
lightValue
<
blackWhiteThreshold
)
if
(
lightValue
>
blackWhiteThreshold
)
weight
=
0.9f
;
else
weight
=
0.1f
;
...
...
@@ -85,7 +85,7 @@ public class Particle
{
if
(
m
.
getColor
(
pose
)
==
Color
.
WHITE
)
{
if
(
lightValue
<
blackWhiteThreshold
)
if
(
lightValue
>
blackWhiteThreshold
)
weight
=
0.1f
;
else
weight
=
0.9f
;
...
...
Write
Preview
Supports
Markdown
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