modelling
Class EatingAgent.Consuming

java.lang.Object
  extended bysema.Agent.Action
      extended bymodelling.EatingAgent.Consuming
Enclosing class:
EatingAgent

protected class EatingAgent.Consuming
extends Agent.Action

Action making the hunger regulary increase.


Constructor Summary
EatingAgent.Consuming(float delay, float among)
           
 
Method Summary
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
 

Constructor Detail

EatingAgent.Consuming

public EatingAgent.Consuming(float delay,
                             float among)
Method Detail

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