modelling
Class GrowingAgent.Growing

java.lang.Object
  extended bysema.Agent.Action
      extended bymodelling.GrowingAgent.Growing
Enclosing class:
GrowingAgent

protected class GrowingAgent.Growing
extends Agent.Action

Action of growing. Works by steps of growing by 1.1;


Field Summary
 float reachableSize
           
 float timeToGrow
           
 
Constructor Summary
GrowingAgent.Growing(float reachableSize, float timeToGrow)
           
 
Method Summary
 float getSize()
          Returns the current size.
protected  boolean rescaleSize(float a)
          Fonction of growing.
protected  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

reachableSize

public final float reachableSize

timeToGrow

public final float timeToGrow
Constructor Detail

GrowingAgent.Growing

public GrowingAgent.Growing(float reachableSize,
                            float timeToGrow)
Method Detail

getSize

public float getSize()
Returns the current size.


rescaleSize

protected boolean rescaleSize(float a)
Fonction of growing.


step

protected 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