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

* code snippets in place

* beginning testing
parent 68582a37
No related branches found
No related tags found
No related merge requests found
Showing
with 63 additions and 0 deletions
add_primitive_order|Create a primitive order and add it to a list
import cxxi.model.behavior.OrderUtilities as OrderUtilities
# this action needs some work it's a place holder for now
OrderUtilities.call_goes_here
execute_order|Execute a compound order
import java.util.Vector as Vector
import cxxi.model.behavior.OrderUtilities as OrderUtilities
# this action needs some work it's a place holder for now
prims = Vector()
ordr = orders.createOrder("HTN Plan Auto Generated", 0.0, prims)
orders.execute_options(ordr)
get_control_measure|Get control measure by name
import cxxi.model.objects.holders.CMHolder as CMHolder
cm = CMHolder.retrieveControlMeasureByName(%CM_NAME)
get_dmi|Get decision module
myDM = UtilityFuncsExp.getDMI(%ENTITY_NAME, %DMI_NAME)
get_entity|Get entity by name
import cxxi.model.objects.playboard.PlayBoard as PlayBoard
PlayBoard.getSingleton().getEntityByName(%ENTITY_NAME)
get_entity_heading|Get entity heading by name
import cxxi.model.objects.playboard.PlayBoard as PlayBoard
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
PlayBoard.getSingleton().getEntityByName(%ENTITY_NAME).getPhysicalState().getGroundTruthLocation()
get_last_trigger_params|Get last trigger params
state.getLastTriggerParams()
get_move_order_from_route|Get move order from route
import mtry.cxxi.model.HierarchicalTaskNetwork.HTNUtilities as HTNUtilities
ordr=HTNUtilities._py_getMoveOrderFromRoute(%ROUTE_NAME, %SPEED, %FORMATION_NAME)
get_orbit_locations|Get orbit locations
import mtry.cxxi.model.HierarchicalTaskNetwork.HTNUtilities as HTNUtilities
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
HTNUtilities._py_getOrbitOrderFromRoute(%ROUTE_NAME, %SPEED, %FORMATION_NAME, %NUM_TIMES)
get_param|Get tree parameter
_gt_activeNode.getParam(%PARAM_NAME)
get_sensor|Get sensor by name
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
PythonEngage._py_getTargetList(%ENTITY_NAME, %CURRENT)
get_unit|Get get unit by name
import cxxi.model.knowledge.group.holders.NewUnitHolder as NewUnitHolder
unit = NewUnitHolder.retrieveUnitByName(%UNIT_NAME)
get_var|Get tree variable
_gt_activeNode.getVar(%VAR_NAME)
get_weapon_list|Get the weapon list from the entity
import mtry.cxxi.model.HierarchicalTaskNetwork.PythonUtilities.PythonEngage as PythonEngage
HTNUtilities._py_getWeaponList(%ENTITY_NAME)
get_weapon_list|Get the weapon list from the entity
if state.getLastTrigger() == "do"+%TRIGGER_NAME:
# TODO: Add code
_htn_precon_ret = 1
loop_over_unit_members|Loop over the members of a unit
import mtry.cxxi.model.HierarchicalTaskNetwork.HTNUtilities as HTNUtilities
unitToIter = HTNUtilities._py_getUnitByName(%)
for member in unitToIter.getMembers():
# do stuff to members
printMessage("MEMBER NAME="+member.getAssignedName(), True)
set_var|Set tree variable
_gt_activeNode.putVar(%VAR_NAME, %VALUE)
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