|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.generation5.bio.Flock
This class groups FlockingAgent into one flock.
FlockingAgent| Field Summary | |
protected java.awt.Color |
clrBackground
The background of the flock. |
protected int |
cols
The number of columns in the flocking world (this is equivalent to pixel width). |
protected FlockingAgent[] |
flock
The actual flocking agent array. |
protected int |
numFlockingAgents
The number of flocking agents in the flock. |
protected int |
rows
The number of rows in the flocking world (this is equivalent to pixel height). |
| Constructor Summary | |
Flock(int fa,
int cols,
int rows)
Create a new instance of Flock with size information. |
|
| Method Summary | |
void |
doStep()
Advance the boids world by one time-step. |
java.awt.Color |
getBackgroundColor()
Retrieve the background color. |
void |
init()
A standard initialization function. |
static void |
main(java.lang.String[] args)
A test function that writes the 640x480 boids world once every 10 time-steps for 250 iterations. |
void |
render(java.awt.Graphics g,
int width,
int height)
Draw the boids world. |
void |
reset()
Reset the flock (call init). |
void |
setBackgroundColor(java.awt.Color clr)
Set the background color. |
void |
setWorldSize(int rows,
int cols)
Set the number of rows and columns in the world. |
void |
writeImage(java.lang.String s,
int width,
int height)
Write an image of the boids world. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int rows
protected int cols
protected int numFlockingAgents
protected FlockingAgent[] flock
protected java.awt.Color clrBackground
| Constructor Detail |
public Flock(int fa,
int cols,
int rows)
fa - The number of flocking agents to assign.cols - The number of columns in the flocking world.rows - The number of rows in the flocking world.| Method Detail |
public void setWorldSize(int rows,
int cols)
rows - Number of rows in this world.cols - Number of columns in this world.public void init()
Steppable
init in interface Steppablepublic void doStep()
doStep in interface Steppablepublic static void main(java.lang.String[] args)
args - the command line arguments
public void render(java.awt.Graphics g,
int width,
int height)
render in interface Visualizableg - the graphics context.width - the width of the context.height - the height of the context.
public void writeImage(java.lang.String s,
int width,
int height)
writeImage in interface Visualizables - the filename.width - the width of the image.height - the height of the image.public void reset()
init).
reset in interface Steppableinit()public void setBackgroundColor(java.awt.Color clr)
clr - the background color.public java.awt.Color getBackgroundColor()
|
This documentation is part of the Generation5 JDK.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||