diff --git a/scripts/HTN/Trees/Red/ConvoyUnit.xml b/scripts/HTN/Trees/Red/ConvoyUnit.xml index e2cea723fe329e357d6b8e235f51fac6f29c4e24..09a952bcb9092bd3c5afdcbea7c3e3aa443f9413 100644 --- a/scripts/HTN/Trees/Red/ConvoyUnit.xml +++ b/scripts/HTN/Trees/Red/ConvoyUnit.xml @@ -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( diff --git a/scripts/HTN/Trees/Red/RedForceCoordinator.xml b/scripts/HTN/Trees/Red/RedForceCoordinator.xml index 6a7184098f1d6bec2a600359821bd27cb192190c..cf8a8067301763960f7017e427d7f151d185dea4 100644 --- a/scripts/HTN/Trees/Red/RedForceCoordinator.xml +++ b/scripts/HTN/Trees/Red/RedForceCoordinator.xml @@ -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) diff --git a/scripts/jump_start.py b/scripts/jump_start.py index ff1c72410c1f3dfde3bb94ec69e23143f40e0d72..902e7d7b8633851b1ab4caa0c903c99c63969101 100644 --- a/scripts/jump_start.py +++ b/scripts/jump_start.py @@ -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.