|
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 | +--worldsimulator.ComponentizedSimulator
This version of the simulator model is designed to use
components models of the objects and to directly interact with
UAVs and UCAVs via ChannelBundles. This class is designed to act as a
representation of the world. In implementaiton, it looks
strikingly like a server model. Mutation is done internally
through MethodRequest objects. Only appropriate
objects are allowed to change the simulation state via internal
method calls.
Server,
SimulatorComponentGenerator,
SimulatorUCAV,
SimulatorUAV,
SocketSimulatorComponentTemplate| Nested Class Summary | |
private static class |
ComponentizedSimulator.ThreadSafeBundle
A multi-threaded bundle class that wraps a supplier channel for writing and a consumer queue for reading in values. |
| Field Summary | |
private static int |
BUS
Identification constant. |
private static boolean |
DEBUG
|
protected PropertyChangeSupport |
locationUpdates
The bean to notify listeners of changes in the locations of any object in the simulator. |
private static int |
OBJECT_DESTROY_TIME
The amount of time in milliseconds for which an object will be included in the list of world objects as a destroyed object prior to its removal from the list. |
protected Map |
objectBundles
A mapping of WhatWheres to the ChannelBundle which can be used to communicate. |
protected Set |
objects
A mapping of Buses to Locations. |
private static int |
OTHER
Identification constant. |
private static int |
SCHOOL
Identification constant. |
static int |
SIMULATOR_PORT
The port on which the simulator listens for connections. |
protected ServerSocket |
ss
The server socket over which all communication is initially done. |
private static int |
TANK
Identification constant. |
private static int |
UAV
Identification constant. |
protected Map |
uavBundles
A mapping of UAVs to the ChannelBundle which can be used to communicate. |
protected Set |
uavs
A mapping of UAVs to Locations. |
private static int |
UCAV
Identification constant. |
protected Map |
ucavBundles
A mapping of UCAVs to the ChannelBundle which can be used to communicate. |
protected Set |
ucavs
A mapping of UCAVs to Locations. |
| Constructor Summary | |
ComponentizedSimulator()
|
|
| Method Summary | |
protected boolean |
allowMethod(util.MethodRequest request)
Returns true if the simulator allows the request to be invoked. |
private int |
bound(double x)
|
private void |
debug(String s)
|
Set |
getConnectableObjects()
Returns the Set of objects that implement the Component interface thereby allowing other
Component objects to connect to them. |
private world.WorldState |
getCurrentState()
Returns a WorldState that represent the true positions of all the objects in the simulation. |
private Map |
getImageMap(objects.Location loc,
double viewingRadius)
Returns an int array that contains a marking of all objects visible with the viewing radius from the provided location. |
worldsimulator.SimulatorImage |
getSimulatorImage(uav.UAV uav)
For the UAV, determine its viewing radius, and then
construct a SimulatorImage based on its location. |
worldsimulator.SimulatorImage |
getSimulatorImage(ucav.UCAV ucav)
|
private int |
getType(Class c)
Returns the indentifier tag for an object of the given class. |
protected void |
handleIncomingConnection(Socket s)
Starts a new Thread to set up the created ChannelBundle objects. |
static void |
main(String[] args)
|
void |
notifyBombDrop(ucav.UCAV ucav)
Checks to see if an object has been destroyed and then removes it from the listing. |
protected void |
processObject(connect.ChannelBundle bundle)
Starts threads to read and write objects to and from this WhatWhere |
protected void |
processUAV(connect.ChannelBundle bundle)
Starts a Thread to read and write objects to and from this UAV |
protected void |
processUCAV(connect.ChannelBundle bundle)
Starts threads to read and write objects to and from this UCAV |
protected void |
processVisualizer(connect.ChannelBundle channels)
Adds a PropertyChangeListener for updates in
the current WorldState and then writes out the
new value upon update. |
void |
run()
Listens for incoming connections from objects, uavs and ucavs. |
void |
startDestroyThread(objects.Destroyable t)
Begins a thread that firsts destroys the object in question and then removes it from the list of known objects after a set period of time. |
void |
updateObjectLocation(objects.WhatWhere w)
Updates the location of the WhatWhere. |
void |
updateUAVLocation(uav.UAV uav)
Updates the location of the uav. |
void |
updateUCAVLocation(ucav.UCAV ucav)
Updates the location of the ucav. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int SIMULATOR_PORT
protected final transient Set uavs
UAVs to Locations.
protected final transient Set ucavs
UCAVs to Locations.
protected final transient Set objects
Buses to Locations.
protected final transient Map uavBundles
UAVs to the ChannelBundle which can be used to communicate.
protected final transient Map ucavBundles
UCAVs to the ChannelBundle which can be used to communicate.
protected final transient Map objectBundles
WhatWheres to the ChannelBundle which can be used to communicate.
protected final transient ServerSocket ss
protected final transient PropertyChangeSupport locationUpdates
private static final boolean DEBUG
private static final int TANK
private static final int BUS
private static final int SCHOOL
private static final int UAV
private static final int UCAV
private static final int OTHER
private static final int OBJECT_DESTROY_TIME
| Constructor Detail |
public ComponentizedSimulator()
| Method Detail |
protected boolean allowMethod(util.MethodRequest request)
private void debug(String s)
protected void handleIncomingConnection(Socket s)
Thread to set up the created ChannelBundle objects.
protected void processUAV(connect.ChannelBundle bundle)
UAV
protected void processUCAV(connect.ChannelBundle bundle)
UCAV
protected void processObject(connect.ChannelBundle bundle)
WhatWhere
protected void processVisualizer(connect.ChannelBundle channels)
PropertyChangeListener for updates in
the current WorldState and then writes out the
new value upon update.
public Set getConnectableObjects()
Component interface thereby allowing other
Component objects to connect to them. This set will
include zero or more of the following types of components:
SimulatorTank, SimulatorBus, and SimulatorSchool.
TargetControlpublic void run()
public void updateUAVLocation(uav.UAV uav)
public void updateUCAVLocation(ucav.UCAV ucav)
public void updateObjectLocation(objects.WhatWhere w)
private world.WorldState getCurrentState()
PerspectiveUnifier,
Server.currentStatepublic void notifyBombDrop(ucav.UCAV ucav)
public void startDestroyThread(objects.Destroyable t)
public worldsimulator.SimulatorImage getSimulatorImage(uav.UAV uav)
UAV, determine its viewing radius, and then
construct a SimulatorImage based on its location.
UAVImagepublic worldsimulator.SimulatorImage getSimulatorImage(ucav.UCAV ucav)
private Map getImageMap(objects.Location loc,
double viewingRadius)
private int bound(double x)
private int getType(Class c)
public static void main(String[] args)
|
Boeing Simulation 3.1 API Specification | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||