Package com.jcloisterzone.ai.choice

Examples of com.jcloisterzone.ai.choice.AiChoice


        System.out.println(sb);
    }

    private void dbgPringFooter() {
        System.out.println("=== selected chain (reversed) " + bestSoFarRanking);
        AiChoice step = bestSoFar;
        while (step != null) {
            System.out.print("  - ");
            System.out.println(step.toString());
            step = step.getPrevious();
        }
        System.out.println("*** ranking end ***");
    }
View Full Code Here


        }
        System.out.println("*** ranking end ***");
    }

    private void dbgPringStep(AiChoice choice, boolean isFinal) {
        AiChoice ac = choice;
        StringBuilder sb = new StringBuilder("  ");
        while (ac.getPrevious() != null) {
            sb.append("  ");
            ac = ac.getPrevious();
        }
        sb.append("- ").append(choice.toString()).append(" ");

        while (sb.length() < 80) {
           sb.append(".");
View Full Code Here

    public void setBestChain(AiChoice bestChain) {
        this.bestChain.set(bestChain);
    }

    protected void popActionChain() {
        AiChoice toExecute = null;
        AiChoice best = bestChain.get();
        if (best.getPrevious() == null) {
            toExecute = best;
            bestChain.set(null);
        } else {
            AiChoice choice = best;
            while (choice.getPrevious().getPrevious() != null) {
                choice = choice.getPrevious();
            }
            toExecute = choice.getPrevious();
            choice.setPrevious(null); //cut last element from chain
        }
        //logger.info("pop chain " + this.toString() + ": " + toExecute.toString());
        //execute after chain update is done
        toExecute.perform(getServer());
    }
View Full Code Here

TOP

Related Classes of com.jcloisterzone.ai.choice.AiChoice

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.