|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.graphstream.boids.BoidSpecies
public class BoidSpecies
Parameters for each boids species.
| Nested Class Summary | |
|---|---|
static class |
BoidSpecies.Parameter
Kinds of parameters. |
| Constructor Summary | |
|---|---|
BoidSpecies(BoidGraph ctx,
String name)
New default species with a random color. |
|
| Method Summary | |
|---|---|
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 |
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 |
setCount(int count)
Create boids until population is at least count. |
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 |
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. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BoidSpecies(BoidGraph ctx,
String name)
ctx - context in which this species is evolvingname - final name of this species| Method Detail |
|---|
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 parameter
IllegalArgumentException - if the enum constant does not exist
public 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 boid
public 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 setCount(int count)
count - the minimum boid count for this speciespublic 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()
public Iterator<Boid> iterator()
iterator in interface Iterable<Boid>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||