measurementsToEval.addAll(allMeasurementsToEval);
for (IActionEvaluator evaluator : actionEvaluators) {
Map<MeasurementInfoUri, Value> results = evaluator.evaluate(alternative, measurementsToEval, this);
// apply all results
for (MeasurementInfoUri m : results.keySet()) {
Value value = results.get(m);
if (value != null) {
Leaf l = measurementOfLeaf.get(m);
value.setScale(l.getScale());
l.getValues(alternative.getName()).setValue(0,value);
}
}
// exclude evaluated leaves from further evaluation
measurementsToEval.removeAll(results.keySet());
}
}
// then object evaluators
List<IObjectEvaluator> objEvaluators = MiniRED.getInstance().getObjectEvaluationSequence();
for (Alternative alternative : selectedPlan.getAlternativesDefinition().getConsideredAlternatives()) {
// .. for all alternatives
List<SampleObject> samples = selectedPlan.getSampleRecordsDefinition().getRecords();
for (int i = 0; i < samples.size(); i++){
// we want to evaluate each property only once, by the evaluator with the highest priority
measurementsToEval.clear();
measurementsToEval.addAll(allMeasurementsToEval);
for (IObjectEvaluator evaluator : objEvaluators) {
DigitalObject r = alternative.getExperiment().getResults().get(samples.get(i));
DigitalObject r2 = (r == null ? null : em.merge(r));
try {
Map<MeasurementInfoUri, Value> results = evaluator.evaluate(
alternative,
em.merge(samples.get(i)),
r2,
measurementsToEval,
this);
// apply all results
for (MeasurementInfoUri m : results.keySet()) {
Value value = results.get(m);
if (value != null) {
Leaf l = measurementOfLeaf.get(m);
value.setScale(l.getScale());
// add evaluation result for the current result-object!
l.getValues(alternative.getName()).setValue(i, value);
}
}
// exclude evaluated leaves from further evaluation