Examples of GoalDefinitionException


Examples of org.ggp.base.util.statemachine.exceptions.GoalDefinitionException

    Set<GdlSentence> results = prover.askAll(ProverQueryBuilder.getGoalQuery(role), ProverQueryBuilder.getContext(state));

    if (results.size() != 1)
    {
        GamerLogger.logError("StateMachine", "Got goal results of size: " + results.size() + " when expecting size one.");
      throw new GoalDefinitionException(state, role);
    }

    try
    {
      GdlRelation relation = (GdlRelation) results.iterator().next();
      GdlConstant constant = (GdlConstant) relation.get(1);

      return Integer.parseInt(constant.toString());
    }
    catch (Exception e)
    {
      throw new GoalDefinitionException(state, role);
    }
  }
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.