This is a new input substrate that tracks unit locations, but assigns scores to them in accordance with the building gradient from #418.
Here is how you will accomplish this.
1) Generalize AllOfPlayerTypeSubstrate so that different units can have different scores (I've done this in the upcoming commit)
2) Extend AllOfPlayerTypeSubstrate to make a new class that is the same, overrides the new scoreForUnit method.
3) To do this, the new class you make (AllOfPlayerTypeOnGradientSubstrate) must also construct an instance of BaseGradientSubstrate (as a private instance variable). The AllOfPlayerTypeOnGradientSubstrate class can call the getInputs method of BaseGradientSubstrate whenever it gets a new game state, and then use the resulting gradient grid when computing the value to return from scoreForUnit (since units can tell you their x/y location)
This is a new input substrate that tracks unit locations, but assigns scores to them in accordance with the building gradient from #418.
Here is how you will accomplish this. 1) Generalize AllOfPlayerTypeSubstrate so that different units can have different scores (I've done this in the upcoming commit) 2) Extend AllOfPlayerTypeSubstrate to make a new class that is the same, overrides the new scoreForUnit method. 3) To do this, the new class you make (AllOfPlayerTypeOnGradientSubstrate) must also construct an instance of BaseGradientSubstrate (as a private instance variable). The AllOfPlayerTypeOnGradientSubstrate class can call the getInputs method of BaseGradientSubstrate whenever it gets a new game state, and then use the resulting gradient grid when computing the value to return from scoreForUnit (since units can tell you their x/y location)