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
afcca69d
Commit
afcca69d
authored
3 years ago
by
Reeves, David E
Browse files
Options
Downloads
Patches
Plain Diff
* training and attack positions
parent
d20defa8
No related branches found
Branches containing commit
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
+4
-3
4 additions, 3 deletions
scripts/HTN/Trees/Red/ConvoyUnit.xml
scripts/HTN/Trees/Red/RedForceCoordinator.xml
+11
-2
11 additions, 2 deletions
scripts/HTN/Trees/Red/RedForceCoordinator.xml
scripts/jump_start.py
+5
-0
5 additions, 0 deletions
scripts/jump_start.py
with
20 additions
and
5 deletions
scripts/HTN/Trees/Red/ConvoyUnit.xml
+
4
−
3
View file @
afcca69d
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
scripts/HTN/Trees/Red/RedForceCoordinator.xml
+
11
−
2
View file @
afcca69d
...
@@ -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>
...
...
This diff is collapsed.
Click to expand it.
scripts/jump_start.py
+
5
−
0
View file @
afcca69d
...
@@ -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
...
...
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