modelling
Class MovingAgent.MoveTo

java.lang.Object
  extended bysema.Agent.Action
      extended bymodelling.MovingAgent.MoveTo
Enclosing class:
MovingAgent

protected class MovingAgent.MoveTo
extends Agent.Action

Moves to the given point.


Field Summary
protected  float a
           
protected  float radius
           
protected  int successiveFailures
           
protected  float x
           
protected  float y
           
 
Constructor Summary
MovingAgent.MoveTo(float x, float y, float radius)
           
 
Method Summary
 float step()
          Body of the action.
 
Methods inherited from class sema.Agent.Action
close, firstStep, hasBegun, isDisabled, isPaused, pause, pause, resume, resumedStep, start, start, stop, whenEnd, whenPaused, whenRefused, whenStartInPause, whenStopped
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

a

protected float a

x

protected float x

y

protected float y

radius

protected float radius

successiveFailures

protected int successiveFailures
Constructor Detail

MovingAgent.MoveTo

public MovingAgent.MoveTo(float x,
                          float y,
                          float radius)
Method Detail

step

public float step()
Description copied from class: Agent.Action
Body of the action. This is the main code to execute. The value returned is the time (in simulated units) to wait before the next call to the body. A negative value means that the action must end. The main idea of this function is that its execution is intended to be spread on a time that should be coherent with the simulation.

Typically, a moving agent that is walking would make a step towards a direction then another, and theses steps would be differents calls to step(). Internal variables should be stocked in the action to allow a good step by step execution.

Overrides:
step in class Agent.Action