| 205 | } |
| 206 | |
| 207 | vector<float> PCfrSolver::cfr(int player, shared_ptr<GameTreeNode> node, const vector<float> &reach_probs, int iter, |
| 208 | uint64_t current_board,int deal) { |
| 209 | switch(node->getType()) { |
| 210 | case GameTreeNode::ACTION: { |
| 211 | shared_ptr<ActionNode> action_node = std::dynamic_pointer_cast<ActionNode>(node); |
| 212 | return actionUtility(player, action_node, reach_probs, iter, current_board,deal); |
| 213 | }case GameTreeNode::SHOWDOWN: { |
| 214 | shared_ptr<ShowdownNode> showdown_node = std::dynamic_pointer_cast<ShowdownNode>(node); |
| 215 | return showdownUtility(player, showdown_node, reach_probs, iter, current_board,deal); |
| 216 | }case GameTreeNode::TERMINAL: { |
| 217 | shared_ptr<TerminalNode> terminal_node = std::dynamic_pointer_cast<TerminalNode>(node); |
| 218 | return terminalUtility(player, terminal_node, reach_probs, iter, current_board,deal); |
| 219 | }case GameTreeNode::CHANCE: { |
| 220 | shared_ptr<ChanceNode> chance_node = std::dynamic_pointer_cast<ChanceNode>(node); |
| 221 | return chanceUtility(player, chance_node, reach_probs, iter, current_board,deal); |
| 222 | }default: |
| 223 | throw runtime_error("node type unknown"); |
| 224 | } |
| 225 | } |
| 226 | |
| 227 | vector<float> |
| 228 | PCfrSolver::chanceUtility(int player, shared_ptr<ChanceNode> node, const vector<float> &reach_probs, int iter, |
no test coverage detected