moves
Class EuBeaconizer

java.lang.Object
  |
  +--moves.EuBeaconizer

public class EuBeaconizer
extends java.lang.Object

This class can analyse options for issuing beacons. Is meant as a tool which should be instantiated and used locally. The current version does not know how to check global flags for preferences with regards to which types are preferred or ruled out, or to prompt the user for choices.


Field Summary
static int AGE
          Internal flag for beacon of type OLD or NEW
static int BEACON_OPTIONS
           
static int BEST_PROXIMITY
          Internal flag for beacon of type CLOSE or FAR, using closest distinguishing point
static int COCIRCULAR_ORIENTATION
           
static int FIRST_ORIENTATION
          Internal flag for beacon of type CW or CCW
static int FIRST_PROXIMITY
          Internal flag for beacon of type CLOSE or FAR, using first distinguishing point
static int INTERNAL
          Internal flag for beacon of type PLUS or MINUS
static int INTERNALORIENTATION
           
 
Constructor Summary
EuBeaconizer()
          The constructor does miscellaneous initialization
EuBeaconizer(interagents.joinedWrapper results, interagents.finalWrapper inputs, interagents.EuLab lab)
          This constructor examines the options one has in issuing beacons for a pair of objects.
 
Method Summary
 int bestScoring()
           
 int distinguishAge(interagents.joinedWrapper findings, interagents.EuLab lab)
          Tries to distinguish using age criteria.
 int distinguishInternal(interagents.joinedWrapper results)
          Tries to distinguish using internal criteria (and always succeeds)
 int distinguishInternalOrientation(interagents.joinedWrapper results, interagents.finalWrapper inputs, interagents.EuLab lab)
          Tries to distinguish using internal criteria (succeeds when input is an arc containing output)
 int distinguishOrientation(interagents.joinedWrapper results, fundamentals.EuVector v)
          Tries to distinguish using orientation criteria.
 int distinguishProximity(interagents.joinedWrapper results, fundamentals.EuVector v)
          Tries to distinguish using proximity criteria.
 int getNumber(int i)
           
 fundamentals.EuBeacon issueBeacon(int i, int choice)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AGE

public static final int AGE
Internal flag for beacon of type OLD or NEW

See Also:
Constant Field Values

INTERNAL

public static final int INTERNAL
Internal flag for beacon of type PLUS or MINUS

See Also:
Constant Field Values

FIRST_PROXIMITY

public static final int FIRST_PROXIMITY
Internal flag for beacon of type CLOSE or FAR, using first distinguishing point

See Also:
Constant Field Values

BEST_PROXIMITY

public static final int BEST_PROXIMITY
Internal flag for beacon of type CLOSE or FAR, using closest distinguishing point

See Also:
Constant Field Values

FIRST_ORIENTATION

public static final int FIRST_ORIENTATION
Internal flag for beacon of type CW or CCW

See Also:
Constant Field Values

COCIRCULAR_ORIENTATION

public static final int COCIRCULAR_ORIENTATION
See Also:
Constant Field Values

INTERNALORIENTATION

public static final int INTERNALORIENTATION
See Also:
Constant Field Values

BEACON_OPTIONS

public static final int BEACON_OPTIONS
See Also:
Constant Field Values
Constructor Detail

EuBeaconizer

public EuBeaconizer()
The constructor does miscellaneous initialization


EuBeaconizer

public EuBeaconizer(interagents.joinedWrapper results,
                    interagents.finalWrapper inputs,
                    interagents.EuLab lab)
This constructor examines the options one has in issuing beacons for a pair of objects. Tries everything and notes positive scores if they could work. Also collects useful information which is then accessible by bestScoring, issueBeacon and getNumber

Method Detail

distinguishAge

public int distinguishAge(interagents.joinedWrapper findings,
                          interagents.EuLab lab)
Tries to distinguish using age criteria.

Parameters:
findings - a joinedWrapper with two objects.
Returns:
0 if no distinction is possible, 1 if it is and the older object comes first, -1 if it is and the older object comes last

distinguishInternal

public int distinguishInternal(interagents.joinedWrapper results)
Tries to distinguish using internal criteria (and always succeeds)

Returns:
1

distinguishInternalOrientation

public int distinguishInternalOrientation(interagents.joinedWrapper results,
                                          interagents.finalWrapper inputs,
                                          interagents.EuLab lab)
Tries to distinguish using internal criteria (succeeds when input is an arc containing output)

Returns:
1 or 0

distinguishProximity

public int distinguishProximity(interagents.joinedWrapper results,
                                fundamentals.EuVector v)
Tries to distinguish using proximity criteria. Updates private field with last distance to first object.

Parameters:
v - the vector
Returns:
0 if v is equidistant from the two objects, 1 if it isn't and the closer object comes first, -1 if it is and the closer object comes last

distinguishOrientation

public int distinguishOrientation(interagents.joinedWrapper results,
                                  fundamentals.EuVector v)
Tries to distinguish using orientation criteria. Attempts to find a circle among the inputs which contains v and all objects in findings. Then

Parameters:
v - the vector
Returns:
0 if there is no such circle or degeneration on it, 1 if there is such a circle and the first object in findings comes first when one moves counterclockwise from v, -1 if the second object comes first.

bestScoring

public int bestScoring()
                throws InternalException
Returns:
The index of the best scoring type of beacon
Throws:
InternalException - if no beacon is possible

issueBeacon

public fundamentals.EuBeacon issueBeacon(int i,
                                         int choice)
Parameters:
choice - 1 if objects are needed in the order passed at instantiation, -1 if needed in opposite order

getNumber

public int getNumber(int i)
Parameters:
i - index of beacon type
Returns:
number of distinguishing point with proximity or orientation beacons, or -1 of no such point