I don't know java but I'm pretty sure this stuff is universal so bear with me.
Quote:
I'm not sure if the way I changed getAverageStrategy() to include an inputted array is correct
It works correctly but here are a few thoughts. Since your strategySum is also a class level variable you could just access it directly without having to enter it as a parameter. You use the constant NUM_ACTIONS in the method so it wont work anyway unless your argument is an array of length NUM_ACTIONS. If you wanted the method to work on any array, you need to find out it's length using an arraylength method or as an additional parameter. GetAverageStrategy seems like a bad name, it should just be called normalizeStrategy as that's all its doing. The average strategy in CFR is something specific so that's confusing. I'm pretty sure you need curly braces around that for loop. Also, changing it to two for loops inside the if else statement would be free efficiency (more important in getStrategy, as that's inside the big loop).
Quote:
How does trainer.getAverageStrategy(trainer.strategySum) reference the definition properly? I don't understand why it doesn't work like getAction(strategy) which is much cleaner.
It does work lke getAction if you're talking about the parameters and class variables. In both you're inputting an array as an argument, using it's contents to compute something, and returning the result. If you're referring to the fact that you use trainer.getAverageStrategy but just getAction on its own, it seems to be because you've made an instance of your class in the first case, and you are calling the instance's method. In the second case you're calling the method from within the class's definition, and I guess in Java you don't have to reference the class again to do that.
In my humble opinion I would suggest doing away with the class/global variables completely as they just make it harder to understand what's going on and generally don't help matters much. In getStrategy(strategy) for instance they are just plain conflicting. Create them in the method they are used and pass them around as needed.
For instance, getStrategy and getOpponentStrategy are exactly the same. It should just take a parameter of a regret array and you can enter the opponent's or the hero's as necessary, just like you did in getAction.