s373.boids
Class Flock2d

java.lang.Object
  extended by s373.boids.Flock2d

public class Flock2d
extends Object


Field Summary
 ArrayList<AttractionPoint2d> attractionPoints
           
 ArrayList<Boid2d> boids
           
 
Constructor Summary
Flock2d(int num, float lx, float ly)
           
Flock2d(int num, float lx, float ly, float dev)
           
 
Method Summary
 Flock2d add(float lx, float ly)
           
 Flock2d addAttractionPoint(float x, float y, float force, float sensorDist)
           
 void changeAttractionPoint(int id, float x, float y, float force, float sensorDist)
           
 Boid2d get(int idx)
           
 float getAlign()
           
 ArrayList<AttractionPoint2d> getAttractionPoints()
           
 int getBoundmode()
           
 float getCohesion()
           
 float getDistAlign()
           
 float getDistCohesion()
           
 float getMaxForce()
           
 float getMaxSpeed()
           
 float getMaxTurn()
           
 float getSeparate()
           
 float getSeparation()
           
 boolean hasAttractionPoints()
           
 void init(int num, float lx, float ly, float dev)
           
 Flock2d setAlign(float forceAlign)
           
 Flock2d setBoundmode(int boundmode)
           
 Flock2d setBounds(float minx, float miny, float maxx, float maxy)
           
 Flock2d setCohesion(float forceCohesion)
           
 Flock2d setDistAlign(float d)
           
 Flock2d setDistCohesion(float d)
           
 Flock2d setDistSeparation(float distSeparation)
           
 Flock2d setMaxForce(float mf)
           
 Flock2d setMaxSpeed(float ms)
           
 Flock2d setMaxTurn(float mt)
           
 Flock2d setSeparate(float forceSeparate)
           
 int size()
           
 void update(float amount)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

boids

public ArrayList<Boid2d> boids

attractionPoints

public ArrayList<AttractionPoint2d> attractionPoints
Constructor Detail

Flock2d

public Flock2d(int num,
               float lx,
               float ly)

Flock2d

public Flock2d(int num,
               float lx,
               float ly,
               float dev)
Method Detail

init

public void init(int num,
                 float lx,
                 float ly,
                 float dev)

add

public Flock2d add(float lx,
                   float ly)

setMaxTurn

public Flock2d setMaxTurn(float mt)

setMaxSpeed

public Flock2d setMaxSpeed(float ms)

setMaxForce

public Flock2d setMaxForce(float mf)

getMaxTurn

public float getMaxTurn()

getMaxSpeed

public float getMaxSpeed()

getMaxForce

public float getMaxForce()

getSeparate

public float getSeparate()

setSeparate

public Flock2d setSeparate(float forceSeparate)

setAlign

public Flock2d setAlign(float forceAlign)

setCohesion

public Flock2d setCohesion(float forceCohesion)

getAlign

public float getAlign()

getCohesion

public float getCohesion()

getSeparation

public float getSeparation()
Returns:
the distSeparation

getDistAlign

public float getDistAlign()
Returns:
the distNeighborDistance

getDistCohesion

public float getDistCohesion()
Returns:
the distNeighborDistance

setDistSeparation

public Flock2d setDistSeparation(float distSeparation)
Parameters:
distSeparation - the distSeparation to set

setDistAlign

public Flock2d setDistAlign(float d)
Returns:
the distNeighborDistance

setDistCohesion

public Flock2d setDistCohesion(float d)
Returns:
the distNeighborDistance

setBounds

public Flock2d setBounds(float minx,
                         float miny,
                         float maxx,
                         float maxy)

getBoundmode

public int getBoundmode()
Returns:
the boundmode

setBoundmode

public Flock2d setBoundmode(int boundmode)
Parameters:
boundmode - the boundmode to set

update

public void update(float amount)

size

public int size()

get

public Boid2d get(int idx)

addAttractionPoint

public Flock2d addAttractionPoint(float x,
                                  float y,
                                  float force,
                                  float sensorDist)

getAttractionPoints

public ArrayList<AttractionPoint2d> getAttractionPoints()

hasAttractionPoints

public boolean hasAttractionPoints()

changeAttractionPoint

public void changeAttractionPoint(int id,
                                  float x,
                                  float y,
                                  float force,
                                  float sensorDist)


Processing library boids by Andre Sier. (C) 2010-12