Examples of InnerNode


Examples of fmg.fmg8.endlAutomat.conditions.InnerNode

            } else if (bedingung.charAt(i)
                    == fmg.fmg8.endlAutomat.Konstanten.KZ) {
                klammerAuf--;
            } else if (klammerAuf == 1
                       && istBoolOperator(bedingung.charAt(i))) {
                return new InnerNode(ausFormatBed(bedingung.substring(3,
                                                                i - 1)),
                                     ausFormatBed(bedingung.substring(i + 2,
                                                     bedingung.length() - 3)),
                                     bedingung.charAt(i));
            }
View Full Code Here

Examples of fmg.fmg8.endlAutomat.conditions.InnerNode

                zielKnNum = (Integer) knotZuord[i].get(zielKn.holeName());
                neuBed = SonstMeth.ausFormatBed(conds[i].formatted());
                for (int j = 0; j < i; j++) {
                    zwischBed = SonstMeth.ausFormatBed(conds[j].formatted());
                    zwischBed.negiere();
                    neuBed = new InnerNode(neuBed,
                                           zwischBed,
                                           fmg.fmg8.endlAutomat.Konstanten.UND);
                }
               
                for (int j = 0; j < eas.length; j++) {
                    if (j != i) {
                        knot = new ArrayList<Integer>(
                                eas[j].holAdj().keySet());
                        it = knot.iterator();
                       
                        while (it.hasNext()) {
                            aktKnNum = (Integer) knotZuord[j].get(it.next());
                            neu.einfuegKante(aktKnNum, zielKnNum, neuBed, 1);
                        }
                    }
                }
            }
        }

        // Neue Kanten INTRA Automaten zuordnen.
        for (int i = 0; i < eas.length; i++) {
            knot1 = new ArrayList<Integer>(eas[i].holAdj().keySet());
            it1 = knot1.iterator();
           
            while (it1.hasNext()) {
                numOrig1 = it1.next();
                aktKnNum = (Integer) knotZuord[i].get(numOrig1);
                aktKn = eas[i].holeKnoten(numOrig1);
               
                if (aktKn.getInfo() != null
                        && aktKn.getInfo().getBedingungen() != null) {
                    trans = aktKn.getInfo().getBedingungen();
                    it3 = trans.iterator();
                   
                    while (it3.hasNext()) {
                        tran = it3.next();
                        numOrig2 = tran.getFolgezustand();
                        zielKnNum = (Integer) knotZuord[i].get(numOrig2);
                        aktBed = tran.getCond();
                       
                        if (aktBed != null) {
                            neu.einfuegKante(aktKnNum, zielKnNum, aktBed, 1);
                        }
                    }
                }
            }
        }

        // true - Kanten zu den einzelnen Startknoten einf�gen.
        for (int i = 0; i < eas.length; i++) {
            zielKn = eas[i].holeStartzustand();
           
            if (zielKn != null) {
                zielKnNum = (Integer) knotZuord[i].get(zielKn.holeName());
               
                knot = new ArrayList<Integer>(eas[i].holAdj().keySet());
                it = knot.iterator();
               
                while (it.hasNext()) {
                    aktKnNum = (Integer) knotZuord[i].get(it.next());
                    neu.einfuegKante(aktKnNum,
                                     zielKnNum,
                                     SonstMeth.ausBed("t"),
                                     1);
                }
            }
        }

        // Einen IDLE-Startknoten einf�gen.
        idlBefehl = SonstMeth.posSuch(fmg.fmg8.umgebung2D.Konstanten.BEF,
                                      "IDL");
        neu.einfuegenKnoten(lfdNr, idlBefehl, 1, 1);
        neu.setStart(neu.holeKnoten(lfdNr));
        for (int i = 0; i < conds.length; i++) {
            if (i > 0) {
                neuBed = conds[i];
            } else {
                neuBed = SonstMeth.ausFormatBed(conds[i].formatted());
                for (int j = 1; j < conds.length; j++) {
                    zwischBed = SonstMeth.ausFormatBed(conds[j].formatted());
                    zwischBed.negiere();
                    neuBed = new InnerNode(
                            neuBed,
                            zwischBed,
                            fmg.fmg8.endlAutomat.Konstanten.ODER);
                }
            }
View Full Code Here

Examples of lupos.compression.huffman.tree.InnerNode

   
    // combine in each iteration those entries with the lowest weights
    while(heap.size()>1){
      HeapEntry a = heap.pop();
      HeapEntry b = heap.pop();
      heap.add(new HeapEntry(a.weight + b.weight, new InnerNode(a.node, b.node)));
    }
   
    // finally get the root (= last element in the heap!)
    HeapEntry root = heap.pop();
    return root.node;
View Full Code Here

Examples of org.cspoker.ai.bots.bot.gametree.mcts.nodes.InnerNode

    HashMap<Class<?>, Double> probs = new HashMap<Class<?>, Double>();
    Class<?> cProb = null;
    RaiseAction raiseAction = null;
    BetAction betAction = null;
    String errorStr = "";
    InnerNode node = getNode(gameState);
    if (node != null) {
      errorStr = (">-----------------------------");
      errorStr += ("\n" + getPlayerName(gameState) + " State " + gameState.getClass());
      ImmutableList<INode> children = node.getChildren();
      if (children != null) {
        for (INode n : children) {
          Class<?> c = n.getLastAction().getAction().getClass();
          // Same actions are grouped to make one probability (bet/raise)
          if (!probs.containsKey(c))
            probs.put(c, n.getLastAction().getProbability());
          else
            probs.put(c, n.getLastAction().getProbability() + probs.get(c));
          actions.put(c, n.getLastAction().getAction());
         
          if (gameState.getClass().equals(
              n.getLastAction().getAction()
                  .getUnwrappedStateAfterAction().getClass()) ||
            // TODO: you shouldn't get BetAction in RaiseState (but it does happen somehow...)
            (gameState.getClass().equals(RaiseState.class) &&
                n.getLastAction().getAction().getClass().equals(BetAction.class))) {// ||
//            // TODO: idem with Raise-/BetAction in AllinState (now this situation is ignored)
//            (gameState.getClass().equals(AllInState.class) &&
//                n.getLastAction().getAction().getClass().equals(BetAction.class))) {
            if (cProb == null) {
              errorStr += "\n Setting chosen node with action " + n.getLastAction().getAction();
              parentOpponentModel.setChosenNode(n);
            }
            cProb = c;
            if (raiseAction == null && c.equals(RaiseAction.class))
              raiseAction = (RaiseAction) n.getLastAction().getAction();
            else if (betAction == null && c.equals(BetAction.class))
              betAction = (BetAction) n.getLastAction().getAction();
          }
         
          // Correct child node is chosen for bet/raise
          if (cProb != null) {
            if (raiseAction != null && c.equals(RaiseAction.class)) {
              RaiseAction newRaiseAction = (RaiseAction) n.getLastAction().getAction();
              if (Math.abs(newRaiseAction.amount - raiseAmount) <
                  Math.abs(raiseAction.amount - raiseAmount)) {
                raiseAction = newRaiseAction;
                errorStr += "\n Setting chosen node with action " + n.getLastAction().getAction();
                parentOpponentModel.setChosenNode(n);
              }
            }
            else if (betAction != null && c.equals(BetAction.class)) {
              BetAction newBetAction = (BetAction) n.getLastAction().getAction();
              if (Math.abs(newBetAction.amount - raiseAmount) <
                  Math.abs(betAction.amount - raiseAmount)) {
                betAction = newBetAction;
                errorStr += "\n Setting chosen node with action " + n.getLastAction().getAction();
                parentOpponentModel.setChosenNode(n);
              }
            }
          }
          errorStr += ("\nState "
              + n.getLastAction().getAction().getUnwrappedStateAfterAction().getClass()
              + " with action "
              + n.getLastAction().getAction()
              + "\t with probability "
              + (double) Math.round(n.getLastAction().getProbability() * 10000) / 100
              + "% and totalProb "
              + (double) Math.round(probs.get(c) * 10000) / 100 + "%");
        }
        errorStr += ("\n> Chosen child with action " +
            parentOpponentModel.getChosenNode().getLastAction().getAction());
      } else {
        errorStr += ("\nNo children for node with action " +
          node.getLastAction().getAction());
      }
      errorStr += ("\n-----------------------------<");
    }
   
    // chosen node of opponentmodel should have changed
View Full Code Here

Examples of org.cspoker.ai.bots.bot.gametree.mcts.nodes.InnerNode

          (data.trueNegative + data.truePositive + data.falseNegative + data.falsePositive);
  }
 
  @Override
  public void visitCallState(CallState callState) {
    InnerNode node = getNode(callState);
    if (node != null && !callState.getNextToAct().equals(parentOpponentModel.getBotId())) {
      Prediction p = getProbability(callState);
      assimilatePrediction(callState.getNextToAct(), p);
      getPropz().logCallProb(callState.getNextToAct(), p);
      logger.trace(getPlayerName(callState) + " " + p);
View Full Code Here

Examples of org.cspoker.ai.bots.bot.gametree.mcts.nodes.InnerNode

    propz.signalCall(false, callState.getEvent().getPlayerId());
  }
 
  @Override
  public void visitRaiseState(RaiseState raiseState) {
    InnerNode node = getNode(raiseState);
    if (node != null && !raiseState.getNextToAct().equals(parentOpponentModel.getBotId())) {
      Prediction p = getProbability(raiseState,raiseState.getLargestBet());
      assimilatePrediction(raiseState.getNextToAct(), p);
      getPropz().logRaiseProb(raiseState.getNextToAct(), p);
      logger.trace(getPlayerName(raiseState) +
View Full Code Here

Examples of org.cspoker.ai.bots.bot.gametree.mcts.nodes.InnerNode

    propz.signalRaise(false, raiseState.getLastEvent().getPlayerId(), raiseState.getLargestBet());
  }
 
  @Override
  public void visitFoldState(FoldState foldState) {
    InnerNode node = getNode(foldState);
    if (node != null && !foldState.getNextToAct().equals(parentOpponentModel.getBotId())) {
      Prediction p = getProbability(foldState);
      assimilatePrediction(foldState.getNextToAct(), p);
      getPropz().logFoldProb(foldState.getNextToAct(), p);
      logger.trace(getPlayerName(foldState) + " " + p);
View Full Code Here

Examples of org.cspoker.ai.bots.bot.gametree.mcts.nodes.InnerNode

    propz.signalFold(foldState.getEvent().getPlayerId());
  }
 
  @Override
  public void visitCheckState(CheckState checkState) {
    InnerNode node = getNode(checkState);
    if (node != null && !checkState.getNextToAct().equals(parentOpponentModel.getBotId())) {
      Prediction p = getProbability(checkState);
      assimilatePrediction(checkState.getNextToAct(), p);
      getPropz().logCheckProb(checkState.getNextToAct(), p);
      logger.trace(getPlayerName(checkState) + " " + p);
View Full Code Here

Examples of org.cspoker.ai.bots.bot.gametree.mcts.nodes.InnerNode

    propz.signalCheck(checkState.getEvent().getPlayerId());
  }
 
  @Override
  public void visitBetState(BetState betState) {
    InnerNode node = getNode(betState);
    if (node != null && !betState.getNextToAct().equals(parentOpponentModel.getBotId())) {
      Prediction p = getProbability(betState, betState.getEvent().getAmount());
      assimilatePrediction(betState.getNextToAct(), p);
      getPropz().logBetProb(betState.getNextToAct(), p);
      logger.trace(getPlayerName(betState) +
View Full Code Here

Examples of org.cspoker.ai.bots.bot.gametree.mcts.nodes.InnerNode

    propz.signalBet(false, betState.getEvent().getPlayerId(), betState.getEvent().getAmount());
  }
 
  @Override
  public void visitAllInState(AllInState allInState) {
    InnerNode node = getNode(allInState);
    if (node != null && !allInState.getNextToAct().equals(parentOpponentModel.getBotId())) {
      Prediction p = getProbability(allInState, allInState.getEvent().getMovedAmount());
      assimilatePrediction(allInState.getNextToAct(), p);
     
      if (p != null) {
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.