Class FlockingBehavior

java.lang.Object
org.episteme.natural.computing.ai.simulation.FlockingBehavior
All Implemented Interfaces:
Behavior

public class FlockingBehavior extends Object implements Behavior
Behavior implementing the Reynolds flocking rules (Cohesion, Alignment, Separation).
  • Constructor Details

    • FlockingBehavior

      public FlockingBehavior(FlockingAgent agentProxy, int index)
  • Method Details

    • action

      public void action()
      Description copied from interface: Behavior
      Execution logic of the behavior. This method is called repeatedly by the agent scheduler until Behavior.done() returns true.
      Specified by:
      action in interface Behavior
    • done

      public boolean done()
      Description copied from interface: Behavior
      Checks if the behavior has completed its task.
      Specified by:
      done in interface Behavior
      Returns:
      true if the behavior is finished, false otherwise.
    • setAgent

      public void setAgent(Agent agent)
      Description copied from interface: Behavior
      Sets the agent this behavior belongs to.
      Specified by:
      setAgent in interface Behavior
      Parameters:
      agent - the owner agent.
    • getAgent

      public Agent getAgent()
      Description copied from interface: Behavior
      Gets the agent this behavior belongs to.
      Specified by:
      getAgent in interface Behavior
      Returns:
      the owner agent.