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

* training and attack positions

parent d20defa8
No related branches found
No related tags found
No related merge requests found
...@@ -374,10 +374,11 @@ if borg.redNumSetups[state.getCurrentUnitName()] > 1: # check against 1 becau ...@@ -374,10 +374,11 @@ if borg.redNumSetups[state.getCurrentUnitName()] > 1: # check against 1 becau
borg.redUnitStatus[state.getCurrentUnitName()] = 0 borg.redUnitStatus[state.getCurrentUnitName()] = 0
elif len(borg.redConvoyDest[state.getCurrentUnit().getName()])==0: elif len(borg.redConvoyDest[state.getCurrentUnit().getName()])==0:
# no more destinations go home # no more destinations go home if it's not an attack run
SendEntityEventDelay(info.getMyAssignedName(), "GoalTracker_ConvoyReturn", [], rn)
printMessage("Convoy pack up complete: "+str(state.getCurrentUnitName()), True) printMessage("Convoy pack up complete: "+str(state.getCurrentUnitName()), True)
borg.delay=0 if not borg.isAttackRun:
SendEntityEventDelay(info.getMyAssignedName(), "GoalTracker_ConvoyReturn", [], rn)
borg.delay=0
else: else:
# go to next destination # go to next destination
......
...@@ -23,7 +23,8 @@ borg.redUnitActivity=dict() ...@@ -23,7 +23,8 @@ borg.redUnitActivity=dict()
borg.redUnitActivityTime=dict() borg.redUnitActivityTime=dict()
borg.redEntityActivityOverride=dict() borg.redEntityActivityOverride=dict()
borg.redDestinations=["PATH_DEST1", "PATH_DEST2","PATH_DEST3","PATH_DEST4","PATH_DEST5","PATH_DEST6","PATH_DEST7","PATH_DEST8","PATH_DEST9"] #borg.redDestinations=["PATH_DEST1", "PATH_DEST2","PATH_DEST3","PATH_DEST4","PATH_DEST5","PATH_DEST6","PATH_DEST7","PATH_DEST8","PATH_DEST9"]
borg.randomMoveStartTime=0 borg.randomMoveStartTime=0
borg.redTimeOnStation=dict() borg.redTimeOnStation=dict()
...@@ -458,6 +459,7 @@ formName = borg.redFormsByUnit[unit.getName()] ...@@ -458,6 +459,7 @@ formName = borg.redFormsByUnit[unit.getName()]
<Parent>isMoveConvoy</Parent> <Parent>isMoveConvoy</Parent>
<Code IsFile="false">import cxxi.model.knowledge.group.holders.NewUnitHolder as NewUnitHolder <Code IsFile="false">import cxxi.model.knowledge.group.holders.NewUnitHolder as NewUnitHolder
from HTNBehaviors import SendUnitEventDelay from HTNBehaviors import SendUnitEventDelay
from HTNBehaviors import GetRandomInt
import cxxi.model.behavior.PythonUtilities as PythonUtilities import cxxi.model.behavior.PythonUtilities as PythonUtilities
# get the unit name (first trigger param) # get the unit name (first trigger param)
...@@ -492,6 +494,13 @@ for n in range(numDestinations): ...@@ -492,6 +494,13 @@ for n in range(numDestinations):
borg.redDestinations.append(destName) borg.redDestinations.append(destName)
convoyDests.append(destName) convoyDests.append(destName)
# if it's an attack run (set in jump start) then the final destination will be a random
# attack position
if borg.isAttackRun:
attackIndex = int(GetRandomInt(0, len(borg.redAttackDestinations)-1))
attackPoint = borg.redAttackDestinations[attackIndex]
convoyDests.append(attackPoint)
# set the convoys destination and formation # set the convoys destination and formation
# in the borg # in the borg
#borg.redConvoyDest[tu.getName()] = destName #borg.redConvoyDest[tu.getName()] = destName
...@@ -505,7 +514,7 @@ randSpd = 10.0 + (40.0 * randSpd) ...@@ -505,7 +514,7 @@ randSpd = 10.0 + (40.0 * randSpd)
# start the assembly # start the assembly
SendUnitEventDelay(tu.getName(), "GoalTracker_Assemble", [randSpd], 1) SendUnitEventDelay(tu.getName(), "GoalTracker_Assemble", [randSpd], 1)
printMessage("Convoy move: "+str(tu.getName())+" NUM DESTS: "+str(numDestinations), True) printMessage("Convoy move: "+str(tu.getName())+" NUM DESTS: "+str(numDestinations)+" LIST: "+str(convoyDests), True)
</Code> </Code>
<Import /> <Import />
</HTNNode> </HTNNode>
......
...@@ -30,6 +30,11 @@ entityName = "RFC" ...@@ -30,6 +30,11 @@ entityName = "RFC"
################################################################################################################################################################# #################################################################################################################################################################
# Scenario Parameters # Scenario Parameters
################################################################################################################################################################# #################################################################################################################################################################
borg.isAttackRun = False
borg.redDestinations=["TRAINING01", "TRAINING02", "TRAINING03", "TRAINING04", "TRAINING05", "TRAINING06", "TRAINING07", "TRAINING08", "TRAINING09", "TRAINING10", "TRAINING11", "TRAINING12", ]
borg.redAttackDestinations=["ATTACK01", "ATTACK02", "ATTACK03", "ATTACK04", "ATTACK05", "ATTACK06", "ATTACK07", "ATTACK08", "ATTACK09", "ATTACK10", "ATTACK11", "ATTACK12", ]
borg.params_redNumSetups = 1 borg.params_redNumSetups = 1
borg.params_redSetupTimeMin = 10 borg.params_redSetupTimeMin = 10
borg.params_redSetupTimeVar = 10 borg.params_redSetupTimeVar = 10
......
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