Boeing Simulation 3.1 API Specification

unifier
Class BasicPerspectiveUnifier

java.lang.Object
  |
  +--connect.socket.SocketComponentTemplate
        |
        +--unifier.BasicPerspectiveUnifier
All Implemented Interfaces:
Component, PerspectiveUnifier
Direct Known Subclasses:
ModeratePerspectiveUnifier

public class BasicPerspectiveUnifier
extends SocketComponentTemplate
implements PerspectiveUnifier

This class is meant to be a very basic implementation of Perspective Unifier. This PU is extremely simple (to a fault!). It adds all the objects from the WorldImage to the list of object currently known by the WorldState.

Version:
$Revision: 1.14 $
Author:
Dave Jurgens

Field Summary
static int PORT
           
private  connect.ComponentEmissary representative
           
private static long serialVersionUID
           
private  boolean serverConnected
           
private static boolean SHOW_ACCEPTS
           
 
Fields inherited from class connect.socket.SocketComponentTemplate
portNumber
 
Constructor Summary
BasicPerspectiveUnifier()
           
 
Method Summary
protected  boolean accept(Class requestingType)
          Returns false.
protected  boolean allowMethod(util.MethodRequest request)
          Accepts the method "unify" from the Server and returns false for all others.
protected  connect.ComponentEmissary getComponentEmissary()
          Returns the ComponentEmissary that represents this object.
protected  int getMaxPoints()
          Returns 1 so that a single RelayPoint may be created.
static void main(String[] args)
           
protected  void processAcceptedConnection(Class remoteComponentType, connect.ChannelBundle acceptedConnection)
          Processes a connection to the Server.
protected  void processRequestingConnection(connect.ComponentEmissary remoteComponent, connect.ChannelBundle incomingConnection)
          No components are allowed to connect to us at this point in time.
 world.WorldState unify(world.WorldState current, world.WorldImage deltaWorld)
          Returns a new WorldState object that reflects the changes depicted in the WorldImage.
 
Methods inherited from class connect.socket.SocketComponentTemplate
connect, getConnection, processRelayPoint, spawnRelayPoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface connect.Component
connect, getConnection
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

PORT

public static final int PORT
See Also:
Constant Field Values

SHOW_ACCEPTS

private static final boolean SHOW_ACCEPTS
See Also:
Constant Field Values

representative

private final connect.ComponentEmissary representative

serverConnected

private boolean serverConnected
Constructor Detail

BasicPerspectiveUnifier

public BasicPerspectiveUnifier()
Method Detail

unify

public world.WorldState unify(world.WorldState current,
                              world.WorldImage deltaWorld)
Returns a new WorldState object that reflects the changes depicted in the WorldImage.

Specified by:
unify in interface PerspectiveUnifier
Parameters:
current - the current list of known objects
deltaWorld - processed information from a ObjectLocater
Returns:
the new world state with updated information

processRequestingConnection

protected void processRequestingConnection(connect.ComponentEmissary remoteComponent,
                                           connect.ChannelBundle incomingConnection)
No components are allowed to connect to us at this point in time.

Specified by:
processRequestingConnection in class SocketComponentTemplate

processAcceptedConnection

protected void processAcceptedConnection(Class remoteComponentType,
                                         connect.ChannelBundle acceptedConnection)
Processes a connection to the Server. This gets called when the connect method is called the the remote component accepts our connection. Specifically, we should have requested to connect to server right away and so we when are connected, we receive this connection to the server.

Specified by:
processAcceptedConnection in class SocketComponentTemplate

accept

protected boolean accept(Class requestingType)
Returns false. This component does not accept connections.

Specified by:
accept in class SocketComponentTemplate

allowMethod

protected boolean allowMethod(util.MethodRequest request)
Accepts the method "unify" from the Server and returns false for all others.

Specified by:
allowMethod in class SocketComponentTemplate

getComponentEmissary

protected connect.ComponentEmissary getComponentEmissary()
Description copied from class: SocketComponentTemplate
Returns the ComponentEmissary that represents this object.

Overrides:
getComponentEmissary in class SocketComponentTemplate

getMaxPoints

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

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

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.