Class Flock

java.lang.Object
org.episteme.natural.computing.ai.simulation.Flock

public class Flock extends Object
Craig Reynolds' Boids Algorithm.
Author:
James Matthews
See Also:
  • invalid reference
    org.episteme.core.computing.ai.simulation.FlockingAgent
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The vector containing all the boids.
    int
    The number of columns in the flocking world (this is equivalent to pixel width).
    int
    The number of boids.
    int
    The number of rows in the flocking world (this is equivalent to pixel height).
  • Constructor Summary

    Constructors
    Constructor
    Description
    Flock(int numBoids, int columns, int rows)
    Creates a new Flock object.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Perform a step.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • rows

      public int rows
      The number of rows in the flocking world (this is equivalent to pixel height).
    • columns

      public int columns
      The number of columns in the flocking world (this is equivalent to pixel width).
    • boids

      public Vector<FlockingAgent> boids
      The vector containing all the boids.
    • numBoids

      public int numBoids
      The number of boids.
  • Constructor Details

    • Flock

      public Flock(int numBoids, int columns, int rows)
      Creates a new Flock object.
      Parameters:
      numBoids - number of boids.
      columns - width.
      rows - height.
  • Method Details

    • doStep

      public void doStep()
      Perform a step.