Esempio n. 1
0
  uptr<Action> chooseGreedy(State *state) {
    double bestValue;
    Action *bestAction = nullptr;

    for (auto &av : stateActions[state]) {
      // if (temperature < 0.001) {
      //   av->action->Output(cout);
      //   cout << "av: " << av->value << endl;
      // }

      if (bestAction == nullptr || av->value > bestValue) {
        bestValue = av->value;
        bestAction = av->action.get();
      }
    }

    assert(bestAction != nullptr);
    return bestAction->Clone();
  }