modelling
Class EatableAgent

java.lang.Object
  extended bysema.Element
      extended bysema.Agent
          extended bymodelling.EatableAgent
All Implemented Interfaces:
java.lang.Comparable, Eatable

public class EatableAgent
extends Agent
implements Eatable

Agent eatable, and giving amongs of food.


Nested Class Summary
 
Nested classes inherited from class sema.Agent
Agent.Action
 
Nested classes inherited from class sema.Element
Element.ElementEvent
 
Field Summary
 
Fields inherited from class sema.Element
id, world
 
Constructor Summary
EatableAgent(World world, Area area, float delay, java.awt.Image image)
          Creates a new instance of eatable agent with the same arguments than an agent.
 
Method Summary
 boolean canEat(Element element)
          Determinates if the agent may eat it by the given agent.
protected  void decreaseNutritiveReserves(float decreaseValue)
           
 float eaten(Agent agent)
          Returns the among of food get.
 float getNutritiveReserves()
          Returns the quantity of food remaining.
protected  void setNutritiveReserves(float newValue)
           
 
Methods inherited from class sema.Agent
acceptAction, getDelay, registerAction, setDelay, unregisterAction
 
Methods inherited from class sema.Element
canTake, compareTo, death, draw, getArea, getDrawingPriority, getHeight, getIcon, getImage, getKind, getName, getProperties, highlight, highlight, isMarked, kill, setDrawingPriority, setHeight, setKind, setMarked, setProperties, toString, union
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EatableAgent

public EatableAgent(World world,
                    Area area,
                    float delay,
                    java.awt.Image image)
Creates a new instance of eatable agent with the same arguments than an agent.

Method Detail

getNutritiveReserves

public float getNutritiveReserves()
Description copied from interface: Eatable
Returns the quantity of food remaining.

Specified by:
getNutritiveReserves in interface Eatable

setNutritiveReserves

protected void setNutritiveReserves(float newValue)

decreaseNutritiveReserves

protected void decreaseNutritiveReserves(float decreaseValue)

canEat

public boolean canEat(Element element)
Determinates if the agent may eat it by the given agent.

Specified by:
canEat in interface Eatable

eaten

public float eaten(Agent agent)
Returns the among of food get.

Specified by:
eaten in interface Eatable