simbad.sim
Class Agent

java.lang.Object
  extended bysimbad.sim.BaseObject
      extended bysimbad.sim.SimpleAgent
          extended bysimbad.sim.Agent
Direct Known Subclasses:
AvoidersDemo.Robot, BaseDemo.Robot, BlinkingLampDemo.Robot, BumpersDemo.Robot, DifferentialKinematicDemo.Robot, KheperaRobot, PickCherriesDemo.Robot, PushBallsDemo.Robot, Robot, SimplestDemo.Robot, SingleAvoiderDemo.Robot, Test.Robot, Test2.Robot, TestBackgroundMode.MyRobot, TestSimbatch.MyRobot

public class Agent
extends SimpleAgent

This is the base class for all robot and is considered to be a heavy agent.
When deriving a new robot's class from this class, one should override the following methods:

* Implementation note : the agent doesnt have synchronized methods. All thread refering to the agent should do explicit synchronization with synchronized(agent){...}.


Constructor Summary
Agent(javax.vecmath.Vector3d pos, java.lang.String name)
          Constructs an Agent.
 
Method Summary
 java.lang.String asString()
          Returns printable description of the agent.
 AgentInspector getAgentInspector()
           
 double getOdometer()
          Returns the agent's odometer in meters.
 double getRotationalVelocity()
          Gets rotational velocity in radians per second
 double getTranslationalVelocity()
          Gets translational velocity in meter per second.
 javax.swing.JPanel getUIPanel()
          Returns the UI panel previously set with setUIPanel
 void setAgentInspector(AgentInspector ai)
           
 void setRotationalVelocity(double rv)
          Sets rotational velocity in radians per second.
 void setTranslationalVelocity(double tv)
          Sets translational velocity in meter per second.
 void setUIPanel(javax.swing.JPanel panel)
          Add a UI panel to the agent.
 
Methods inherited from class simbad.sim.SimpleAgent
anOtherAgentIsVeryNear, attach, collisionDetected, detach, getActuatorDevice, getActuatorList, getCanBeTraversed, getCoords, getCounter, getHeight, getLifeTime, getMass, getName, getRadius, getRotationTransform, getSensorDevice, getSensorList, getTranslationTransform, getVeryNearAgent, interactionDetected, moveToStartPosition, rotateY, setCanBeTraversed, setColor, translateTo
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Agent

public Agent(javax.vecmath.Vector3d pos,
             java.lang.String name)
Constructs an Agent.

Parameters:
pos - start position in 3D world.
name - name of the agent.
Method Detail

getOdometer

public double getOdometer()
Returns the agent's odometer in meters.

Returns:
the agent odometer in meters.

setRotationalVelocity

public final void setRotationalVelocity(double rv)
Sets rotational velocity in radians per second.


setTranslationalVelocity

public final void setTranslationalVelocity(double tv)
Sets translational velocity in meter per second.


getRotationalVelocity

public final double getRotationalVelocity()
Gets rotational velocity in radians per second


getTranslationalVelocity

public final double getTranslationalVelocity()
Gets translational velocity in meter per second.


setUIPanel

public void setUIPanel(javax.swing.JPanel panel)
Add a UI panel to the agent. Typically used for displaying behavior outputs. A call to this method will have for consequence the creation of a dedicated window.

Parameters:
panel -

getUIPanel

public javax.swing.JPanel getUIPanel()
Returns the UI panel previously set with setUIPanel

Returns:
the panel

getAgentInspector

public AgentInspector getAgentInspector()

setAgentInspector

public void setAgentInspector(AgentInspector ai)

asString

public java.lang.String asString()
Returns printable description of the agent.

Overrides:
asString in class SimpleAgent
Returns:
agent description as string.