Boeing Simulation 3.1 API Specification

uavmanager
Class SimulatorUAVManager

java.lang.Object
  |
  +--connect.socket.SocketComponentTemplate
        |
        +--uavmanager.SimulatorUAVManager
All Implemented Interfaces:
Component, UAVManager

public class SimulatorUAVManager
extends SocketComponentTemplate
implements UAVManager

A socket-based implementation of UAVManager that communicates with SimulatorUAV components.

Version:
$Revision: 1.15 $
Author:
James Brodman
, David Jurgens
See Also:
UAV, ucav.SimulatorUCAVManager, ComponentizedSimulator

Field Summary
private  Map idToUAV
          Maps the unique ID of the uav to the ucav itself.
private  int nextID
           
private  Set permittedConnections
          A set containing the class type of all components that are allowed to connect to this component.
private  boolean serverConnected
          Flag indicating the current connection status with the server.
private  util.ConsumerQueue serverQueue
          The queue structure that will hold objects sent by the Server.
private static boolean SHOW_REQUESTS
          Flag indicating whether this class will show the method requests it receives.
private  connect.CreatesConnection toServer
          A link back to the server.
private  Map uavInfoToConnection
           
private  util.SinglePermitMap uavToChannels
          Map linking UAV to ChannelBundle.
 
Fields inherited from class connect.socket.SocketComponentTemplate
portNumber
 
Constructor Summary
SimulatorUAVManager(int port)
           
 
Method Summary
protected  boolean accept(Class requestingType)
          Returns whether this component will accept a connection from the the requesting object of the speicifed type.
protected  boolean allowMethod(util.MethodRequest request)
          Returns true if this component allows the MethodRequest to be invoked upon itself.
private  uav.UAV bind(uav.UAV uavObject)
          Returns the SimulatorUAV associated with this UAVObject.
protected  int getMaxPoints()
          Returns 1 so that a single RelayPoint may be created.
 int getNextConnection()
           
 int getSourceType()
           
 Set getUAVConnections()
          Returns a colletion of all the CreatesConnection objects associated with the connected UAV components.
static void main(String[] args)
           
 void moveUnit(uav.UAV uavObject, objects.Locatable loc)
          Acquires the channel resources for the uav, and then sends a request that the ucav for the uav to begin moving to the location.
private  int nextUAVID()
           
protected  void processAcceptedConnection(Class hostType, connect.ChannelBundle channels)
          When a component connects to the component that it requested the connection to, this method is called.
protected  void processRequestingConnection(connect.ComponentEmissary requesting, connect.ChannelBundle channels)
          All implementers should extends this method to define their behavior when another component connects.
 connect.CreatesConnection provideConnection(uav.UAVInfo uav)
          Returns the CreatesConnection based upon the argument.
 
Methods inherited from class connect.socket.SocketComponentTemplate
connect, getComponentEmissary, getConnection, processRelayPoint, spawnRelayPoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nextID

private int nextID

permittedConnections

private final Set permittedConnections
A set containing the class type of all components that are allowed to connect to this component.


serverConnected

private boolean serverConnected
Flag indicating the current connection status with the server.


serverQueue

private util.ConsumerQueue serverQueue
The queue structure that will hold objects sent by the Server.


SHOW_REQUESTS

private static final boolean SHOW_REQUESTS
Flag indicating whether this class will show the method requests it receives.

See Also:
Constant Field Values

toServer

private connect.CreatesConnection toServer
A link back to the server.


idToUAV

private final Map idToUAV
Maps the unique ID of the uav to the ucav itself.


uavInfoToConnection

private final Map uavInfoToConnection

uavToChannels

private final util.SinglePermitMap uavToChannels
Map linking UAV to ChannelBundle. A single permit map is used to control access to a ucav between threads.

Constructor Detail

SimulatorUAVManager

public SimulatorUAVManager(int port)
Method Detail

getSourceType

public int getSourceType()

accept

protected boolean accept(Class requestingType)
Description copied from class: SocketComponentTemplate
Returns whether this component will accept a connection from the the requesting object of the speicifed type.

Specified by:
accept in class SocketComponentTemplate

allowMethod

protected boolean allowMethod(util.MethodRequest request)
Description copied from class: SocketComponentTemplate
Returns true if this component allows the MethodRequest to be invoked upon itself.

Specified by:
allowMethod in class SocketComponentTemplate

bind

private uav.UAV bind(uav.UAV uavObject)
Returns the SimulatorUAV associated with this UAVObject. This method is necessary to bind the Server representation of the UAV to the ComponentizedSimulator representation of the object. The UAVManager can only communicate with the simulator version of the object. Note that this method looks for the SimulatorUAV that is closest to the UAVObject.


getMaxPoints

protected int getMaxPoints()
Returns 1 so that a single RelayPoint may be created.

Overrides:
getMaxPoints in class SocketComponentTemplate
See Also:
SocketComponentTemplate.spawnRelayPoint(int)

getNextConnection

public int getNextConnection()

getUAVConnections

public Set getUAVConnections()
Description copied from interface: UAVManager
Returns a colletion of all the CreatesConnection objects associated with the connected UAV components.

Specified by:
getUAVConnections in interface UAVManager

moveUnit

public void moveUnit(uav.UAV uavObject,
                     objects.Locatable loc)
Acquires the channel resources for the uav, and then sends a request that the ucav for the uav to begin moving to the location. Requests are not guaranteed to finish, due to a movement request being interruptable by another movement request.


provideConnection

public connect.CreatesConnection provideConnection(uav.UAVInfo uav)
Description copied from interface: UAVManager
Returns the CreatesConnection based upon the argument.

Specified by:
provideConnection in interface UAVManager

processAcceptedConnection

protected void processAcceptedConnection(Class hostType,
                                         connect.ChannelBundle channels)
Description copied from class: SocketComponentTemplate
When a component connects to the component that it requested the connection to, this method is called.

Specified by:
processAcceptedConnection in class SocketComponentTemplate

processRequestingConnection

protected void processRequestingConnection(connect.ComponentEmissary requesting,
                                           connect.ChannelBundle channels)
Description copied from class: SocketComponentTemplate
All implementers should extends this method to define their behavior when another component connects.

Specified by:
processRequestingConnection in class SocketComponentTemplate

nextUAVID

private int nextUAVID()

main

public static void main(String[] args)

Boeing Simulation 3.1 API Specification

To submit a bug or feature email the author of that class. Funding for this research was provided by Boeing and DARPA.