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
5c0abaae
Commit
5c0abaae
authored
3 years ago
by
Reeves, David E
Browse files
Options
Downloads
Patches
Plain Diff
* attack logic in
parent
63d6fe06
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/HTN/Trees/Red/ConvoyUnit.xml
+16
-0
16 additions, 0 deletions
scripts/HTN/Trees/Red/ConvoyUnit.xml
scripts/jump_start.py
+2
-2
2 additions, 2 deletions
scripts/jump_start.py
with
18 additions
and
2 deletions
scripts/HTN/Trees/Red/ConvoyUnit.xml
+
16
−
0
View file @
5c0abaae
...
...
@@ -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>
...
...
This diff is collapsed.
Click to expand it.
scripts/jump_start.py
+
2
−
2
View file @
5c0abaae
...
...
@@ -34,10 +34,10 @@ borg.goalPath = "HTN/Trees/"
# Scenario Parameters
#################################################################################################################################################################
# will the entities move to attack positions at the end of training?
borg
.
isAttackRun
=
Fals
e
borg
.
isAttackRun
=
Tru
e
# 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
=
1
0
borg
.
params_attackTime
=
3
0
# red training positions
borg
.
redDestinations
=
[
"
TRAINING01
"
,
"
TRAINING02
"
,
"
TRAINING03
"
,
"
TRAINING04
"
,
"
TRAINING05
"
,
"
TRAINING06
"
,
"
TRAINING07
"
,
"
TRAINING08
"
,
"
TRAINING09
"
,
"
TRAINING10
"
,
"
TRAINING11
"
,
"
TRAINING12
"
,
]
...
...
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