|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectsema.Element
sema.Agent
modelling.SeeingAgent
Agent able to watch his environement.
| 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 | |
SeeingAgent(World world,
Area area,
float delay,
java.awt.Image image,
float visionRadius)
Creates a new instance of seeing agent. |
|
| Method Summary | |
boolean |
canSee(Element element)
Determinates whether the given element can be seen by our agent, according to |
protected Area |
getAreaOfVision()
Determinates the area where the element is watching. |
protected Area |
getLineVision(float angle)
|
java.lang.String |
getName()
Returns the name. |
protected float |
getVisionRadius()
Returns the vision radius of the element. |
java.util.Vector |
watch()
Returns the visible elements, with the restrictions of the vision ability. |
java.util.Vector |
watchFor(Selector sel)
Returns the nearest element responding to the criterium induced by the given Selector in the vision field of the agent. |
Element |
watchForNearest(Selector sel)
Returns the nearest visible element fiting the given selector. |
Element |
watchNearest()
Returns the nearest visible element |
| 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, 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 |
public SeeingAgent(World world,
Area area,
float delay,
java.awt.Image image,
float visionRadius)
| Method Detail |
public java.lang.String getName()
Element
getName in class Elementprotected float getVisionRadius()
protected Area getAreaOfVision()
protected Area getLineVision(float angle)
public boolean canSee(Element element)
canSee in interface Visionpublic java.util.Vector watch()
watch in interface Visionpublic Element watchNearest()
watchNearest in interface Visionpublic java.util.Vector watchFor(Selector sel)
watchFor in interface Visionpublic Element watchForNearest(Selector sel)
watchForNearest in interface Vision
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||