Map<String, Value> results = evaluator.evaluate(alternative, measurementsToEval, statusListener);
// apply all results
for (String 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.getObjectEvaluationSequence();
for (Alternative alternative : plan.getAlternativesDefinition().getConsideredAlternatives()) {
// .. for all alternatives
List<SampleObject> samples = plan.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);
// prepare sample object with data
SampleObject sample = samples.get(i);
String samplePid = sample.getPid();
if (samplePid != null) {
sample.getData().setData(bytestreamManager.load(samplePid));
}
DigitalObject r = alternative.getExperiment().getResults().get(sample);
if ((r != null) && (r.getPid() != null)) {
r = digitalObjectManager.getCopyOfDataFilledDigitalObject(r);
}
try {
for (IObjectEvaluator evaluator : objEvaluators) {
// DigitalObject r2 = (r == null ? null :
// em.merge(r));
try {
Map<String, Value> results = evaluator.evaluate(alternative, sample, r,
measurementsToEval, statusListener);
// apply all results
for (String 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
measurementsToEval.removeAll(results.keySet());