Package com.poker.analyst.combination

Examples of com.poker.analyst.combination.AvailableCombinationsTools


 
  @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();
       
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;
     
   
    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);         
    }
     
    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");
    }
    */
       
       
        // 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;                               
        wasRaiseOnPrevRound   = !(FloatEx.equals4(boardPrev.getPlayers().get(boardPrev.getHero()).getBet(), boardPrev.getBigBlind()));
        wasRaiseBeforeHero    = !(FloatEx.equals4(board.getTotal(),0));                 
       
        if (topCombination instanceof Pair)
      topCombination = act.analyzePair(topCombination,true,true,CardFace.FOUR,CardFace.JACK);
                       
        float total    = dfs.getTotalBank();
       
        float raiseAmount = 0f;
        float koeff = 1.0f;
View Full Code Here

  }

  @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);   
      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);         
    }
     
    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");
    }
        */
       
        // 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;                               
        wasRaiseOnPrevRound   = !(FloatEx.equals4(boardPrev.getPlayers().get(boardPrev.getHero()).getBet(), boardPrev.getBigBlind()));
        wasRaiseBeforeHero    = !(FloatEx.equals4(board.getTotal(),0));                 
       
        if (topCombination instanceof Pair)
      topCombination = act.analyzePair(topCombination,true,true,CardFace.FOUR,CardFace.JACK);
                       
        float total    = dfs.getTotalBank();
       
        float raiseAmount = 0f;
        float koeff = 1.0f;
View Full Code Here

    //}while(ta.m_ac.getFullHouses() == null || ta.m_ac.getFullHouses().size() < 2);     
    ta.viewCards();
    ta.viewCombinations();
    System.out.println("=================TopCombination========================= ");
    //System.out.println("op= " + i);
    AvailableCombinationsTools act = new AvailableCombinationsTools(ta.m_ac)
    Combination comb = act.getTopCombination();
    //Hand hand = new Hand(dfs.getCurrentBoard().getPlayingCards().getPlayerCards());
   
    Combination topCombination = act.getTopCombination();
   
    Flush    flushDraw     = act.analyzeFlush(true)
    Straight straightDraw  = act.analyzeStraight(true);
   
    if (ta.m_ac.getFlushDraws() != null && ta.m_ac.getFlushDraws().size() != 0 &&
      flushDraw == null)
      if (topCombination.getCombinationValue() < new Flush().getCombinationValue())
        topCombination = null;
    if (ta.m_ac.getStraightOesds() != null && ta.m_ac.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);   
     
     
    }
    
    System.out.println("TopCombinat : " + topCombination);
View Full Code Here

TOP

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

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.