Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CMIS-IADS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Reeves, David E
CMIS-IADS
Commits
170f06ac
Commit
170f06ac
authored
3 years ago
by
Reeves, David E
Browse files
Options
Downloads
Patches
Plain Diff
* send extra units to attack positions
parent
e5258301
No related branches found
Branches containing commit
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/HTN/Trees/Red/RedForceCoordinator.xml
+108
-83
108 additions, 83 deletions
scripts/HTN/Trees/Red/RedForceCoordinator.xml
with
108 additions
and
83 deletions
scripts/HTN/Trees/Red/RedForceCoordinator.xml
+
108
−
83
View file @
170f06ac
...
@@ -18,6 +18,8 @@ borg.redConvoyDest=dict()
...
@@ -18,6 +18,8 @@ borg.redConvoyDest=dict()
borg.redFormsByUnit=dict()
borg.redFormsByUnit=dict()
borg.redUnitStatus=dict()
borg.redUnitStatus=dict()
borg.redWaitingUnits=[]
# for logging
# for logging
borg.redUnitActivity=dict()
borg.redUnitActivity=dict()
borg.redUnitActivityTime=dict()
borg.redUnitActivityTime=dict()
...
@@ -266,89 +268,89 @@ while len(dismounts)>0:
...
@@ -266,89 +268,89 @@ while len(dismounts)>0:
_gt_activeNode.putVar("convoyIndex", 0)
_gt_activeNode.putVar("convoyIndex", 0)
# activate one
# activate one
if borg.params_activateConvoyOne:
al = ArrayList()
al = ArrayList(
)
al.add(borg.params_activateConvoyOne
)
al.add("circle")
al.add("circle")
al.add("FIRE_CONTROL_RADAR")
al.add("FIRE_CONTROL_RADAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
UtilityFuncsExp.scheduleEvent(
UtilityFuncsExp.scheduleEvent(
dm,
dm,
info.getMyAssignedName(),
info.getMyAssignedName(),
"GoalTracker_CreateConvoy",
"GoalTracker_CreateConvoy",
0.001,
0.001,
al)
al)
# activate two
# activate two
if borg.params_activateConvoyTwo:
al = ArrayList()
al = ArrayList(
)
al.add(borg.params_activateConvoyTwo
)
al.add("bigellipse")
al.add("bigellipse")
al.add("FIRE_CONTROL_RADAR")
al.add("FIRE_CONTROL_RADAR")
al.add("FIRE_CONTROL_RADAR")
al.add("FIRE_CONTROL_RADAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
UtilityFuncsExp.scheduleEvent(
UtilityFuncsExp.scheduleEvent(
dm,
dm,
info.getMyAssignedName(),
info.getMyAssignedName(),
"GoalTracker_CreateConvoy",
"GoalTracker_CreateConvoy",
5,
5,
al)
al)
# activate three
# activate three
if borg.params_activateConvoyThree:
al = ArrayList()
al = ArrayList(
)
al.add(borg.params_activateConvoyThree
)
al.add("bigbox")
al.add("bigbox")
al.add("FIRE_CONTROL_RADAR")
al.add("FIRE_CONTROL_RADAR")
al.add("TARGET_ACQ_RADAR")
al.add("TARGET_ACQ_RADAR")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("SPT_VEH")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
al.add("TELAR")
UtilityFuncsExp.scheduleEvent(
UtilityFuncsExp.scheduleEvent(
dm,
dm,
info.getMyAssignedName(),
info.getMyAssignedName(),
"GoalTracker_CreateConvoy",
"GoalTracker_CreateConvoy",
10,
10,
al)
al)
</Code>
</Code>
<Import
/>
<Import
/>
...
@@ -395,6 +397,11 @@ convoyIndex = _gt_activeNode.getVar("convoyIndex")
...
@@ -395,6 +397,11 @@ convoyIndex = _gt_activeNode.getVar("convoyIndex")
# a list of the profiles the are part of this convoy
# a list of the profiles the are part of this convoy
profiles = state.getLastTriggerParams()[0]
profiles = state.getLastTriggerParams()[0]
# grab the activation flag. we still want to create the unit
# but we don't send them out if the activate flag is off
activateFlag = profiles.get(0)
profiles.remove(0)
# formation name to use. formation is the first string in the
# formation name to use. formation is the first string in the
# profile list
# profile list
formName = profiles.get(0)
formName = profiles.get(0)
...
@@ -427,8 +434,10 @@ tu = PythonUnit._py_createTacticalUnitMtry("CONVOY_"+str(convoyIndex), memberLis
...
@@ -427,8 +434,10 @@ tu = PythonUnit._py_createTacticalUnitMtry("CONVOY_"+str(convoyIndex), memberLis
_gt_activeNode.putVar("convoyIndex", convoyIndex+1)
_gt_activeNode.putVar("convoyIndex", convoyIndex+1)
# go to making the convoy move (still in this tree)
# go to making the convoy move (still in this tree)
SendEntityEventDelay(info.getMyAssignedName(), "GoalTracker_MoveConvoy", [tu.getName(), formName], 1)
if activateFlag:
SendEntityEventDelay(info.getMyAssignedName(), "GoalTracker_MoveConvoy", [tu.getName(), formName, "False"], 1)
else:
borg.redWaitingUnits.append([tu.getName(), formName])
</Code>
</Code>
<Import
/>
<Import
/>
...
@@ -493,6 +502,13 @@ elif numDestChance > 0.5:
...
@@ -493,6 +502,13 @@ elif numDestChance > 0.5:
if borg.params_overrideNumDests
>
0:
if borg.params_overrideNumDests
>
0:
numDestinations = borg.params_overrideNumDests
numDestinations = borg.params_overrideNumDests
# check for back unit override
backupUnit = state.getLastTriggerParams()[0].get(2)
if backupUnit == "True":
# this only happens on attack runs so we trick the system into just creating an attack
# position
numDestinations = 0
convoyDests = []
convoyDests = []
for n in range(numDestinations):
for n in range(numDestinations):
destName = borg.redDestinations[0]
destName = borg.redDestinations[0]
...
@@ -534,11 +550,20 @@ if state.getLastTrigger() == "doGoalTracker_StartAttackMove":
...
@@ -534,11 +550,20 @@ if state.getLastTrigger() == "doGoalTracker_StartAttackMove":
<Import
/>
<Import
/>
<HTNNode
AllowMsg=
"true"
Name=
"startAttackMove"
Type=
"INTERRUPT"
>
<HTNNode
AllowMsg=
"true"
Name=
"startAttackMove"
Type=
"INTERRUPT"
>
<Parent>
isMoveConvoy
</Parent>
<Parent>
isMoveConvoy
</Parent>
<Code
IsFile=
"false"
>
heardBefore = _gt_activeNode.getVar("heardAttackMsg")
<Code
IsFile=
"false"
>
import cxxi.model.knowledge.group.holders.NewUnitHolder as NewUnitHolder
heardBefore = _gt_activeNode.getVar("heardAttackMsg")
if heardBefore == 0:
if heardBefore == 0:
printMessage("START ATTACK METHODOLOGY
"
, True)
printMessage("START ATTACK METHODOLOGY
WAITING UNITS:"+str(borg.redWaitingUnits)
, True)
_gt_activeNode.putVar("heardAttackMsg", 1)
_gt_activeNode.putVar("heardAttackMsg", 1)
for unitInfo in borg.redWaitingUnits:
unitName = unitInfo[0]
formName = unitInfo[1]
SendEntityEventDelay(info.getMyAssignedName(), "GoalTracker_MoveConvoy", [unitName, formName, "True"], 1)
</Code>
</Code>
<Import
/>
<Import
/>
</HTNNode>
</HTNNode>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment