Skip to content
Snippets Groups Projects
Commit c7cf0395 authored by Reeves, David E's avatar Reeves, David E
Browse files

* moved speed parameter to jump_start for easier visibility

parent 8146d199
No related branches found
No related tags found
No related merge requests found
......@@ -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(
......
......@@ -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)
......
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment