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
c7cf0395
Commit
c7cf0395
authored
3 years ago
by
Reeves, David E
Browse files
Options
Downloads
Patches
Plain Diff
* moved speed parameter to jump_start for easier visibility
parent
8146d199
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
+27
-6
27 additions, 6 deletions
scripts/HTN/Trees/Red/ConvoyUnit.xml
scripts/HTN/Trees/Red/RedForceCoordinator.xml
+9
-2
9 additions, 2 deletions
scripts/HTN/Trees/Red/RedForceCoordinator.xml
scripts/jump_start.py
+12
-0
12 additions, 0 deletions
scripts/jump_start.py
with
48 additions
and
8 deletions
scripts/HTN/Trees/Red/ConvoyUnit.xml
+
27
−
6
View file @
c7cf0395
...
...
@@ -182,8 +182,15 @@ if len(borg.redConvoysWaiting[state.getCurrentUnit().getName()])==0:
if moveReason == "ASSEMBLE":
# let the unit know TODO: THis should probably come from the RFC
randSpd = PythonUtilities._py_getRandomNumber("UNIFORM", [0.0, 1.0])
randSpd = 10.0 + (40.0 * randSpd)
# randSpd = PythonUtilities._py_getRandomNumber("UNIFORM", [0.0, 1.0])
# randSpd = 10.0 + (40.0 * randSpd)
# get a random speed
if borg.params_randSpdOverride
>
0:
randSpd = borg.params_randSpdOverride
else:
randVal = PythonUtilities._py_getRandomNumber("UNIFORM", [0.0, 1.0])
randSpd = borg.params_randSpdMin + (borg.params_randSpdVar * randVal)
destName = borg.redConvoyDest[state.getCurrentUnit().getName()][0]
del borg.redConvoyDest[state.getCurrentUnit().getName()][0]
...
...
@@ -398,8 +405,15 @@ elif len(borg.redConvoyDest[state.getCurrentUnit().getName()])==0:
else:
# go to next destination
randSpd = PythonUtilities._py_getRandomNumber("UNIFORM", [0.0, 1.0])
randSpd = 10.0 + (40.0 * randSpd)
# randSpd = PythonUtilities._py_getRandomNumber("UNIFORM", [0.0, 1.0])
# randSpd = 10.0 + (40.0 * randSpd)
# get a random speed
if borg.params_randSpdOverride
>
0:
randSpd = borg.params_randSpdOverride
else:
randVal = PythonUtilities._py_getRandomNumber("UNIFORM", [0.0, 1.0])
randSpd = borg.params_randSpdMin + (borg.params_randSpdVar * randVal)
destName = borg.redConvoyDest[state.getCurrentUnit().getName()][0]
del borg.redConvoyDest[state.getCurrentUnit().getName()][0]
...
...
@@ -436,8 +450,15 @@ printMessage("Need to return", True)
borg.redUnitStatus[state.getCurrentUnitName()]=0
randSpd = PythonUtilities._py_getRandomNumber("UNIFORM", [0.0, 1.0])
randSpd = 10.0 + (40.0 * randSpd)
#randSpd = PythonUtilities._py_getRandomNumber("UNIFORM", [0.0, 1.0])
#randSpd = 10.0 + (40.0 * randSpd)
# get a random speed
if borg.params_randSpdOverride
>
0:
randSpd = borg.params_randSpdOverride
else:
randVal = PythonUtilities._py_getRandomNumber("UNIFORM", [0.0, 1.0])
randSpd = borg.params_randSpdMin + (borg.params_randSpdVar * randVal)
for m in state.getCurrentUnit().getMembers():
CreateNetworkMove(
...
...
This diff is collapsed.
Click to expand it.
scripts/HTN/Trees/Red/RedForceCoordinator.xml
+
9
−
2
View file @
c7cf0395
...
...
@@ -534,8 +534,15 @@ borg.redConvoyDest[tu.getName()] = convoyDests
borg.redFormsByUnit[tu.getName()] = formName
# randomize the speed
randSpd = PythonUtilities._py_getRandomNumber("UNIFORM", [0.0, 1.0])
randSpd = 10.0 + (40.0 * randSpd)
#randSpd = PythonUtilities._py_getRandomNumber("UNIFORM", [0.0, 1.0])
#randSpd = 10.0 + (40.0 * randSpd)
# get a random speed
if borg.params_randSpdOverride
>
0:
randSpd = borg.params_randSpdOverride
else:
randVal = PythonUtilities._py_getRandomNumber("UNIFORM", [0.0, 1.0])
randSpd = borg.params_randSpdMin + (borg.params_randSpdVar * randVal)
# start the assembly
SendUnitEventDelay(tu.getName(), "GoalTracker_Assemble", [randSpd], 1)
...
...
This diff is collapsed.
Click to expand it.
scripts/jump_start.py
+
12
−
0
View file @
c7cf0395
...
...
@@ -50,6 +50,18 @@ borg.params_redSetupTimeMin = 10
# amount of random time added to min time
borg
.
params_redSetupTimeVar
=
10
# here you can setup the random speed range
# currently ANY movement will use this random speed
# there is no differentiation between the random speed when
# moving to assemble vs the random speed when moving to attack
# values are m/s
borg
.
params_randSpdMin
=
10
# this is the miniumum speed
borg
.
params_randSpdVar
=
40
# this is the random amount to add to the minimum
# if this value is greater than zero it will substitute this value for all
# speeds instead of rolling for a random speed
borg
.
params_randSpdOverride
=
-
1
# used to for testing, these are normally all true
# but if you want to just run a single convoy or specific
# convoys you can turn them on and off here.
...
...
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