use of de.prob.prolog.term.IntegerPrologTerm in project prob2 by bendisposto.
the class ExecuteModelCommand method processResult.
@Override
public void processResult(final ISimplifiedROMap<String, PrologTerm> bindings) {
PrologTerm prologTerm = bindings.get(TRANSITION_VARIABLE);
CompoundPrologTerm cpt = BindingGenerator.getCompoundTerm(prologTerm, 4);
Transition operation = Transition.createTransitionFromCompoundPrologTerm(statespace, cpt);
resultTrace.add(operation);
IntegerPrologTerm intPrologTerm = BindingGenerator.getInteger(bindings.get(EXECUTED_STEPS_VARIABLE));
BigInteger bigInt = intPrologTerm.getValue();
stepsExecuted = bigInt.intValue();
switch(bindings.get(RESULT_VARIABLE).getFunctor()) {
case "maximum_nr_of_steps_reached":
this.result = ExecuteModelResult.MAXIMUM_NR_OF_STEPS_REACHED;
break;
case "deadlock":
this.result = ExecuteModelResult.DEADLOCK;
break;
case "error":
this.result = ExecuteModelResult.ERROR;
break;
case "internal_error":
this.result = ExecuteModelResult.INTERNAL_ERROR;
break;
case "time_out":
this.result = ExecuteModelResult.TIME_OUT;
break;
default:
throw new AssertionError("Unexpected result of execute command.");
}
}
use of de.prob.prolog.term.IntegerPrologTerm in project prob2 by bendisposto.
the class EvalstoreCreateByStateCommand method processResult.
@Override
public void processResult(final ISimplifiedROMap<String, PrologTerm> bindings) {
// TODO[DP, 22.01.2013]: Handle errors?
final IntegerPrologTerm result = (IntegerPrologTerm) bindings.get(STORE_ID_VAR);
evalstoreId = result.getValue().longValue();
}
use of de.prob.prolog.term.IntegerPrologTerm in project prob2 by bendisposto.
the class GetTotalNumberOfErrorsCommand method processResult.
@Override
public void processResult(final ISimplifiedROMap<String, PrologTerm> bindings) {
IntegerPrologTerm prologTerm = (IntegerPrologTerm) bindings.get(ERRORS_VARIABLE);
value = prologTerm.getValue();
}
Aggregations