All Packages Class Hierarchy This Package Previous Next Index
Class EDU.gatech.cc.is.simulation.AttractorSim
java.lang.Object
|
+----EDU.gatech.cc.is.simulation.AttractorSim
- public class AttractorSim
- extends Object
- implements SimulatedObject
A simple attractor for simulation.
Copyright
(c)1997 Georgia Tech Research Corporation
- Version:
- $Revision: 1.5 $
- Author:
- Tucker Balch
-
all_objects
-
-
bottom
-
-
DEBUG
-
-
deposited
-
-
foreground
-
-
left
-
-
position
-
-
RADIUS
-
-
rando
-
-
right
-
-
seed
-
-
top
-
-
unique_id
-
-
visionclass
-
-
AttractorSim()
- Instantiate an AttractorSim object.
-
clearTrail()
- Clear the trail.
-
draw(Graphics, int, int, double, double, double, double)
- Draw the attractor.
-
draw(Vec2, Graphics, int, int, double, double, double, double)
- Draw the object in a specific spot.
-
drawID(Graphics, int, int, double, double, double, double)
- Draw the attractor's ID.
-
drawState(Graphics, int, int, double, double, double, double)
- Draw the attractor's State.
-
drawTrail(Graphics, int, int, double, double, double, double)
- Draw the attractor's Trail.
-
getCenter(Vec2)
-
-
getClosestPoint(Vec2)
-
-
getID()
-
-
getPosition()
-
-
getVisionClass()
-
-
init(double, double, double, double, Color, Color, int, int, long)
- Initialize an AttractorSim object.
-
isObstacle()
-
-
isPickupable()
-
-
isPushable()
-
-
pickUp(SimulatedObject)
-
-
push(Vec2, Vec2)
-
-
putDown(Vec2)
-
-
quit()
-
-
receive(Message)
-
-
setID(int)
-
-
setTrailLength(int)
- Set the length of the trail (in movement steps).
-
setVisionClass(int)
-
-
takeStep(long, SimulatedObject[])
- Take a simulated step;
position
protected Vec2 position
foreground
protected Color foreground
all_objects
protected SimulatedObject all_objects[]
visionclass
protected int visionclass
unique_id
protected int unique_id
RADIUS
protected double RADIUS
top
protected double top
bottom
protected double bottom
left
protected double left
right
protected double right
deposited
protected boolean deposited
seed
protected long seed
rando
protected Random rando
DEBUG
public static final boolean DEBUG
AttractorSim
public AttractorSim()
- Instantiate an AttractorSim object. Be sure
to also call Init with proper values.
- See Also:
- init
init
public void init(double xp,
double yp,
double t,
double r,
Color f,
Color b,
int v,
int i,
long s)
- Initialize an AttractorSim object.
Called automatically by JavaBotSim.
- Parameters:
- xp - the x coordinate.
- yp - the y coordinate.
- t - ingored.
- r - the radius.
- f - the foreground color.
- b - ignored.
- v - the vision class.
- i - the unique id.
- s - random number seed.
takeStep
public void takeStep(long time_increment,
SimulatedObject all_objs[])
- Take a simulated step;
isObstacle
public boolean isObstacle()
isPushable
public boolean isPushable()
isPickupable
public boolean isPickupable()
receive
public void receive(Message m)
getClosestPoint
public Vec2 getClosestPoint(Vec2 from)
getPosition
public Vec2 getPosition()
getCenter
public Vec2 getCenter(Vec2 from)
push
public void push(Vec2 d,
Vec2 v)
pickUp
public void pickUp(SimulatedObject o)
putDown
public void putDown(Vec2 p)
setVisionClass
public void setVisionClass(int v)
getVisionClass
public int getVisionClass()
setID
public void setID(int i)
getID
public int getID()
quit
public void quit()
drawID
public void drawID(Graphics g,
int w,
int h,
double t,
double b,
double l,
double r)
- Draw the attractor's ID.
drawState
public void drawState(Graphics g,
int w,
int h,
double t,
double b,
double l,
double r)
- Draw the attractor's State.
setTrailLength
public void setTrailLength(int l)
- Set the length of the trail (in movement steps).
Non-robots can ignore this.
- Parameters:
- l - int, the length of the trail.
clearTrail
public void clearTrail()
- Clear the trail.
Non-robots can ignore this.
drawTrail
public void drawTrail(Graphics g,
int w,
int h,
double t,
double b,
double l,
double r)
- Draw the attractor's Trail.
draw
public void draw(Graphics g,
int w,
int h,
double t,
double b,
double l,
double r)
- Draw the attractor.
draw
public void draw(Vec2 pos,
Graphics g,
int w,
int h,
double t,
double b,
double l,
double r)
- Draw the object in a specific spot.
All Packages Class Hierarchy This Package Previous Next Index