|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.ObjectsimuLCS.Entity
simuLCS.Arena
The Circular Arena
| Field Summary | |
private java.awt.Graphics2D |
graphics
|
private int |
shift
|
private static int |
sizeGrad
|
| Fields inherited from class simuLCS.Entity |
color_ext, color_int, coord, generator, name, paintName, size |
| Constructor Summary | |
Arena(int s,
int sh)
|
|
| Method Summary | |
java.awt.geom.Point2D |
closestPointTo(java.awt.geom.Point2D p)
Returns the point of the arena which is the closest to p. |
java.awt.geom.Point2D |
closestPointTo(java.awt.geom.Point2D p,
double radiusArenaToConsider)
Gives the closest point of the Wall to a given point |
boolean |
collideWithMe(Agent a)
Returns true if Agent a collides with the Arena |
double |
distanceTo(java.awt.geom.Point2D p)
Calculates the distance between a point and the arena |
java.awt.geom.Point2D |
getCoordNearTo(Entity otherEntity)
For the arena, the coordinates used to get the vector are the coordinates of the closest point of the arena |
double |
getRadius()
|
double |
getRadiusBody()
|
int |
getShift()
|
boolean |
isDangerous()
By convention, the Arena is dangerous. |
boolean |
isInside(double x,
double y,
double radiusBody)
Returns true if the circle whose center is the point (x,y) and whose radius is radiusBody is colliding with the Arena |
boolean |
isMoving()
Should be defined by subclasses |
void |
linkGraphics(java.awt.Graphics2D g)
|
void |
move(Arena a,
Entity[] others,
int nbagents,
java.awt.Graphics2D g)
The Arena does not move. |
void |
paint(java.awt.Graphics2D g)
Paints the Arena and the ticks around |
private void |
paintTimeSteps(java.awt.Graphics2D g,
int timeSteps)
|
void |
paintWithTimeSteps(java.awt.Graphics2D g,
int timeSteps)
Paint the Arena with the indication of the Time Steps |
| Methods inherited from class simuLCS.Entity |
clear, getColor_ext, getColor_int, getCoord, getId, getName, getSize, isPaintName, setColor_ext, setColor_int, setName, setPaintName, setSize, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private static final int sizeGrad
private java.awt.Graphics2D graphics
private int shift
| Constructor Detail |
public Arena(int s,
int sh)
| Method Detail |
public void linkGraphics(java.awt.Graphics2D g)
g - public void paint(java.awt.Graphics2D g)
paint in class Entity
private void paintTimeSteps(java.awt.Graphics2D g,
int timeSteps)
public void paintWithTimeSteps(java.awt.Graphics2D g,
int timeSteps)
g - timeSteps - public double getRadius()
public double getRadiusBody()
getRadiusBody in class Entitypublic int getShift()
public boolean isInside(double x,
double y,
double radiusBody)
radiusBody is colliding with the Arena
x - y - radiusBody -
public boolean collideWithMe(Agent a)
collideWithMe in class Entitya -
public double distanceTo(java.awt.geom.Point2D p)
distanceTo in class Entityp - Point inside the arena
public java.awt.geom.Point2D closestPointTo(java.awt.geom.Point2D p,
double radiusArenaToConsider)
p - radiusArenaToConsider -
public java.awt.geom.Point2D closestPointTo(java.awt.geom.Point2D p)
p - the point2D
public java.awt.geom.Point2D getCoordNearTo(Entity otherEntity)
getCoordNearTo in class Entitypublic boolean isDangerous()
isDangerous in class Entitypublic boolean isMoving()
Entity
isMoving in class Entity
public void move(Arena a,
Entity[] others,
int nbagents,
java.awt.Graphics2D g)
move in class Entitya - The Arena inside which to moveg - GraphicsEntity.move(Arena,Entity[], int, java.awt.Graphics2D)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||