diff --git a/scripts/HTN/Trees/Red/ConvoyUnit.xml b/scripts/HTN/Trees/Red/ConvoyUnit.xml index 1a11e24c5481727d8625a7761edd2e939bbd1b39..94c4f07de4a484828658199995ad32c13b229a94 100644 --- a/scripts/HTN/Trees/Red/ConvoyUnit.xml +++ b/scripts/HTN/Trees/Red/ConvoyUnit.xml @@ -441,6 +441,13 @@ else: randVal = PythonUtilities._py_getRandomNumber("UNIFORM", [0.0, 1.0]) randSpd = borg.params_randSpdMin + (borg.params_randSpdVar * randVal) + # check for attack time + if borg.isAttackRun and Schedule.getSimTime() >= borg.params_attackTime: + # attack time clip the list + ind = len(borg.redConvoyDest[state.getCurrentUnit().getName()])-1 + lastName = borg.redConvoyDest[state.getCurrentUnit().getName()][ind] + borg.redConvoyDest[state.getCurrentUnit().getName()]=[lastName] + destName = borg.redConvoyDest[state.getCurrentUnit().getName()][0] del borg.redConvoyDest[state.getCurrentUnit().getName()][0] @@ -470,6 +477,7 @@ if state.isCommander(): <Code IsFile="false">import cxxi.model.behavior.PythonUtilities as PythonUtilities from HTNBehaviors import SendEntityEventDelay from HTNBehaviors import ConvertToJavaList +import simkit.Schedule as Schedule # complete the wait process @@ -485,6 +493,13 @@ else: randVal = PythonUtilities._py_getRandomNumber("UNIFORM", [0.0, 1.0]) randSpd = borg.params_randSpdMin + (borg.params_randSpdVar * randVal) +# check for attack time +if borg.isAttackRun and Schedule.getSimTime() >= borg.params_attackTime: + # attack time clip the list + ind = len(borg.redConvoyDest[state.getCurrentUnit().getName()])-1 + lastName = borg.redConvoyDest[state.getCurrentUnit().getName()][ind] + borg.redConvoyDest[state.getCurrentUnit().getName()]=[lastName] + destName = borg.redConvoyDest[state.getCurrentUnit().getName()][0] del borg.redConvoyDest[state.getCurrentUnit().getName()][0] @@ -494,6 +509,7 @@ borg.delay=1.0 # log data if state.isCommander(): SendEntityEventDelay(info.getMyAssignedName(), "GoalTracker_LogMsg", ["UnitLogger", "UNIT_NAME\tACTION\tDATA", ConvertToJavaList([ state.getCurrentUnitName(), "WAIT_AT_BASE_COMPLETE" "" ])], 0) + </Code> <Import /> </HTNNode> diff --git a/scripts/jump_start.py b/scripts/jump_start.py index 6ac418a686c8e18f2ec2cac21bc62877d5b8055f..843e50b1483fa0ea4e22d16cf9d3c83ce659bc8a 100644 --- a/scripts/jump_start.py +++ b/scripts/jump_start.py @@ -34,10 +34,10 @@ borg.goalPath = "HTN/Trees/" # Scenario Parameters ################################################################################################################################################################# # will the entities move to attack positions at the end of training? -borg.isAttackRun = False +borg.isAttackRun = True # attack time after which all vehicles will go to attack positions # note: This is not an interrupt, convoys will finish what they were doing first -borg.params_attackTime = 10 +borg.params_attackTime = 30 # red training positions borg.redDestinations=["TRAINING01", "TRAINING02", "TRAINING03", "TRAINING04", "TRAINING05", "TRAINING06", "TRAINING07", "TRAINING08", "TRAINING09", "TRAINING10", "TRAINING11", "TRAINING12", ]