simulator
Class RobotAgent

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--simulator.Agent
              |
              +--simulator.RobotAgent

class RobotAgent
extends simulator.Agent

Execute the task of the robot pushing bar


Field Summary
 int actionType
          Type of action to performe (-1=reduce vel.,1=add velocity)
(package private)  Position actualPos
          Contains actual position of the mass robot center
(package private)  Position actualVel
          Contains actual velocity of the mass robot center
(package private)  simulator.Queue[] agentQueue
          tile where change message with server
 double alfa
          angle to turn when behavior of second sensor is active
static double alfaMax
          Max angle to turn when we have max force in second sensor
static double alfaMin
          Min angle to turn when we have min force in second sensor
(package private)  double angle
          Contains angle rotation about x axle (but is the same of the y axle and the perpendicular of the bar)
static double epsForce1
          Min variation of force in first sensor that activate behavior
static double epsForce2
          Min force of second sensor that activate behavior
static double epsGoal
          Max error that we want for achieving goal
static double epsNearGoal
          Min distance for robot and goal that is to considerate near
(package private)  double force1
          Force that sensor 1 support (in Newton)
static double force1Max
          Max delta force of first sensor for changing velocity
static double force1Min
          Min delta force of first sensor for changing velocity
(package private)  double force2
          Force that sensor 2 support (in Newton)
static double force2Max
          Max force of second sensor use for turning with max angle
static double force2Min
          Min force of second sensor use for turning with min angle
(package private)  Position goal
          Contains goal position of the mass robot center
(package private)  double goalAngle
          Contains final angle rotation about x axle
(package private)  int I
          Progressive identifier for robot (must be 1,2,...)
(package private)  java.lang.String name
          Name of the agent
(package private)  OldValue old
          A sliding window of old value
(package private)  double old1
          Force that sensor 1 was supporting previus time
(package private)  double old2
          Force that sensor 2 was supporting previus time
static double Vmax
          Max velocity for the robot
static double Vmin
          Min velocity for the robot
static double Vnom
          Nominal velocity for the robot
static double Vperc
          Percentual of velocity to slowly readapt toward Vnom
 
Fields inherited from class java.lang.Thread
contextClassLoader, daemon, eetop, group, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadQ, values
 
Constructor Summary
RobotAgent(int i, java.lang.String name, Position p, double a, Position g, double ga, simulator.Queue[] pq, int ct)
          Initilize actual position and goal position of the robot agent
 
Method Summary
 void run()
          Executes behavior-based stategy for the robot
 
Methods inherited from class java.lang.Thread
, activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, exit, getContextClassLoader, getName, getPriority, getThreadGroup, init, interrupt, interrupt0, interrupted, isAlive, isDaemon, isInterrupted, isInterrupted, join, join, join, nextThreadNum, registerNatives, resume, resume0, setContextClassLoader, setDaemon, setName, setPriority, setPriority0, sleep, sleep, start, stop, stop, stop0, suspend, suspend0, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

actualVel

Position actualVel
Contains actual velocity of the mass robot center

actualPos

Position actualPos
Contains actual position of the mass robot center

goal

Position goal
Contains goal position of the mass robot center

angle

double angle
Contains angle rotation about x axle (but is the same of the y axle and the perpendicular of the bar)

goalAngle

double goalAngle
Contains final angle rotation about x axle

agentQueue

simulator.Queue[] agentQueue
tile where change message with server

I

int I
Progressive identifier for robot (must be 1,2,...)

name

java.lang.String name
Name of the agent

force1

double force1
Force that sensor 1 support (in Newton)

force2

double force2
Force that sensor 2 support (in Newton)

old1

double old1
Force that sensor 1 was supporting previus time

old2

double old2
Force that sensor 2 was supporting previus time

Vmin

public static final double Vmin
Min velocity for the robot

Vnom

public static final double Vnom
Nominal velocity for the robot

Vmax

public static final double Vmax
Max velocity for the robot

Vperc

public static final double Vperc
Percentual of velocity to slowly readapt toward Vnom

epsGoal

public static final double epsGoal
Max error that we want for achieving goal

epsNearGoal

public static final double epsNearGoal
Min distance for robot and goal that is to considerate near

epsForce1

public static final double epsForce1
Min variation of force in first sensor that activate behavior

epsForce2

public static final double epsForce2
Min force of second sensor that activate behavior

alfaMax

public static final double alfaMax
Max angle to turn when we have max force in second sensor

alfaMin

public static final double alfaMin
Min angle to turn when we have min force in second sensor

alfa

public double alfa
angle to turn when behavior of second sensor is active

force2Max

public static final double force2Max
Max force of second sensor use for turning with max angle

force2Min

public static final double force2Min
Min force of second sensor use for turning with min angle

force1Max

public static final double force1Max
Max delta force of first sensor for changing velocity

force1Min

public static final double force1Min
Min delta force of first sensor for changing velocity

actionType

public int actionType
Type of action to performe (-1=reduce vel.,1=add velocity)

old

OldValue old
A sliding window of old value
Constructor Detail

RobotAgent

public RobotAgent(int i,
                  java.lang.String name,
                  Position p,
                  double a,
                  Position g,
                  double ga,
                  simulator.Queue[] pq,
                  int ct)
Initilize actual position and goal position of the robot agent
Parameters:
i - the identifier for the agent (must be 1,2,...)
name - the name of agent
p - the actual position
a - the angle
g - the goal position
ga - the goal angle
pq - the queue for changing messages
ct - the type of control for behavior that reduce force2
Method Detail

run

public void run()
Executes behavior-based stategy for the robot
Overrides:
run in class java.lang.Thread