Package com.poker.analyst.combination

Examples of com.poker.analyst.combination.AvailableCombinations


  }
 
  @Override
  public AnalystResult getFlopReaction(DataForStrategy dfs) {   
   
    AvailableCombinations availcomb =  new AvailableCombinations(dfs.getCurrentBoard().getPlayingCards());
    AvailableCombinationsTools act = new AvailableCombinationsTools(availcomb);
    Hand hand = new Hand(dfs.getCurrentBoard().getPlayingCards().getPlayerCards());
       
    Combination topCombination = act.getTopCombination();
   
    Flush    flushDraw     = act.analyzeFlush(true)
    Straight straightDraw  = act.analyzeStraight(true);
   
    if (availcomb.getFlushDraws() != null && availcomb.getFlushDraws().size() != 0 &&
      flushDraw == null)
      if (topCombination.getCombinationValue() < new Flush().getCombinationValue())
        topCombination = null;
    if (availcomb.getStraightOesds() != null && availcomb.getStraightOesds().size() != 0 &&
        straightDraw == null)
        if (topCombination.getCombinationValue() < new Straight().getCombinationValue())
          topCombination = null;
     
     
    topCombination = act.cutNotHeroCombination(topCombination);   
    if (topCombination != null){
             
      if (topCombination instanceof HighCard)
        topCombination = null;
     
      if (topCombination instanceof Flush)
        topCombination = act.analyzeFlush(false);
      else
      if (topCombination instanceof Straight)
        topCombination = act.analyzeStraight(false);   
      if (topCombination instanceof TwoPairs)
        topCombination = act.analyzeTwoPair(topCombination,true);   
     
     
    }
     
    Board board = dfs.getCurrentBoard();
        Board boardPrev = dfs.getPrevBoard();
        /*
        if (!heroName.equals(board.getPlayers().get(board.getHero()).getName().trim())){
      return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "ONLYFOLD");
    }*/
       
       
        System.out.println(board.getCurrentRound()+ ":  " + topCombination);
        logger.log(Level.WARNING,"StrDraw:  " + straightDraw);
        logger.log(Level.WARNING,"FlushDraw:  " + flushDraw);
        // if on previous round hero stack was calculated incorrectly
        if (board.getPlayers().get(board.getHero()).getStack() < board.getBigBlind() * 2)
      return new AnalystResult(UIReaction.UIR_ACTION_RAISE , StringEx.float2str2(dfs.getPlayerMoney()));
       
        boolean wasRaiseOnPrevRound = false;
        boolean wasRaiseBeforeHero  = false;           
        boolean isFirstCircle    = false;
        boolean wasRaiseHero    = false;
               
        wasRaiseOnPrevRound   = !(FloatEx.equals4(boardPrev.getPlayers().get(boardPrev.getHero()).getBet(), boardPrev.getBigBlind()));
        wasRaiseBeforeHero    = !(FloatEx.equals4(board.getTotal(),0));                 
        wasRaiseHero        = !(FloatEx.equals4(board.getPlayers().get(board.getHero()).getBet(),0));
        isFirstCircle         = !(FloatEx.equals4(board.getPlayers().get(board.getHero()).getBet(),0)) ;
       
       
       
        if (wasRaiseOnPrevRound){
          if (topCombination instanceof Pair)
        topCombination = act.analyzePair(topCombination,true,true,CardFace.FOUR,CardFace.JACK);
        }else
        {
          if (topCombination instanceof Pair)
        topCombination = act.analyzePair(topCombination,false,true,CardFace.JACK,CardFace.JACK);
        }
               
        float heroMoney = dfs.getPlayerMoney();
        float total    = dfs.getTotalBank();
       
        float raiseAmount = 0f;
        float koeff = 2.0f/3.0f;
       
       
        //кто-то ререйзнул
        List<CardValue> cardvalues;
        if (wasRaiseHero ){
          if (dfs.getPlayerMoney() > board.getPlayers().get(board.getHero()).getBet()){
            if (availcomb.getAllCards().contains(new Card(Suit.clubs, CardFace.ACE)) ||
            availcomb.getAllCards().contains(new Card(Suit.diamonds, CardFace.ACE)) ||
            availcomb.getAllCards().contains(new Card(Suit.spades, CardFace.ACE)) ||
            availcomb.getAllCards().contains(new Card(Suit.hearts, CardFace.ACE))){
             
           
              if (topCombination instanceof Pair){
                // if pair is middle && Ace exists => fold
                //cardvalues = act.getCardValuesFromComb(topCombination, hand);               
View Full Code Here


      }
      return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "");     
  }
  @Override
  public AnalystResult getTurnReaction(DataForStrategy dfs) {
    AvailableCombinations availcomb =  new AvailableCombinations(dfs.getCurrentBoard().getPlayingCards());
    AvailableCombinationsTools act = new AvailableCombinationsTools(availcomb);
    Hand hand = new Hand(dfs.getCurrentBoard().getPlayingCards().getPlayerCards());
       
    Combination topCombination = act.getTopCombination();
   
    Flush    flushDraw     = act.analyzeFlush(true)
    Straight straightDraw  = act.analyzeStraight(true);
   
    if (availcomb.getFlushDraws() != null && availcomb.getFlushDraws().size() != 0 &&
        flushDraw == null)
        if (topCombination.getCombinationValue() < new Flush().getCombinationValue())
          topCombination = null;
    if (availcomb.getStraightOesds() != null && availcomb.getStraightOesds().size() != 0 &&
        straightDraw == null)
        if (topCombination.getCombinationValue() < new Straight().getCombinationValue())
          topCombination = null;
     
   
View Full Code Here

      return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "");
  }

  @Override
  public AnalystResult getRiverReaction(DataForStrategy dfs) {
    AvailableCombinations availcomb =  new AvailableCombinations(dfs.getCurrentBoard().getPlayingCards());
    AvailableCombinationsTools act = new AvailableCombinationsTools(availcomb);
    Hand hand = new Hand(dfs.getCurrentBoard().getPlayingCards().getPlayerCards());
       
    Combination topCombination = act.getTopCombination();
   
   
    Flush    flushDraw     = act.analyzeFlush(true)
    Straight straightDraw  = act.analyzeStraight(true);
   
    if (availcomb.getFlushDraws() != null && availcomb.getFlushDraws().size() != 0 &&
        flushDraw == null)
        if (topCombination.getCombinationValue() < new Flush().getCombinationValue())
          topCombination = null;
    if (availcomb.getStraightOesds() != null && availcomb.getStraightOesds().size() != 0 &&
        straightDraw == null)
        if (topCombination.getCombinationValue() < new Straight().getCombinationValue())
          topCombination = null;
   
    topCombination = act.cutNotHeroCombination(topCombination);   
View Full Code Here

    TestAvailableCombinations ta = new TestAvailableCombinations();
    int i = 0
    do{
      i++;
      ta.plCards = TestOdds.getPlayingCards(5);
      ta.m_ac = new AvailableCombinations(ta.plCards);

    }while(ta.m_ac.getStraightOesds() == null && false);
    //}while(ta.m_ac.getFullHouses() == null || ta.m_ac.getFullHouses().size() < 2);     
    ta.viewCards();
    ta.viewCombinations();
View Full Code Here

    System.out.println("StraightDraw: " + straightDraw);
   
 

  public AvailableCombinations CountAvailableCombinations(PlayingCards plCards){
    AvailableCombinations m_ac = new AvailableCombinations(plCards);
   
    return m_ac;
  }
View Full Code Here

TOP

Related Classes of com.poker.analyst.combination.AvailableCombinations

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.