use of com.sri.ai.praise.core.representation.interfacebased.factor.api.Problem in project aic-praise by aic-sri-international.
the class ExpressionBasedProblemToInterfaceBasedProblemConversion method translate.
public static Problem translate(ExpressionBasedProblem expressionBasedProblem) {
ExpressionVariable queryVariable = new DefaultExpressionVariable(expressionBasedProblem.getQuerySymbol());
ExpressionFactorNetwork factorNetwork = makeFactorNetwork(expressionBasedProblem);
Predicate<Expression> isExpressionParameterPredicate = expressionBasedProblem.getIsParameterPredicate();
Predicate<Variable> isParameterPredicate = makeIsParameterPredicate(isExpressionParameterPredicate);
Problem problem = new DefaultVariableMarginalQuery(queryVariable, factorNetwork, isParameterPredicate);
return problem;
}
use of com.sri.ai.praise.core.representation.interfacebased.factor.api.Problem in project aic-praise by aic-sri-international.
the class SolverToExpressionBasedSolverAdapter method solveForQuerySymbolDefinedByExpressionBasedProblem.
@Override
protected Expression solveForQuerySymbolDefinedByExpressionBasedProblem(ExpressionBasedProblem expressionBasedProblem) {
Problem problem = ExpressionBasedProblemToInterfaceBasedProblemConversion.translate(expressionBasedProblem);
Expression result = getSolver().solve(problem);
return result;
}
Aggregations