Examples of AnalystResult


Examples of com.poker.analyst.AnalystResult

          }
        raiseAmount = FloatEx.cutFloat2(new Float(maxBet *(3 + tmp)));
        callers = tmp;                           
      }else{
        if (checkHandForHSet(heroHand,1))
          return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(board.getPlayers().get(board.getHero()).getStack()));         
      }         
    }
    else{
      raiseAmount = FloatEx.cutFloat2(new Float(bb *(4 + limpersCount) ) );
    }
   
    if (isFirstCircle){
      switch (board.getPosition()) {
        case EARLY_POSITION:                             
          // no raises
          if (board.getNumOfRaises() == 0){           
            if (checkHandForHSet(heroHand,11) ||
              checkHandForHSet(heroHand,12) ||
              checkHandForHSet(heroHand,21))         
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
          }else
          if (board.getNumOfRaises() == 1){
            // one raise
            if (callers == 0){
              if (checkHandForHSet(heroHand,11) ||              
                checkHandForHSet(heroHand,12))         
                return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));

              // call-20
              if ((checkHandForHSet(heroHand,12) || checkHandForHSet(heroHand,13)) &&
                (stackOfFirstRaiser > 20 * maxBet &&
                board.getPlayers().get(board.getHero()).getStack() > maxBet))
                return new AnalystResult(UIReaction.UIR_ACTION_CALL, "");                                                                 
             
            }else{
              if (checkHandForHSet(heroHand,11) ||
                checkHandForHSet(heroHand,12) ||
                checkHandForHSet(heroHand,21))         
                return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
          }else{
            if (checkHandForHSet(heroHand,1))
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
          }
         
          return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "");

                 
        case MIDDLE_POSITION: 
          // no raises
          if (board.getNumOfRaises() == 0){           
            if (checkHandForHSet(heroHand,11) ||
              checkHandForHSet(heroHand,22) ||
              checkHandForHSet(heroHand,21) ||
              checkHandForHSet(heroHand,12))         
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
          }else
          if (board.getNumOfRaises() == 1){
            // one raise
            if (callers ==0){
              if (checkHandForHSet(heroHand,11) ||               
                checkHandForHSet(heroHand,21))
                         
                return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
             
              // call-20
              if ((checkHandForHSet(heroHand,12) || checkHandForHSet(heroHand,13)) &&
                (stackOfFirstRaiser > 20 * maxBet &&
                board.getPlayers().get(board.getHero()).getStack() > maxBet))
                return new AnalystResult(UIReaction.UIR_ACTION_CALL, "");                                     
             
            }else{
              if (checkHandForHSet(heroHand,11) ||
                checkHandForHSet(heroHand,12) ||
                checkHandForHSet(heroHand,21))         
                return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
             
              if (checkHandForHSet(heroHand,13) ||
                checkHandForHSet(heroHand,31) ||
                checkHandForHSet(heroHand,33) )         
                return new AnalystResult(UIReaction.UIR_ACTION_CALL, "");
            }
          }else{
            if (checkHandForHSet(heroHand,1))
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
          }
         
          return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "");
        case LAST_POSITION:  
          // no raises
          if (board.getNumOfRaises() == 0){           
            if (checkHandForHSet(heroHand,11) ||
              checkHandForHSet(heroHand,12) || 
              checkHandForHSet(heroHand,13) ||
              checkHandForHSet(heroHand,21) ||
              checkHandForHSet(heroHand,22) ||
              checkHandForHSet(heroHand,23) ||
              checkHandForHSet(heroHand,31) ||
              checkHandForHSet(heroHand,32) ||
              checkHandForHSet(heroHand,33))
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
          }else
          if (board.getNumOfRaises() == 1){
            // one raise
            if (callers ==0){             
              if (checkHandForHSet(heroHand,11) ||               
                checkHandForHSet(heroHand,21))                         
                return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
             
              // call-20
              if ((checkHandForHSet(heroHand,12) || checkHandForHSet(heroHand,13)) &&
                (stackOfFirstRaiser > 20 * maxBet &&
                board.getPlayers().get(board.getHero()).getStack() > maxBet))
                return new AnalystResult(UIReaction.UIR_ACTION_CALL, "");                                     
             
            }else{
              if (checkHandForHSet(heroHand,11) ||               
                checkHandForHSet(heroHand,12) ||
                checkHandForHSet(heroHand,21) ||               
                checkHandForHSet(heroHand,22) )                         
                return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
             
              if (checkHandForHSet(heroHand,13) ||
                checkHandForHSet(heroHand,23) ||
                checkHandForHSet(heroHand,31) ||
                checkHandForHSet(heroHand,33) )         
                return new AnalystResult(UIReaction.UIR_ACTION_CALL, "");
            }
          }else{
            if (checkHandForHSet(heroHand,1))
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
          }
         
          return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "");
                   
        case BLINDS:      
          // no raises
          if (board.getNumOfRaises() == 0){           
            if (checkHandForHSet(heroHand,11) ||
              checkHandForHSet(heroHand,12) || 
              checkHandForHSet(heroHand,21) ||
              checkHandForHSet(heroHand,22) ||
              checkHandForHSet(heroHand,23) ||
              checkHandForHSet(heroHand,31) ||
              checkHandForHSet(heroHand,32))
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
          }else
          if (board.getNumOfRaises() == 1){
            // one raise
            if (callers ==0){             
              if (checkHandForHSet(heroHand,11) ||               
                checkHandForHSet(heroHand,21))                         
                return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
             
              // call-20
              if ((checkHandForHSet(heroHand,12) || checkHandForHSet(heroHand,13)) &&
                (stackOfFirstRaiser > 20 * maxBet &&
                board.getPlayers().get(board.getHero()).getStack() > maxBet))
                return new AnalystResult(UIReaction.UIR_ACTION_CALL, "");                                   
             
            }else{
              if (checkHandForHSet(heroHand,11) ||               
                checkHandForHSet(heroHand,12) ||
                checkHandForHSet(heroHand,21))                                       
                  return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
             
              if (checkHandForHSet(heroHand,13) ||
                checkHandForHSet(heroHand,22) ||
                checkHandForHSet(heroHand,23) ||
                checkHandForHSet(heroHand,31) ||
                checkHandForHSet(heroHand,32) ||
                checkHandForHSet(heroHand,33) )         
                return new AnalystResult(UIReaction.UIR_ACTION_CALL, "");
            }
          }else{
            if (checkHandForHSet(heroHand,1))
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
          }
         
          return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "");
        default: System.err.println("�� ���������� �������");
          break;
      }  
    }else{
      if (checkHandForHSet(heroHand,1))
        return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
     
      if (board.needAmountToCall() < 1.1 * bb)
        return new AnalystResult(UIReaction.UIR_ACTION_CALL, "");     
     
      if (board.getPlayers().get(board.getHero()).getStack() < 2 * bb)
        return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(board.getPlayers().get(board.getHero()).getStack()));
     
      return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "");
    }
   
    return null;
  }
View Full Code Here

Examples of com.poker.analyst.AnalystResult

    return result;
  }

  @Override
  public AnalystResult isNeedRebuy(DataForStrategy dfs) {
    return new AnalystResult(null, null);
  }
View Full Code Here

Examples of com.poker.analyst.AnalystResult

    if (board.isFirstAuction()){
      isFirstCircle = true;     
      if (!board.getPlayers().get(board.getHero()).getName().trim().equals("") &&
        !board.getPlayers().get(board.getHero()).getName().trim().equals(heroName)){
        logger.log(Level.WARNING,"REASON: heroname != " + board.getPlayers().get(board.getHero()).getName().trim());
        return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "ONLYFOLD");
      }
    }
    else {
      isFirstCircle = false;     
      if (!heroName.equals(board.getPlayers().get(board.getHero()).getName().trim())){
        logger.log(Level.WARNING,"REASON: heroname != " + board.getPlayers().get(board.getHero()).getName().trim());
        return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "ONLYFOLD");
      }
    }
       
    limpersBet = bb;
    if (board.getNumOfRaises() == 1 && maxBet < 2.1f * bb && isFirstCircle){
      limpersBet = maxBet;
      board.setNumOfRaises(0);
    }
   
    for (Player player: board.getPlayers()){
      if (FloatEx.equals4(player.getBet() - limpersBet,0f))
        limpersCount ++;
    }
   
    int tmp;   
    int firstRaiserPosition = -1;
    if (board.getNumOfRaises() != 0){
      if (board.getNumOfRaises() == 1){
        tmp = 0;
        for (int i = 0; i< board.getPlayers().size(); i++){
          if (FloatEx.equals4(board.getPlayers().get(i).getBet(), maxBet)){
            if (firstRaiserPosition  == -1)
              firstRaiserPosition = i;
            tmp++;
          }
        }
        raiseAmount = FloatEx.cutFloat2(new Float(koeff * maxBet * (3 + tmp)));
        callers = tmp;                           
      }else{
        raiseAmount = board.getPlayers().get(board.getHero()).getStack();
      }         
    }
    else{
      raiseAmount = FloatEx.cutFloat2(new Float(koeff * limpersBet *(4 + limpersCount) ) );
    }
    if (raiseAmount > 1f){
      raiseAmount = raiseAmount * 10;
      raiseAmount = FloatEx.cutFloat2(0.1f * Math.round(raiseAmount));
    }
    /*
    if (raiseAmount > dfs.getPlayerMoney() * 2.0f / 3.0f)
        raiseAmount = dfs.getPlayerMoney();
    */
    logger.log(Level.WARNING,"mBet: " + maxBet + ";  limpC: " + limpersCount + ";  rA" + raiseAmount + ";  numRaise: " + board.getNumOfRaises() + "; callers: " + callers);   
    logger.log(Level.WARNING,"position:" + board.getPosition());
    if (isFirstCircle){
      switch (board.getPosition()) {
        case EARLY_POSITION:                             
          // no raises
          if (board.getNumOfRaises() == 0){           
            if (checkHandForHSet(heroHand,11)){
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RAISE);
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,11");
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
          }else
          if (board.getNumOfRaises() == 1){
            // one raise
            if (checkHandForHSet(heroHand,21)){
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RERAISE);
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,21");             
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
          }else{
            if (checkHandForHSet(heroHand,22)){
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RERAISE);
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,22");
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
          }
         
          logger.log(Level.WARNING,"REASON: (FOLD) nothing");
          return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "");
                 
        case MIDDLE_POSITION: 
          if (board.getNumOfRaises() == 0){           
            if (checkHandForHSet(heroHand,12)){
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RAISE);
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,12");
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
          }else
          if (board.getNumOfRaises() == 1){
            // one raise
            if (checkHandForHSet(heroHand,21))  {
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RERAISE);
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,21");
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
          }else{
            if (checkHandForHSet(heroHand,22)){
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,22");
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RERAISE);
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
          }
         
          if (checkHandForHSet(heroHand,41) && FloatEx.gt4(bb * 4.1f, board.needAmountToCall())){
            logger.log(Level.WARNING,"REASON: (CALL) heroHand,41");
            return new AnalystResult(UIReaction.UIR_ACTION_CALL, "");
          }
           
          return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "");
        case LAST_POSITION:            
          if (board.getNumOfRaises() == 0){           
            if (checkHandForHSet(heroHand,13)){
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,13");
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RAISE);
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));             
            }
            if (checkHandForHSet(heroHand,131) && limpersCount == 0){
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,131.... limpers = 0");
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
          }else
          if (board.getNumOfRaises() == 1){
            // one raise
            if (checkHandForHSet(heroHand,21)){
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RERAISE);
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,21");
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
          }else{
            if (checkHandForHSet(heroHand,22)){
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,22");
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RERAISE);
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
          }
         
          if (checkHandForHSet(heroHand,42) && FloatEx.gt4(bb * 4.1f, board.needAmountToCall())){
            logger.log(Level.WARNING,"REASON: (RAISE) heroHand,42");
            return new AnalystResult(UIReaction.UIR_ACTION_CALL, "");
          }
         
         
         
          logger.log(Level.WARNING,"REASON: (FOLD) nothing");
          return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "");
                   
        case BLINDS:
          if (board.getNumOfRaises() == 0){ 
            if (checkHandForHSet(heroHand,13)){
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,13");
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RAISE);
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
            if (checkHandForHSet(heroHand,141) && limpersCount <= 1){
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,141");
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RAISE);
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
           
          }else
          if (board.getNumOfRaises() == 1){ 
            if (board.getNextInGamePlayer(firstRaiserPosition) == board.getDealer() ||
              board.getNextInGamePlayer(board.getNextInGamePlayer(firstRaiserPosition)) == board.getDealer() ||
              firstRaiserPosition == board.getDealer() ||
              board.getNextInGamePlayer(board.getDealer()) == firstRaiserPosition){
             
              if (checkHandForHSet(heroHand,31)){
                logger.log(Level.WARNING,"REASON: (RAISE) heroHand,31");
                board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RERAISE);
                return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
              }
            }
            if (checkHandForHSet(heroHand,21)){
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,21");
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RERAISE);
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
          }else{
            if (checkHandForHSet(heroHand,21)){
              logger.log(Level.WARNING,"REASON: (RAISE) heroHand,21");
              board.setHeroActionOnTurn(HeroActionOnTurn.HAOT_RERAISE);
              return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
            }
          }           
          logger.log(Level.WARNING,"REASON: (FOLD) nothing");
          return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "");
        default: System.err.println("�� ���������� �������");
          break;
      }  
    }else{
      // check for resteal
      boolean isResteal = false;
      int anotherActivePos = -1;
      int tempPosition = board.getHero();     
     
      if ( board.getHeroActionOnTurn() == HeroActionOnTurn.HAOT_RERAISE){
        logger.log(Level.WARNING,"REASON: (ALL) on prev was reraise");
        return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(board.getPlayers().get(board.getHero()).getStack()));
      }
     
      if (board.getActivePlayers() == 2){
        anotherActivePos = board.getNextActivePlayer(board.getHero());
        if(board.getPosition() == Position.LAST_POSITION || board.getPosition() == Position.BLINDS){
          for(int i = 0; i<3; i++){
            tempPosition = board.getNextInGamePlayer(tempPosition);
            if (tempPosition == anotherActivePos){
              isResteal = true;
              break;
            }
          }
        }
      }   
      if (isResteal){
        if (checkHandForHSet(heroHand,32)){
          logger.log(Level.WARNING,"REASON: (RAISE) heroHand,32");
          return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(board.getPlayers().get(board.getHero()).getStack()));         
        }
      }
      else{       
        if (checkHandForHSet(heroHand,23)){
          logger.log(Level.WARNING,"REASON: (RAISE) heroHand,23");
          if (board.getActivePlayers() == 2)
            return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(board.getPlayers().get(board.getHero()).getStack()));
          else
            return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
        }
      }           
     
      logger.log(Level.WARNING,"REASON: (FOLD) nothing");
      return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "");
    }
   
    return null;
  }
View Full Code Here

Examples of com.poker.analyst.AnalystResult

        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);               
                //if (cardvalues.get(0).getCard().getFace() != CardFace.ACE)
                if (hand.getHandCards()[0].getFace() != CardFace.ACE &&
                  hand.getHandCards()[1].getFace() != CardFace.ACE)
                  topCombination = null;               
              }
            }           
          }
        }
       
      if (wasRaiseBeforeHero){
        raiseAmount = dfs.getPlayerMoney();
      }  
      else
        raiseAmount = koeff * total;
     
      if (raiseAmount > dfs.getPlayerMoney() / 2)
        raiseAmount = dfs.getPlayerMoney();
     
      // all-in (no raises, low stack)
      if (total - board.getTotal() > dfs.getPlayerMoney() * 2 && !wasRaiseBeforeHero){
        logger.log(Level.WARNING,"all-in (no raises, low stack)");
        return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(dfs.getPlayerMoney()));
      }
      if (board.getActivePlayers() == 2){
        if (FloatEx.equals4(board.getTotal(),0)){
          logger.log(Level.WARNING,"RAISE->2 players");
          return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
        }else{
          if (topCombination != null || flushDraw != null || straightDraw != null){
            logger.log(Level.WARNING,"RAISE->topCombination != null || flushDraw != null || straightDraw != null");
            return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
          }
          else
            return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "");
        }
      }
     
      if (wasRaiseOnPrevRound){
        if (topCombination != null || flushDraw != null || straightDraw != null){
          return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
        }
      }else{
        if (topCombination != null || flushDraw != null || straightDraw != null){
          return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
        }
      }
      return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "");     
  }
View Full Code Here

Examples of com.poker.analyst.AnalystResult

    */
       
       
        // 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;
        /*
        if(topCombination == null && (flushDraw != null || straightDraw != null))
          koeff = 2.0f/3.0f;
        */
                              
      if (wasRaiseBeforeHero){
        raiseAmount = dfs.getPlayerMoney();
      }  
      else
        raiseAmount = koeff * total;
     
      if (raiseAmount > dfs.getPlayerMoney() / 2)
        raiseAmount = dfs.getPlayerMoney();
     
      // all-in (no raises, low stack)
     
      if (total - board.getTotal() > dfs.getPlayerMoney() * 4 && !wasRaiseBeforeHero)
        return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(dfs.getPlayerMoney()));           
                 
    if (topCombination != null || flushDraw != null || straightDraw != null){
      return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
    }
     
      return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "");
  }
View Full Code Here

Examples of com.poker.analyst.AnalystResult

    }
        */
       
        // 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;
       
                              
      if (wasRaiseBeforeHero){
        raiseAmount = dfs.getPlayerMoney();
      }  
      else
        raiseAmount = koeff * total;
     
      if (raiseAmount > dfs.getPlayerMoney() / 2)
        raiseAmount = dfs.getPlayerMoney();
     
      // all-in (no raises, low stack)
     
      if (total - board.getTotal() > dfs.getPlayerMoney() * 4 && !wasRaiseBeforeHero)
        return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(dfs.getPlayerMoney()));           
                 
    if (topCombination != null){
      return new AnalystResult(UIReaction.UIR_ACTION_RAISE, StringEx.float2str2(raiseAmount));
    }
     
      return new AnalystResult(UIReaction.UIR_ACTION_FOLD, "");
 
View Full Code Here

Examples of com.poker.analyst.AnalystResult

    dfs.setTotalBank(pControl.getAllRoundTotal(playWnd));
           
  //  System.out.println("Preflop board: "+ playWnd.getPreflopBoard());
    ViewBoard.viewBoard(playWnd, Rounds.PREFLOP, pControl);
   
    AnalystResult aResult = strategy.getReaction(dfs);
    System.out.println(aResult);
   
    System.out.println("//////////////////==========================================");
       playWnd = FillPlayWindow.fillPlayWindow(playWnd, bPathF);
       System.out.println("Preflop board2: " + playWnd.getPreflopBoard());
View Full Code Here

Examples of com.poker.analyst.AnalystResult

                    }                   
               //     System.out.println(k + " : " + emptyPlaces[k]);
                }
             //   System.err.println("free seats = " + nCount);
                if (nCount >=7){
                  pcontrol.react(pdata, playWnd, new AnalystResult(UIReaction.UIR_CLOSE_WINDOW, null));                 
                }
               
            }
        }
        return null;
View Full Code Here

Examples of com.poker.analyst.AnalystResult

            final PlayWindow playWnd) {

        try {
            pControl.activateWindow(playWnd);
            Thread.sleep(new Integer(pdata.getProgramSettings().getDelayPrepareThreadMs() / 6));
            pControl.react(pdata, playWnd, new AnalystResult(UIReaction.UIR_REJECT_BUYIN, null));
        } catch (final Exception e) {
            //
            e.printStackTrace();
        }
        return true;
View Full Code Here

Examples of com.poker.analyst.AnalystResult

    }
    DataForStrategy dfs = new DataForStrategy();
    Strategy strategy = pdata.getProgramSettings().getStrategySSS();
   
    if (playWnd.getCurrentEvent() == EventType.ET_NEED_WAIT_BB) {
      return new AnalystResult(UIReaction.UIR_BB_WAIT_FOR, null);     
    }else
    if(playWnd.getCurrentEvent() == EventType.ET_SYSTEM_MESSAGE){
      return new AnalystResult(UIReaction.UIR_ACCEPT_SYSTEM_WINDOW, null);
    }
    else
    if(playWnd.getCurrentEvent() == EventType.ET_SYSTEM_MESSAGE_2){
      return new AnalystResult(UIReaction.UIR_ACCEPT_SYSTEM_WINDOW_2, null);
    }
    if (playWnd.getCurrentEvent() == EventType.ET_SET_BB) {
      dfs.setCurrentRound(playWnd.getCurrentRound());
      dfs.setCurrentBoard(playWnd.getPreflopBoard());
     
      if (strategy.maySitToTable(dfs))           
        return new AnalystResult(UIReaction.UIR_BB_SET, null);
      else 
        return new AnalystResult(UIReaction.UIR_CLOSE_WINDOW, "");
    }else {
     
     
      switch(playWnd.getCurrentRound()){
        case FLOP :
          dfs.setPrevBoard(playWnd.getPreflopBoard());
            break;
          case TURN :
            dfs.setPrevBoard(playWnd.getFlopBoard());
            break;
          case RIVER :
            dfs.setPrevBoard(playWnd.getTurnBoard());
            break;
          default:
            dfs.setPrevBoard(null);
      }
   

      //ViewBoard.viewBoard(playWnd, playWnd.getCurrentRound(), pControl);
      dfs.setCurrentBoard(playWnd.getCurrentBoard());
      dfs.setCurrentRound(playWnd.getCurrentRound());
      /* not realized yet
          dfs.setPlayerMoney(playWnd.getPlayerMoney());
       */
      //  0 - hero place
      dfs.setPlayerMoney(dfs.getCurrentBoard().getPlayers().get(0).getStack());
      dfs.setTotalBank(pControl.getAllRoundTotal(playWnd));

      AnalystResult aResult = strategy.getReaction(dfs);
      //System.out.println(aResult);         

      return aResult;
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.