Skip to content
Snippets Groups Projects
Commit 0004cdee authored by Reeves, David E's avatar Reeves, David E
Browse files

* added descriptions to the snippets

parent c874c8b7
No related branches found
No related tags found
No related merge requests found
Showing
with 33 additions and 1 deletion
No preview for this file type
add_cm|Add a control measure to the scenario. The entity is used to get the cm side.
import mtry.cxxi.model.HierarchicalTaskNetwork.HTNUtilities as HTNUtilities
# %ENTITY_OBJ entity object Entity
# %LOCATION location of the control measure Location
addedCM = HTNUtilities._py_addControlMeasure(%ENTITY_OBJ, %LOCATION)
add_replan_trigger|Add a replan trigger event to the tree
# %EVENT_NAME name of the event to replan on
goalContainer.getCurrentExecutingStack().addReplanTrigger(%EVENT_NAME)
get_control_measure|Get control measure by name
import cxxi.model.objects.holders.CMHolder as CMHolder
# %CM_NAME name of the control measure to get string
cm = CMHolder.retrieveControlMeasureByName(%CM_NAME)
get_dmi|Get decision module
# %ENTITY_NAME name of the entity whose DMI you wish to get string
# %DMI_NAME name of the DMI to get example: "OBSERVE" string
myDM = UtilityFuncsExp.getDMI(%ENTITY_NAME, %DMI_NAME)
get_entity|Get entity by name
import cxxi.model.objects.playboard.PlayBoard as PlayBoard
# %ENTITY_NAME name of the entity to get string
PlayBoard.getSingleton().getEntityByName(%ENTITY_NAME)
get_entity_heading|Get entity heading by name
import cxxi.model.objects.playboard.PlayBoard as PlayBoard
# %ENTITY_NAME name of the entity whose heading to get string
PlayBoard.getSingleton().getEntityByName(%ENTITY_NAME).getPhysicalState().getAbsoluteHeading().getHeadingInDegreesAt(PlayBoard.getSingleton().getEntityByName(%ENTITY_NAME).getPhysicalState().getGroundTruthLocation())
get_entity_location|Get entity location by name
import cxxi.model.objects.playboard.PlayBoard as PlayBoard
# %ENTITY_NAME name of the entity whose location to get string
PlayBoard.getSingleton().getEntityByName(%ENTITY_NAME).getPhysicalState().getGroundTruthLocation()
get_move_order_from_route|Get move order from route
import mtry.cxxi.model.HierarchicalTaskNetwork.HTNUtilities as HTNUtilities
# %ROUTE_NAME name of the route to get string
# %SPEED speed to travel at double
# %FORMATION_NAME name of the formation to travel in string use "NO_FORMATION" for None
ordr=HTNUtilities._py_getMoveOrderFromRoute(%ROUTE_NAME, %SPEED, %FORMATION_NAME)
get_orbit_locations|Get orbit locations
import mtry.cxxi.model.HierarchicalTaskNetwork.HTNUtilities as HTNUtilities
# %LOCATION location of the center of the circle Location
# %RADIUS radius of the circle in meters double
# %DEGREE_STEP generate a point ever DEGREE_STEP degrees. must go into 360 evenly. double
# %ELEVATION height of the points. absolute elevation double
# %CLOCKWISE if True points are generated clockwise, counter clockwise otherwise False
HTNUtilities._py_getOrbitOrderFromRoute(%LOCATION, %RADIUS, %DEGREE_STEP, %ELEVATION, %CLOCKWISE)
get_orbit_order_from_route|Get orbit order from route
import mtry.cxxi.model.HierarchicalTaskNetwork.HTNUtilities as HTNUtilities
# %ROUTE_NAME name of the route to use as a path
# %SPEED speed of the move double
# %FORMATION_NAME formation name string use "NO_FORMATION" for none
# %NUM_TIMES number of times to orbit the cm. -1 for infinite, double
HTNUtilities._py_getOrbitOrderFromRoute(%ROUTE_NAME, %SPEED, %FORMATION_NAME, %NUM_TIMES)
get_param|Get tree parameter
# %PARAM_NAME name of the parameter from the data map to get
_gt_activeNode.getParam(%PARAM_NAME)
get_sensor|Get sensor by name
# %SENSOR_NAME name of the sensor to get string
mySensor = UtilityFuncsExp.getDMI(info.getMyAssignedName(), "OBSERVE").getSensorByName(%SENSOR_NAME)
get_target_list|Get the list of targets from the intel process
import mtry.cxxi.model.HierarchicalTaskNetwork.PythonUtilities.PythonEngage as PythonEngage
# %ENTITY_NAME name of the entity to get string
# %CURRENT get the list from the most current intel data, fused data otherwise boolean
PythonEngage._py_getTargetList(%ENTITY_NAME, %CURRENT)
get_unit|Get get unit by name
import cxxi.model.knowledge.group.holders.NewUnitHolder as NewUnitHolder
# %UNIT_NAME name of the unit to get string
unit = NewUnitHolder.retrieveUnitByName(%UNIT_NAME)
get_var|Get tree variable
# %VAR_NAME name of the variable to get string
# If the variable was not previously set it will return None
_gt_activeNode.getVar(%VAR_NAME)
get_weapon_list|Get the weapon list from the entity
import mtry.cxxi.model.HierarchicalTaskNetwork.PythonUtilities.PythonEngage as PythonEngage
# %ENTITY_NAME name of the entity to get the weapons from string
HTNUtilities._py_getWeaponList(%ENTITY_NAME)
if_last_trigger|If the last trigger encounted was a specific value
# %TRIGGER_NAME name of the trigger to check for string
if state.getLastTrigger() == "do"+%TRIGGER_NAME:
# TODO: Add code
_htn_precon_ret = 1
log_specific_entity|Turn on the extra loggers for a specific entity
import mtry.cxxi.model.MtryLog.LogManager as LogManager
# %ENTITY_NAME name of the entity to log string
LogManager.addSpecificEntityLog(%ENTITY_NAME) # name of the entity to log string
loop_over_unit_members|Loop over the members of a unit
import mtry.cxxi.model.HierarchicalTaskNetwork.HTNUtilities as HTNUtilities
unitToIter = HTNUtilities._py_getUnitByName(%)
# %UNIT_NAME name of the unit whose members to iterate over string
unitToIter = HTNUtilities._py_getUnitByName(%UNIT_NAME)
for member in unitToIter.getMembers():
# do stuff to members
printMessage("MEMBER NAME="+member.getAssignedName(), True)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment