Contents | Package | Class | Tree | Deprecated | Index | Help
PREV | NEXT SHOW LISTS | HIDE LISTS

Class mil.navy.nps.dis.SimulationManager

java.lang.Object
    |
    +----mil.navy.nps.dis.SimulationManager

public class SimulationManager
extends java.lang.Object
implements java.lang.Runnable
Version:
1.0
Author:
Don McGregor (http://www.stl.nps.navy.mil/~mcgredo)
Location:
http://www.stl.nps.navy.mil/dis-java-vrml/mil/navy/nps/dis/SimulationManager.java
Hierarchy Diagram:
Summary:
A single object, called SimulationManager, will handle all routing of PDUs. More functionality beyond this multiple-entity management might be integrated into this object as well.
Explanation
The SimulationManager contains:

Its responsibilities include

A block diagram of the object:

                   +---------------------------+
                   |                           |
                   |    SimulationManager      |
                   |                           |
                   |                           |
                   |              EntityList   |------VRML Scene
                   |                Entity1    |
                   |                Entity2    |
                   |                Entityn    |
                   |                           |
                   |           NIU             |
                   +---------------------------+
                                |
                       ----------------- Wire
 
The NIU, an instance of a NetworkMonitor, reads PDUs from the wire. The SimulationManager occasionally pulls PDUs from the NIU. For each PDU, the simulation manager looks at the type.

If it's an ESPDU, the SimulationManger code looks at the EntityID triplet (site, application, ID) that uniquely identifies each entity, then passes it on to the correct entity. If it's an unrecognized EntityID, we may optionally instantiate a local entity to reflect it, and insert it into the scene. The Entity object in the list is responsible for communications with the VRML scene. ESPDU culling may be performed either here or at the entity level. It seems more logical to put it at the entity level, where there is a bit more information about update frequency and the like. On the other hand, it might make more sense to cull ESPDUs early, to cut down on PDU handling overhead. That's an implementation and optimization detail.

If it's a SimulationManagement PDU, it will be handled by a different block of code. SimulationManagement PDUs include Start Simulation PDU, Stop Simulation PDU, Create Entity PDU, EventReport PDU, Query PDU and Data PDU. Each of these will probably require some special handling, and perhaps some state changes in the SimulationManager object. Some of them will require that PDUs be sent in response.

Cardinality: there is one and only one instance of a SimulationManager per DIS application. I think the whole thing will operate through class (static) methods.

History:
29Oct97 /Don McGregor /New
19May97 DonBrutzman Added addEspduTransform
See Also:
NetworkMonitor, java.util.Hashtable, java.lang.Object, java.lang.Thread, java.lang.Runnable

Constructor Summary
 SimulationManager(int pPort)
Unicast constructor; listens on the given unicast port
 SimulationManager(int pPort, java.lang.String pMulticastGroup)
Multicast constructor; listens on the given port and group
 

Method Summary
void  addEspduTransform(mil.navy.nps.javaViaScriptNode.EspduTransform pET)
 
void  addReadTransform(mil.navy.nps.javaViaScriptNode.EspduReadTransform pRT)
Adds a readTransform node to the list of readTransforms being maintained.
static void  debug(java.lang.String pDiagnostic)
Debugging output.
void  run()
 
 
Methods inherited from class java.lang.Object
 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimulationManager

public SimulationManager(int pPort)
Unicast constructor; listens on the given unicast port

SimulationManager

public SimulationManager(int pPort,
                         java.lang.String pMulticastGroup)
Multicast constructor; listens on the given port and group
Method Detail

debug

protected static void debug(java.lang.String pDiagnostic)
Debugging output. Pass in a string, and it gets printed out on the console. You can pass in strings such as "foo " + "bar"

addReadTransform

public void addReadTransform(mil.navy.nps.javaViaScriptNode.EspduReadTransform pRT)
Adds a readTransform node to the list of readTransforms being maintained. Once a ReadTransform has been added to the list, it can receive PDUs sent to that EntityID triplet.

addEspduTransform

public void addEspduTransform(mil.navy.nps.javaViaScriptNode.EspduTransform pET)

run

public void run()
Implements:
run in interface java.lang.Runnable

Contents | Package | Class | Tree | Deprecated | Index | Help
PREV | NEXT SHOW LISTS | HIDE LISTS