Package org.ggp.base.util.statemachine.implementation.prover

Examples of org.ggp.base.util.statemachine.implementation.prover.ProverStateMachine.initialize()


        description = GdlCleaner.run(description);

        StaticValidator.validateDescription(description);

        StateMachine sm = new ProverStateMachine();
        sm.initialize(description);
        MachineState state = sm.getInitialState();
        assertEquals(1, sm.getRoles().size());
        Role player = sm.getRoles().get(0);
        assertEquals(1, sm.getLegalMoves(state, player).size());
        state = sm.getNextStates(state).get(0);
View Full Code Here


  @Override
  public List<ValidatorWarning> checkValidity(Game theGame) throws ValidatorException {
    try {
      StateMachine sm = new ProverStateMachine();
      sm.initialize(theGame.getRules());

      AimaProver prover = new AimaProver(theGame.getRules());
      GdlSentence basesQuery = GdlPool.getRelation(BASE, new GdlTerm[] {X});
      Set<GdlSentence> bases = prover.askAll(basesQuery, Collections.<GdlSentence>emptySet());
      GdlSentence inputsQuery = GdlPool.getRelation(INPUT, new GdlTerm[] {X, Y});
View Full Code Here

  @Override
  public List<ValidatorWarning> checkValidity(Game theGame) throws ValidatorException {
    for (int i = 0; i < numSimulations; i++) {
      StateMachine stateMachine = new ProverStateMachine();
      stateMachine.initialize(theGame.getRules());

      MachineState state = stateMachine.getInitialState();
      for (int depth = 0; !stateMachine.isTerminal(state); depth++) {
        if (depth == maxDepth) {
          throw new ValidatorException("Hit max depth while simulating: " + maxDepth);
View Full Code Here

            runButton.setEnabled(false);
            if (theGame == null)
                return;

            StateMachine stateMachine = new ProverStateMachine();
            stateMachine.initialize(theGame.getRules());
            List<Role> roles = stateMachine.getRoles();

            int newRowCount = 11;
            for (int i = 0; i < roles.size(); i++) {
                roleLabels.add(new JLabel(roles.get(i).getName().toString() + ":"));
View Full Code Here

            description = DeORer.run(description);
            newDescription = VariableConstrainer.replaceFunctionValuedVariables(description);

            if(description.hashCode() != newDescription.hashCode()) {
                theReference.initialize(description);
                theMachine.initialize(newDescription);
                System.out.println("Detected activation in game " + gameKey + ". Checking consistency: ");
                StateMachineVerifier.checkMachineConsistency(theReference, theMachine, 10000);

                if(showDiffs) {
                    for(Gdl x : newDescription) {
View Full Code Here

    }

    private boolean attemptLoadingProverMachine() {
        try {
            StateMachine theStateMachine = new ProverStateMachine();
            theStateMachine.initialize(gameDescription);
            theBackingMachine = theStateMachine;
            GamerLogger.log("StateMachine", "Failsafe Machine: successfully loaded traditional prover.");
            return true;
        } catch(Exception e1) {
        } catch(ThreadDeath d) {
View Full Code Here

        // legal joint moves in the first state, or simulating entire matches,
        // but that would be expensive.
      ProverStateMachine pNormal = new ProverStateMachine();
      ProverStateMachine pScrambled = new ProverStateMachine();
      pNormal.initialize(game.getRules());
      pScrambled.initialize(theScrambledRules);
      assertEquals(gameKey, pNormal.getRoles().size(), pScrambled.getRoles().size());
      assertEquals(gameKey, pNormal.getInitialState().getContents().size(), pScrambled.getInitialState().getContents().size());
      }
    }
}
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.