| Modifier and Type | Class and Description |
|---|---|
static class |
BoidSpecies.Parameter
Kinds of parameters.
|
| Constructor and Description |
|---|
BoidSpecies(BoidGraph ctx,
String name)
New default species with a random color.
|
| Modifier and Type | Method and Description |
|---|---|
Boid |
createBoid()
Create a new boid with an automatic id created using
createNewId(). |
Boid |
createBoid(String id)
Create a new boid.
|
String |
createNewId()
Create a new unique id specific to this species.
|
double |
getAngleOfView()
The boid angle of view, [-1..1].
|
double |
getAttractionFactor()
How much other visible boids attract a boid.
|
Color |
getColor()
The species main color.
|
double |
getDirectionFactor()
The importance of the other boids direction "overall" vector.
|
double |
getFearFactor()
Factor for repulsion on boids of other species.
|
double |
getInertia()
The inertia is the importance of the boid previous direction in the boid
direction.
|
double |
getMaxSpeed()
Maximum speed bound.
|
double |
getMinSpeed()
Minimum speed bound.
|
String |
getName()
Getter for the name of the species.
|
int |
getPopulation()
Count of boids of this species.
|
double |
getRepulsionFactor()
All the visible boids repulse the boid.
|
double |
getSpeedFactor()
The boid speed at each step.
|
double |
getViewZone()
The distance at which a boid is seen.
|
Iterator<Boid> |
iterator() |
void |
populate()
Create boids until population is at least count.
|
void |
release()
Unregister this species from the boids graph.
|
void |
set(BoidSpecies.Parameter p,
String val)
Utility function to set parameter from an enum constant and a string
value.
|
void |
set(String p,
String val)
Same than
set(Parameter, String) but the enum constant is given
as a string. |
void |
setAngleOfView(double aov)
Set the angle of view for boids of this species.
|
void |
setAttractionFactor(double attractionFactor)
Change how much other visible boids attract a boid.
|
void |
setColor(Color color)
Change the species main color.
|
void |
setDeathCondition(Probability probability)
The probability that a boids die.
|
void |
setDirectionFactor(double directionFactor)
Change the importance of the other boids direction "overall" vector.
|
void |
setFearFactor(double fearFactor)
Change the factor for repulsion on boids of other species.
|
void |
setInertia(double inertia)
Change the inertia is the importance of the boid previous direction in
the boid direction.
|
void |
setInitialCount(int count) |
void |
setMaxSpeed(double maxSpeed)
Change the maximum speed bound.
|
void |
setMinSpeed(double minSpeed)
Change the minimum speed bound.
|
void |
setReproductionProbability(Probability probability)
The probability that a boids clones itself.
|
void |
setRepulsionFactor(double repulsionFactor)
Change how all the visible boids repulse the boid.
|
void |
setSpeedFactor(double speedFactor)
Change the boid speed at each step.
|
void |
setViewZone(double viewZone)
Change the distance at which a boid is seen.
|
void |
terminateStep(double time)
This method is called by
BoidGraph at the
end of each step. |
public String getName()
public void set(String p, String val) throws IllegalArgumentException
set(Parameter, String) but the enum constant is given
as a string.p - name of the enum constant associated with a parameter. Note
that this name is case-independent since it is converted to
upper case in the methodval - string value of the parameterIllegalArgumentException - if the enum constant does not existpublic void set(BoidSpecies.Parameter p, String val)
p - an enum constant associated with a parameterval - string value of the parameterpublic String createNewId()
public Boid createBoid()
createNewId().public Boid createBoid(String id)
id - id of the new boidpublic void terminateStep(double time)
BoidGraph at the
end of each step. It can be used by sub-classes to add some code.time - The current boid graph time.public int getPopulation()
public void populate()
count - the minimum boid count for this speciespublic void setInitialCount(int count)
public double getViewZone()
public void setViewZone(double viewZone)
viewZone - public double getSpeedFactor()
public void setSpeedFactor(double speedFactor)
speedFactor - public double getMaxSpeed()
public void setMaxSpeed(double maxSpeed)
maxSpeed - public double getMinSpeed()
public void setMinSpeed(double minSpeed)
minSpeed - public double getDirectionFactor()
public void setDirectionFactor(double directionFactor)
directionFactor - public double getAttractionFactor()
public void setAttractionFactor(double attractionFactor)
attractionFactor - public double getRepulsionFactor()
public void setRepulsionFactor(double repulsionFactor)
repulsionFactor - public double getInertia()
public void setInertia(double inertia)
inertia - public double getFearFactor()
public void setFearFactor(double fearFactor)
fearFactor - public Color getColor()
public void setColor(Color color)
color - public double getAngleOfView()
public void setAngleOfView(double aov)
aov - new angle of viewpublic void setReproductionProbability(Probability probability)
probability - A probability instance.public void setDeathCondition(Probability probability)
probability - A probability instance.public void release()
Copyright © 2015. All rights reserved.