modelling
Class EatableAgent
java.lang.Object
sema.Element
sema.Agent
modelling.EatableAgent
- All Implemented Interfaces:
- java.lang.Comparable, Eatable
- public class EatableAgent
- extends Agent
- implements Eatable
Agent eatable, and giving amongs of food.
|
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. |
| 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 |
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.
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