public abstract class GoalPlanner extends Object implements Runnable
Modifier and Type | Class and Description |
---|---|
protected class |
GoalPlanner.PartnerList
Container class for records for other vehicles cooperating towards this goal
Records will be maintained in numerical order based on the vehicleID
|
protected class |
GoalPlanner.PartnerRecord |
Modifier and Type | Field and Description |
---|---|
protected boolean |
alert
Set to true if the goal is an alert (be on station to accomplish the specified goal, but don't actually do it)
|
static int |
ATTACK_GOAL |
protected GeoAreaSet |
avoidAreaSet
Simplified set of avoid areas for use by the route planner
|
protected int |
currentState
Enumeration for representing the current world state
|
static String |
DECISION_CURRENT
Goals in current decision tree
|
static String |
DECISION_ONFAILURE |
static String |
DECISION_ONSUCCESS |
static int |
DECONTAMINATE_GOAL |
static int |
DEMOLISH_GOAL |
protected double |
duration
Execution time (or maximum time to attain success) specified for the goal (if applicable)
|
protected boolean |
firstGoal
Flag indicating whether or not the goal is the first to be attempted (initial position command generated)
|
static int |
GOAL_FAIL |
static int |
GOAL_IN_PROGRESS |
static int |
GOAL_SUCCEED |
protected boolean |
goalAttainable
Set to false if the vehicle in question is not capable of completing this goal
|
double |
goalVertical
Vertical value (depth, altitude, MSL or AGL altitude) that the vehicle is to be at when accomplishing this goal
|
int |
goalVerticalMode
Enumeration for the units of the vehicle vertical (depth, altitude, etc.) that the vehicle is to use when accomplishing this goal
|
static int |
ILLUMINATE_GOAL |
protected CommunicationsHandler |
interVehicleCommunicationsHandler
Used to communicate between vehicles
|
static int |
JAM_GOAL |
static int |
MARK_GOAL |
static int |
MONITOR_TRANSMISSION_GOAL |
protected boolean |
onStation
Set to true when the vehicle arrives in the operating area
|
protected GeoArea |
operatingArea
The geographic operating area of the goal
|
static int |
PATROL_GOAL |
protected boolean |
planComputed
Flag indicating that the planner has a computed plan ready
|
protected boolean |
ready
Flag indicating that the planner has been fully initialized (is ready to be run)
|
static int |
RENDEZVOUS_GOAL |
protected boolean |
reportEnd
True if a report is to be made when goal execution ends
|
protected double |
reportingInterval
Period between reports if periodic reporting is required
|
protected boolean |
reportPeriodic
True if periodic reports are to be made
|
protected boolean |
reportStart
True if a report is to be made when goal execution begins
|
protected boolean |
reportStatusChange
True if a report is to be made each time the status of the goal changes
|
static int |
REPOSITION_GOAL |
static int |
SAMPLE_ENVIRONMENT_GOAL |
static int |
SEARCH_GOAL |
protected int |
searchPlannerType
Enumeration identifying the type of search pattern that is to be used (if required)
|
protected double |
startTime
Start time specified for commencement of goal execution (if applicable)
|
protected boolean |
stateChanged
Set to true when the world state of the planner has changed (replanning probably required)
|
static String |
STATUS_DESC_LAST_ENDED |
static String |
STATUS_EXECUTION_BEGIN
Goal Status messages
|
static String |
STATUS_EXECUTION_FAIL |
static String |
STATUS_EXECUTION_SUCCEED |
static String |
STATUS_STATUS_COMPLETE |
static String |
STATUS_SYSTEM_MISSION |
protected double |
stopTime
Completion (or time out) time specified for the commencement of goal execution (if applicable)
|
protected GoalPlanner.PartnerList |
teamPartnerList
Contains records of all vehicles participating in this goal
|
protected long |
timeOut
System clock time that the goal will time out
|
protected VehicleCharacteristics |
vehicleCharacteristics
Vehicle and goal-type-specific characteristics
|
protected int |
vehicleID
Unique identifier for this vehicle
|
protected WorldModel |
worldModel
Reference to the world model that is to be used in planning
|
Constructor and Description |
---|
GoalPlanner(int vehicleID,
StateVector state,
VehicleCharacteristics chars,
AgendaGoalElementType goal)
Creates a new instance of GoalPlanner
|
GoalPlanner(int vehicleID,
StateVector state,
VehicleCharacteristics chars,
AgendaGoalElementType goal,
List<AreaElementType> avoidAreas)
Creates a new instance of GoalPlanner
|
GoalPlanner(int vehicleID,
StateVector state,
VehicleCharacteristics chars,
AgendaGoalElementType goal,
List<AreaElementType> avoidAreas,
double startX,
double startY)
Creates a new instance of GoalPlanner
|
GoalPlanner(int vehicleID,
VehicleCharacteristics chars,
AgendaGoalElementType goal)
Creates a new instance of GoalPlanner
|
GoalPlanner(int vehicleID,
VehicleCharacteristics chars,
AgendaGoalElementType goal,
List<AreaElementType> avoidAreas)
Creates a new instance of GoalPlanner
|
GoalPlanner(int vehicleID,
VehicleCharacteristics chars,
AgendaGoalElementType goal,
List<AreaElementType> avoidAreas,
double startX,
double startY)
Creates a new instance of GoalPlanner
|
Modifier and Type | Method and Description |
---|---|
void |
assignVehicle(StateVector state)
Assigns the planner object to a specific vehicle
|
abstract List<JAXBElement<?>> |
generateAvclScriptElementList(int vehicleType,
double gpsInterval)
Generates a set of AVCL task-level commands relevant to the implementing object's purpose
(e.g., a series of script commands that implement a planner object's computed plan)
|
GeoAreaSet |
getAvoidAreas()
Returns a reference to the AVCL avoid areas object
|
double[] |
getBestPosition()
Returns the best available current vehicle position
|
double |
getCurrentTime()
Gets the current vehicle simulation time or mission time
|
double |
getDuration()
Returns the maximum (or required) duration of goal execution
|
AgendaGoalElementType |
getGoal()
Returns a reference to the AVCL goal object
|
int |
getPlannerType()
Returns an enumeration for the type of planner object (child class) the object is
|
double |
getStartTime()
Returns the specified goal execution start time
|
double |
getStopTime()
Returns the specified goal execution stop time
|
int |
getTimingType()
Returns an enumeration for the type of timing used for this goal (absolute or duration)
|
int |
getVehicleType()
Returns the enumeration for the vehicle type that the generated plan is intended for
|
abstract int |
goalExecutionStatus()
Determines the current status of goal execution (in progress, succeed, or fail
|
int |
goalType()
Returns an enumeration corresponding to the type of goal the planner applies to
|
boolean |
hasStateChanged()
Returns true if the world state used by the planner has changed because of the last variable update
|
boolean |
inOperatingArea(double[] testPoint)
Returns true if the point specified by the parameter is in the current goal's operating area
|
boolean |
localExecutionLevel()
Returns true iff there is an Execution level object being used
|
JAXBElement<?> |
makeLoiterCmd(double x,
double y,
int positType,
int transitVerticalMode,
double transitVertical,
double loiterVertical,
String description)
Utility function for generating loiter commands for the specific type of vehicle
This is required because even though they are semantically equivalent, the way
the schema is designed, JAXB generates vehicle-specific objects
(UuvScriptCommands.MetaCommand, UsvScriptCommands.MetaCommand, etc.)
|
JAXBElement<?> |
makeMetaCmd(String name,
String content,
String description)
Utility function for generating meta commands for the specific type of vehicle.
|
JAXBElement<?> |
makePositionCmd(double[] posit,
int positType,
String description)
Utility function for generating position commands for the specific type of vehicle
|
JAXBElement<?> |
makeWaitCmd(double duration,
String description)
Utility function for generating wait commands for the specific type of vehicle
This is required because even though they are semantically equivalent, the way
the schema is designed, JAXB generates vehicle-specific objects
(UuvScriptCommands.MetaCommand, UsvScriptCommands.Metacommand, etc.)
|
JAXBElement<?> |
makeWaitUntilTimeCmd(double time,
String description)
Utility function for generating "wait until" commands for the specific type of vehicle
This is required because even though they are semantically equivalent, the way
the schema is designed, JAXB generates vehicle-specific objects
(UuvScriptCommands.MetaCommand, UsvScriptCommands.Metacommand, etc.)
|
boolean |
matchedWaypoints(JAXBElement<?> waypoint1,
JAXBElement<?> waypoint2)
Returns true if two waypoint commands are for the same geographic point
|
boolean |
planAvailable()
Returns true if the planner has a computed plan avaiable
|
List<JAXBElement<?>> |
planRouteElementList(double[] start,
double[] end,
double gpsInterval,
double vertical,
int verticalMode,
double speed,
int speedMode)
Generates a series of waypoints from a start to an end that avoids all avoid areas
|
abstract void |
planScript()
Utilizes all available information to generate a script to accomplish the applicable goal
|
abstract void |
planScript(double startX,
double startY)
Utilizes all available information to generate a script to accomplish the applicable goal
|
protected void |
recalculateGpsFixes(List<JAXBElement<?>> planElementList)
Recalculates the GPS popup maneuvers for a UUV during the transit
|
protected abstract void |
reset()
Resets the planner so that it can be restarted from scratch
|
void |
resetStateChanged()
Resets the "state changed" flag to false
|
void |
resetTiming()
Resets the start and stop times of the goal
|
void |
run()
Implements the Runnable interface to support threaded planning
|
protected abstract void |
sendRequiredComms()
Sends any required inter-vehicle communications based on the current goal status
|
void |
setAvoidAreas(List<AreaElementType> avclAvoidAreas)
Sets a list of areas that are to be avoided during goal accomplishment
|
void |
setCommunicator(CommunicationsHandler ivCommunicator)
Used to set the inter-vehicle communicator
|
void |
setFirst()
Sets this goal as the first to be attempted
|
void |
setOffStation()
Sets the "In operating area" flag to false
|
void |
setOnStation()
Sets the "In operating area" flag to true
|
void |
setOperatingArea()
Sets the operating area for the goal
|
protected abstract void |
setParameters()
Sets the goal parameters specific to attacks based on a AVCL attack goal
|
void |
setStartPosition(double[] start)
Sets the vehicle position at the beginning of planning for goal accomplishment
|
void |
setStartPosition(double startX,
double startY)
Sets the vehicle position at the beginning of planning for goal accomplishment
|
abstract int |
setState()
Uses the current world state to set the state of a finite state machine that will
determine how the plan is generated (e.g. search pattern, report and continue, etc.)
|
void |
setTeamMemberOnStation(int otherVehicleID)
Sets the team member list to indicate that a team member is on station
|
void |
setUnattainable()
Sets this goal as unattainable by the executing vehicle
|
void |
setWorldModel(WorldModel world)
Sets the world model that the planner is to use
|
void |
vehicleInitialize(VehicleCharacteristics chars)
Used to initialize goal-type-specific characteristics required by the planner
|
public static final int GOAL_IN_PROGRESS
public static final int GOAL_SUCCEED
public static final int GOAL_FAIL
public static final int ATTACK_GOAL
public static final int DECONTAMINATE_GOAL
public static final int DEMOLISH_GOAL
public static final int ILLUMINATE_GOAL
public static final int JAM_GOAL
public static final int MARK_GOAL
public static final int MONITOR_TRANSMISSION_GOAL
public static final int PATROL_GOAL
public static final int RENDEZVOUS_GOAL
public static final int REPOSITION_GOAL
public static final int SAMPLE_ENVIRONMENT_GOAL
public static final int SEARCH_GOAL
public static String STATUS_EXECUTION_BEGIN
public static String STATUS_EXECUTION_FAIL
public static String STATUS_EXECUTION_SUCCEED
public static String STATUS_SYSTEM_MISSION
public static String STATUS_STATUS_COMPLETE
public static String STATUS_DESC_LAST_ENDED
public static String DECISION_CURRENT
public static String DECISION_ONSUCCESS
public static String DECISION_ONFAILURE
protected int vehicleID
protected VehicleCharacteristics vehicleCharacteristics
protected CommunicationsHandler interVehicleCommunicationsHandler
protected GeoArea operatingArea
protected GeoAreaSet avoidAreaSet
protected GoalPlanner.PartnerList teamPartnerList
protected double startTime
protected double stopTime
protected double duration
protected long timeOut
protected boolean alert
protected WorldModel worldModel
protected boolean firstGoal
protected boolean ready
protected boolean planComputed
protected int currentState
protected boolean reportStatusChange
protected boolean reportStart
protected boolean reportEnd
protected boolean reportPeriodic
protected double reportingInterval
protected boolean goalAttainable
protected boolean onStation
protected boolean stateChanged
public double goalVertical
public int goalVerticalMode
protected int searchPlannerType
public GoalPlanner(int vehicleID, VehicleCharacteristics chars, AgendaGoalElementType goal)
vehicleID
- chars
- characteristics that define what goals the vehicle is capable of accomplishinggoal
- AVCL (JAXB) object that defines the goal the planner is intended to accomplishpublic GoalPlanner(int vehicleID, VehicleCharacteristics chars, AgendaGoalElementType goal, List<AreaElementType> avoidAreas)
vehicleID
- chars
- characteristics that define what goals the vehicle is capable of accomplishinggoal
- AVCL (JAXB) object that defines the goal the planner is intended to accomplishavoidAreas
- list of AVCL objects defining avoid areas effecting transit to and from op areapublic GoalPlanner(int vehicleID, VehicleCharacteristics chars, AgendaGoalElementType goal, List<AreaElementType> avoidAreas, double startX, double startY)
vehicleID
- chars
- characteristics that define what goals the vehicle is capable of accomplishinggoal
- AVCL (JAXB) object that defines the goal the planner is intended to accomplishavoidAreas
- list of AVCL objects defining avoid areas effecting transit to and from op areastartX
- the x coordinate of the vehicle starting positionstartY
- the y coordinate of the vehicle starting positionpublic GoalPlanner(int vehicleID, StateVector state, VehicleCharacteristics chars, AgendaGoalElementType goal)
vehicleID
- state
- StateVector object of the vehicle for which the planner is to be utilizedchars
- characteristics that define what goals the vehicle is capable of accomplishinggoal
- AVCL (JAXB) object that defines the goal the planner is intended to accomplishpublic GoalPlanner(int vehicleID, StateVector state, VehicleCharacteristics chars, AgendaGoalElementType goal, List<AreaElementType> avoidAreas)
vehicleID
- state
- StateVector object of the vehicle for which the planner is to be utilizedchars
- characteristics that define what goals the vehicle is capable of accomplishinggoal
- AVCL (JAXB) object that defines the goal the planner is intended to accomplishavoidAreas
- list of AVCL objects defining avoid areas effecting transit to and from op areapublic GoalPlanner(int vehicleID, StateVector state, VehicleCharacteristics chars, AgendaGoalElementType goal, List<AreaElementType> avoidAreas, double startX, double startY)
vehicleID
- state
- StateVector object of the vehicle for which the planner is to be utilizedchars
- characteristics that define what goals the vehicle is capable of accomplishinggoal
- AVCL (JAXB) object that defines the goal the planner is intended to accomplishavoidAreas
- list of AVCL objects defining avoid areas effecting transit to and from op areastartX
- the x coordinate of the vehicle starting positionstartY
- the y coordinate of the vehicle starting positionprotected abstract void reset()
protected abstract void setParameters()
public abstract int setState()
public abstract void planScript()
public abstract void planScript(double startX, double startY)
startX
- X coordinate of the vehicle when starting work towards goal accomplishmentstartY
- Y coordinate of the vehicle when starting work towards goal accomplishmentpublic abstract List<JAXBElement<?>> generateAvclScriptElementList(int vehicleType, double gpsInterval)
vehicleType
- enumeration for the type of vehicle (AUV, UAV, etc.)gpsInterval
- distance the vehicle can travel submerged between GPS fixes (only relevant for UUVs)public abstract int goalExecutionStatus()
GoalPlanner.GOAL_IN_PROGRESS
, GoalPlanner.GOAL_SUCCEED
, or GoalPlanner.GOAL_FAIL
protected abstract void sendRequiredComms()
public void vehicleInitialize(VehicleCharacteristics chars)
chars
- vehicle characteristics to be utilized for the searchpublic void setWorldModel(WorldModel world)
world
- public void setCommunicator(CommunicationsHandler ivCommunicator)
ivCommunicator
- public final void assignVehicle(StateVector state)
state
- StateVector object of the vehicle to which this planner is being assignedpublic void setFirst()
public boolean inOperatingArea(double[] testPoint)
testPoint
- double[2] containing the (x, y) position of the point being testedGeoArea
operatingAreapublic boolean localExecutionLevel()
public double[] getBestPosition()
public void resetTiming()
public void resetStateChanged()
public void setUnattainable()
public void setOnStation()
public void setOffStation()
public void setTeamMemberOnStation(int otherVehicleID)
otherVehicleID
- identifier of the vehicle reporting on stationpublic double getCurrentTime()
public boolean hasStateChanged()
public int getPlannerType()
public int getVehicleType()
AvclMission.UAV
, AvclMission.UGV
, AvclMission.USV
, AvclMission.UUV
public AgendaGoalElementType getGoal()
public int goalType()
public boolean planAvailable()
public GeoAreaSet getAvoidAreas()
public void setStartPosition(double startX, double startY)
startX
- startY
- public void setStartPosition(double[] start)
start
- double[2] containing the (x, y) coordinate of the starting pointpublic int getTimingType()
public double getStartTime()
public double getStopTime()
public double getDuration()
public final void setOperatingArea()
public final void setAvoidAreas(List<AreaElementType> avclAvoidAreas)
avclAvoidAreas
- a List of areas to avoidpublic List<JAXBElement<?>> planRouteElementList(double[] start, double[] end, double gpsInterval, double vertical, int verticalMode, double speed, int speedMode)
start
- double[2] containing the (x, y) position of the starting pointend
- double[2] containing the (x, y) position of the ending pointgpsInterval
- number of waypoints between GPS fixes (only relevant for UUVs)vertical
- altitude or depth of command (only relevant for UUVs and UAVs)verticalMode
- enumeration specifying depth, altitude, MSL altitude, or AGL altitudespeed
- knots, meters per second, or percent of propeller rpm (AUV) settingspeedMode
- enumeration for knots or meters per second (not relevant for AUVs)protected void recalculateGpsFixes(List<JAXBElement<?>> planElementList)
planElementList
- ArrayList containing the AVCL behaviors of the planpublic JAXBElement<?> makeLoiterCmd(double x, double y, int positType, int transitVerticalMode, double transitVertical, double loiterVertical, String description)
x
- north/south position of the loiter commandy
- east/west position of the loiter commandpositType
- enumeration for position type (latitude/longitude or (x, y)transitVerticalMode
- enumeration for what the vertical is (MSLAltitude, depth, etc.)transitVertical
- altitude or depth value to use during transit (only applies to UUVs and UAVs)loiterVertical
- altitude or depth to use while loitering (only applies to UUVs and UAVs)description
- value of the meta command description attributepublic JAXBElement<?> makeMetaCmd(String name, String content, String description)
name
- text to be used for the meta command name attributecontent
- text to be used for the meta command content attributedescription
- value of the meta command description attributepublic JAXBElement<?> makePositionCmd(double[] posit, int positType, String description)
posit
- double[2] containing the (x, y) position of the Position commandpositType
- description
- value of the meta command description attributepublic JAXBElement<?> makeWaitCmd(double duration, String description)
duration
- length of time the vehicle is to waitdescription
- value of the meta command description attributepublic JAXBElement<?> makeWaitUntilTimeCmd(double time, String description)
time
- clock time that the vehicle is to resumedescription
- value of the meta command description attributepublic boolean matchedWaypoints(JAXBElement<?> waypoint1, JAXBElement<?> waypoint2)
waypoint1
- waypoint2
-