private static double calculateOneChance() { if (GameStateWrapper.ourCard(1).Index == GameStateWrapper.ourCard(2).Index) { return(1); } else { if (GameStateWrapper.THGS.Round == TexasHoldEmRound.Preflop) { return(0.422); } else if (GameStateWrapper.THGS.Round.Equals("Flop") && hasOneChance("Flop")) { return(0.23); } else if (GameStateWrapper.THGS.Round.Equals("Turn") && hasOneChance("Turn")) { return(0.19); } else if (GameStateWrapper.THGS.Round.Equals("River") && hasOneChance("River")) { return(0); } else { return(1); } } }
private static bool hasOneChance(string state) { if (state == "Flop") { if (GameStateWrapper.ourCard(1) == GameStateWrapper.tableCard(1) || GameStateWrapper.ourCard(1) == GameStateWrapper.tableCard(2) || GameStateWrapper.ourCard(1) == GameStateWrapper.tableCard(3) || GameStateWrapper.ourCard(2) == GameStateWrapper.tableCard(1) || GameStateWrapper.ourCard(2) == GameStateWrapper.tableCard(2) || GameStateWrapper.ourCard(1) == GameStateWrapper.tableCard(3)) { return(false); } else { return(true); } } else if (state == "Turn") { if (GameStateWrapper.ourCard(1) == GameStateWrapper.tableCard(4) || GameStateWrapper.ourCard(2) == GameStateWrapper.tableCard(4)) { return(false); } else { return(true); } } else if (state == "River") { if (GameStateWrapper.ourCard(1) == GameStateWrapper.tableCard(5) || GameStateWrapper.ourCard(2) == GameStateWrapper.tableCard(5)) { return(false); } else { return(true); } } else { return(false); } }
private static double shownValuation(Gene gene, int state) { double sum = 0; for (int i = 0; i < state; i++) { sum += gene.get(6 + (2 * i)) * similarity(GameStateWrapper.tableCard(i + 1), GameStateWrapper.ourCard(1)) + gene.get(7 + (2 * i)) * similarity(GameStateWrapper.tableCard(i + 1), GameStateWrapper.ourCard(2)); } return(sum); }
public static double handValuation(Gene gene) { return(gene.get(3) * (double)GameStateWrapper.ourCard(1).Index + gene.get(4) * (double)GameStateWrapper.ourCard(2).Index + gene.get(5) * similarity(GameStateWrapper.ourCard(1), GameStateWrapper.ourCard(2))); }