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
e5258301
Commit
e5258301
authored
3 years ago
by
Reeves, David E
Browse files
Options
Downloads
Patches
Plain Diff
* logic for doing stuff on attack
parent
62cb0e23
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
scripts/HTN/Trees/Red/ConvoyUnit.xml
+7
-2
7 additions, 2 deletions
scripts/HTN/Trees/Red/ConvoyUnit.xml
scripts/HTN/Trees/Red/RedForceCoordinator.xml
+24
-0
24 additions, 0 deletions
scripts/HTN/Trees/Red/RedForceCoordinator.xml
scripts/jump_start.py
+1
-1
1 addition, 1 deletion
scripts/jump_start.py
with
32 additions
and
3 deletions
scripts/HTN/Trees/Red/ConvoyUnit.xml
+
7
−
2
View file @
e5258301
...
...
@@ -15,7 +15,6 @@
<Code
IsFile=
"false"
>
# create data
borg.redNumSetups = dict()
</Code>
<Import
/>
</HTNNode>
...
...
@@ -118,6 +117,12 @@ _gt_activeNode.putVar("moveReason", params.get(0))
_gt_activeNode.putVar("moveDestination", wps[0])
randSpd = params.get(1)
# check if the point we're moving to is an attack position
attackFlag = "ATTACK" in params.get(2)
if attackFlag:
SendEntityEventDelay("RFC", "GoalTracker_StartAttackMove", [state.getCurrentUnitName()], 1.0)
borg.redConvoysWaiting[state.getCurrentUnit().getName()].append(info.getMyAssignedName())
CreateNetworkMove(
...
...
@@ -131,7 +136,7 @@ CreateNetworkMove(
"MOVE",
borg.delay)
borg.delay+=5.0
printMessage("Starting move: "+str(wps)+" Spd: "+str(randSpd), True)
printMessage("Starting move
("+str(attackFlag)+")
: "+str(wps)+" Spd: "+str(randSpd), True)
#####################################################
# set activity to log
...
...
This diff is collapsed.
Click to expand it.
scripts/HTN/Trees/Red/RedForceCoordinator.xml
+
24
−
0
View file @
e5258301
...
...
@@ -28,6 +28,11 @@ borg.redEntityActivityOverride=dict()
borg.randomMoveStartTime=0
borg.redTimeOnStation=dict()
# used to hear the attack msg only once
_gt_activeNode.putVar("heardAttackMsg", 0)
</Code>
<Import
/>
</HTNNode>
...
...
@@ -358,6 +363,7 @@ if borg.params_activateConvoyThree:
goalContainer.getCurrentExecutingStack().addReplanTrigger("GoalTracker_CreateConvoy")
goalContainer.getCurrentExecutingStack().addReplanTrigger("GoalTracker_MoveConvoy")
goalContainer.getCurrentExecutingStack().addReplanTrigger("GoalTracker_ReclaimConvoy")
goalContainer.getCurrentExecutingStack().addReplanTrigger("GoalTracker_StartAttackMove")
</Code>
<Import
/>
</HTNNode>
...
...
@@ -515,6 +521,24 @@ randSpd = 10.0 + (40.0 * randSpd)
SendUnitEventDelay(tu.getName(), "GoalTracker_Assemble", [randSpd], 1)
printMessage("Convoy move: "+str(tu.getName())+" NUM DESTS: "+str(numDestinations)+" LIST: "+str(convoyDests), True)
</Code>
<Import
/>
</HTNNode>
</HTNNode>
<HTNNode
AllowMsg=
"true"
Name=
"isAttackMove"
Type=
"DEFAULT"
>
<Parent>
printGoalTrackerEvent
</Parent>
<Code
IsFile=
"false"
>
if state.getLastTrigger() == "doGoalTracker_StartAttackMove":
_htn_precon_ret=1
</Code>
<Import
/>
<HTNNode
AllowMsg=
"true"
Name=
"startAttackMove"
Type=
"INTERRUPT"
>
<Parent>
isMoveConvoy
</Parent>
<Code
IsFile=
"false"
>
heardBefore = _gt_activeNode.getVar("heardAttackMsg")
if heardBefore == 0:
printMessage("START ATTACK METHODOLOGY", True)
_gt_activeNode.putVar("heardAttackMsg", 1)
</Code>
<Import
/>
</HTNNode>
...
...
This diff is collapsed.
Click to expand it.
scripts/jump_start.py
+
1
−
1
View file @
e5258301
...
...
@@ -30,7 +30,7 @@ entityName = "RFC"
#################################################################################################################################################################
# Scenario Parameters
#################################################################################################################################################################
borg
.
isAttackRun
=
Fals
e
borg
.
isAttackRun
=
Tru
e
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
"
,
]
...
...
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