| 38 | } |
| 39 | |
| 40 | double LSInterpolator::getReward(const std::vector<Wire> &controlWires, const std::vector<double> &action) { |
| 41 | double maxReward = -9999999; |
| 42 | for (std::vector<Wire>::const_iterator a = controlWires.begin(); a != controlWires.end(); ++a) if (a->reward > maxReward) maxReward = a->reward; |
| 43 | |
| 44 | return weightedSum(controlWires, action, maxReward) / normalize(controlWires, action, maxReward); |
| 45 | } |
| 46 | |
| 47 | double LSInterpolator::rewardDerivative(const std::vector<double> &action, const Wire &wire, const std::vector<Wire> &controlWires) { |
| 48 | double maxReward = -9999999; |
no test coverage detected