use of edu.uah.rsesc.aadlsimulator.agree.eval.EvaluationException in project AGREE by loonwerks.
the class AGREESimulationState method createEvaluator.
private Evaluator createEvaluator(final Collection<Expr> constraints, final Set<SimulationProperty> disabledProperties) {
try {
final SimulationFrameResults lastFrameResults = frameInfos.size() == 0 ? null : frameInfos.get(frameInfos.size() - 1).getFrameResults();
final List<Expr> assertions = new ArrayList<Expr>();
FrameAssertionHelper.addNextFrameAssertions(simulationProgram, lastFrameResults, assertions);
assertions.addAll(constraints);
// Add assertions for property enablement variables
for (final SimulationProperty simProp : simulationProgram.getSimulationProperties()) {
if (simProp.getEnablementVariableId() != null) {
assertions.add(new BinaryExpr(new IdExpr(simProp.getEnablementVariableId()), BinaryOp.EQUAL, new BoolExpr(disabledProperties.contains(simProp) ? false : true)));
}
}
// Create the new evaluator
return new Evaluator(baseEvaluator, assertions);
} catch (EvaluationException ex) {
return null;
}
}
Aggregations