|
Boeing Simulation 3.1 API Specification | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--objects.WhatWhere
|
+--objects.MovableWhatWhere
|
+--worldsimulator.SimulatorUAV
This class simulates a UAV based on the data pushed to it by the Simulator. It also has events that it fires so that registered listeners can know what it is doing.
| Field Summary | |
private static boolean |
DEBUG
Debug flag. |
protected static double |
DISTANCE_PER_PERIOD
The maximum percentage of the world that the UAV can move in one update cycle. |
private objects.Locatable |
goal
The location where this UAV will attept to go towards. |
private Long |
id
The unique ID used to distinguish this UAV from another UAV. |
private util.Queue |
imageQueue
The queue that will hold the UAVImage objects that the
ComponentizedSimulator will push to this
class. |
private connect.ChannelBundle |
managerChannels
The channels over which this UAV will communicate with
the uav.UAVManager. |
private int |
num
|
private connect.ChannelBundle |
objectLocater
The channels over which this UAV will communicate
with the ObjectLocater. |
private static long |
serialVersionUID
|
private connect.ChannelBundle |
simulatorChannels
The channels over which this UAV will communicate
with the ComponentizedSimulator. |
private util.ConsumerQueue |
simulatorQueue
The multithreaded queue for reading in objects from the server. |
private boolean |
started
Internal flag to make sure that a UAV is not started twice. |
protected static long |
STEP_COST
The time in milliseconds in which at step method can start and finish its execution. |
protected static objects.Dimension |
UAV_DIM
The default dimensions of the UAV |
private static int |
uavNum
|
protected static long |
UPDATE_PERIOD
The time in milliseconds at which this UCAV will update it's movement. |
protected static double |
VIEWING_RADIUS
The radius in which a UAV can see other objects. |
| Fields inherited from class objects.WhatWhere |
dim, loc |
| Constructor Summary | |
SimulatorUAV(connect.CreatesConnection toUAVManager,
connect.CreatesConnection toSimulator)
Constructs this object with a random location. |
|
SimulatorUAV(objects.Location loc,
connect.CreatesConnection toUAVManager,
connect.CreatesConnection toSimulator)
|
|
| Method Summary | |
protected boolean |
allowMethod(util.MethodRequest request)
Returns true due to undefined behavior at this point. |
void |
connect(connect.CreatesConnection host)
Connects to an ObjectLocater and then
continuously writes out UAVImage objects from the
imageQueue. |
private void |
debug(String msg)
|
boolean |
equals(Object other)
Returns true if the object is a SimulatorUAV and has the same ID value. |
connect.CreatesConnection |
getConnection()
Returns null because no connection is allowed. |
objects.Locatable |
getGoal()
|
long |
getID()
Returns the unique ID for this UAV. |
worldsimulator.SimulatorUAV |
getUAV()
Returns an instance of this. |
double |
getViewingRadius()
Returns the distance on the unit square within which this UAV is able to see other objects. |
int |
hashCode()
Returns the hash code based on its ID. |
private void |
receiveImage(uav.UAVImage image)
|
void |
run()
Calls the periodic step function. |
void |
setGoal(objects.Locatable loc)
Sets the goal toward which this object will move. |
void |
startPeriodicMovements()
Starts the Thread that will periodically move this UAV. |
void |
startProcessingThread()
Processes MethodRequest objects that are sent to
this object. |
void |
step()
Contacts the simulator for information regard what the UAV can see. |
String |
toString()
|
| Methods inherited from class objects.MovableWhatWhere |
setLoc, setLoc |
| Methods inherited from class objects.WhatWhere |
bound, getCenter, getDimensions, getDistance, getHeight, getLoc, getWidth, isEastOf, isNorthOf, isSouthOf, isWestOf, overlaps |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface objects.Movable |
setLoc, setLoc |
| Methods inherited from interface objects.Locatable |
getDistance, getLoc, isEastOf, isNorthOf, isSouthOf, isWestOf |
| Field Detail |
private static final long serialVersionUID
private final transient util.Queue imageQueue
UAVImage objects that the
ComponentizedSimulator will push to this
class.
private transient connect.ChannelBundle managerChannels
UAV will communicate with
the uav.UAVManager.
private transient connect.ChannelBundle simulatorChannels
UAV will communicate
with the ComponentizedSimulator.
private transient connect.ChannelBundle objectLocater
UAV will communicate
with the ObjectLocater.
private objects.Locatable goal
protected static final objects.Dimension UAV_DIM
protected static final double VIEWING_RADIUS
UAV can see other objects. These
UAVs need an idea of what they can see. So the Simulator needs
to look at where they are and then fill in what they're seeing
based on what is within the VIEWING_RADIUS.
protected static final double DISTANCE_PER_PERIOD
protected static final long UPDATE_PERIOD
protected static final long STEP_COST
private static final boolean DEBUG
private final Long id
private boolean started
private transient util.ConsumerQueue simulatorQueue
private static int uavNum
private final int num
| Constructor Detail |
public SimulatorUAV(connect.CreatesConnection toUAVManager,
connect.CreatesConnection toSimulator)
public SimulatorUAV(objects.Location loc,
connect.CreatesConnection toUAVManager,
connect.CreatesConnection toSimulator)
| Method Detail |
private void receiveImage(uav.UAVImage image)
public void startProcessingThread()
MethodRequest objects that are sent to
this object.
public void connect(connect.CreatesConnection host)
ObjectLocater and then
continuously writes out UAVImage objects from the
imageQueue.
connect in interface Componentpublic objects.Locatable getGoal()
public final void run()
run in interface Runnablestep()public void setGoal(objects.Locatable loc)
public void step()
UAVImage and enqueued. The processing threads
dequeue this information and write it to the ObjectLocater.
public void startPeriodicMovements()
ThreadFactory,
WorkerThread,
RTWorkerThread,
Ceaseableprotected boolean allowMethod(util.MethodRequest request)
public connect.CreatesConnection getConnection()
getConnection in interface Componentpublic double getViewingRadius()
UAV
getViewingRadius in interface UAVpublic long getID()
UAV
getID in interface UAVpublic boolean equals(Object other)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic worldsimulator.SimulatorUAV getUAV()
ComponentizedSimulator.
public String toString()
toString in class Objectprivate void debug(String msg)
|
Boeing Simulation 3.1 API Specification | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||