if (minCL <= createdAt) {
minCL = Long.MAX_VALUE;
}
for (SampleObject sample : plan.getSampleRecordsDefinition().getRecords()) {
ChangeLog sampleCL = sample.getChangeLog();
if (sampleCL.getChanged() > maxCL) {
maxCL = sampleCL.getChanged();
}
if (sampleCL.getCreated() < minCL) {
minCL = sampleCL.getCreated();
}
}
minChangeLogs[3] = minCL;
maxChangeLogs[3] = maxCL;
// 4. Identify requirements - TREE_DEFINED(4, "Tree Defined"),
// - nodes/leaves (also created!)
// - scales
// - RequirementsDefinition
minCL = plan.getRequirementsDefinition().getChangeLog().getChanged();
maxCL = minCL;
if (minCL <= createdAt) {
minCL = Long.MAX_VALUE;
}
List<TreeNode> nodes = plan.getTree().getRoot().getAllChildren();
for (TreeNode treeNode : nodes) {
ChangeLog nodeCL = treeNode.getChangeLog();
// we can only consider the creation time stamp, as changed is used
// to confirm values
if (minCL > nodeCL.getCreated()) {
minCL = nodeCL.getCreated();
}
if (maxCL < nodeCL.getCreated()) {
maxCL = nodeCL.getCreated();
}
// we can only use the scales of leaves, as
// - nodes can be changed when weighting is changed
// - leaves are "changed" when evaluated, aggregation mode is
// changed
if (treeNode instanceof Leaf) {
Scale scale = ((Leaf) treeNode).getScale();
if (scale != null) {
ChangeLog scaleCL = scale.getChangeLog();
if (maxCL < scaleCL.getChanged()) {
maxCL = scaleCL.getChanged();
}
}
}
}
minChangeLogs[4] = minCL;
maxChangeLogs[4] = maxCL;
// 5. Define alternatives - ALTERNATIVES_DEFINED(5,
// "Alternatives Defined")
// - AlternativesDefinition
// - Alternative - only created, "changed" can be overwritten in
// GoDecision)
minCL = plan.getAlternativesDefinition().getChangeLog().getChanged();
maxCL = minCL;
if (minCL <= createdAt) {
minCL = Long.MAX_VALUE;
}
for (Alternative alternative : plan.getAlternativesDefinition().getAlternatives()) {
ChangeLog altCL = alternative.getChangeLog();
if (minCL > altCL.getCreated()) {
minCL = altCL.getCreated();
}
if (maxCL < altCL.getCreated()) {
maxCL = altCL.getCreated();
}
// we cannot check for the changed(), as the alternative is also
// changed in GoDecision
}
minChangeLogs[5] = minCL;
maxChangeLogs[5] = maxCL;
// 6. Take go decision - GO_CHOSEN(6, "Go Decision Taken")
// - no: Alternative (! - if discarded)
// - GoDecision
minCL = plan.getDecision().getChangeLog().getChanged();
maxCL = minCL;
if (minCL <= createdAt) {
minCL = Long.MAX_VALUE;
}
// for (Alternative alternative :
// plan.getAlternativesDefinition().getAlternatives()) {
// ChangeLog altCL = alternative.getChangeLog();
// if (maxCL < altCL.getChanged()) {
// maxCL = altCL.getChanged();
// }
// }
minChangeLogs[6] = minCL;
maxChangeLogs[6] = maxCL;
// 7. Develop Experiments - EXPERIMENT_DEFINED(7, "Experiments Defined")
// Alternative.Experiment
minCL = Long.MAX_VALUE;
maxCL = Long.MIN_VALUE;
// as the experiment is created together with the alternative, this
// might result in the same timestamps
for (Alternative alternative : plan.getAlternativesDefinition().getAlternatives()) {
ChangeLog expCL = alternative.getExperiment().getChangeLog();
if (maxCL < expCL.getChanged()) {
maxCL = expCL.getChanged();
}
if (minCL > expCL.getChanged()) {
minCL = expCL.getChanged();
}
}
minChangeLogs[7] = minCL;
maxChangeLogs[7] = maxCL;
// 8. Run Experiments - EXPERIMENT_PERFORMED(8, "Experiments Performed")
// - detailedExperimentInfo
// - result files (alternative.experiment.results)
// - initValues on save
minCL = Long.MAX_VALUE;
maxCL = Long.MIN_VALUE;
// as the experiment is created together with the alternative, this
// might result in the same timestamps
for (Alternative alternative : plan.getAlternativesDefinition().getAlternatives()) {
Experiment experiment = alternative.getExperiment();
// - detailedExperimentInfo
// for (DetailedExperimentInfo detailedInfo :
// experiment.getDetailedInfo().values()) {
// ChangeLog diCL = detailedInfo.getChangeLog();
// if (maxCL < diCL.getChanged()) {
// maxCL = diCL.getChanged();
// }
// if (minCL > diCL.getChanged()) {
// minCL = diCL.getChanged();
// }
// }
// - result files (alternative.experiment.results)
for (DigitalObject result : experiment.getResults().values()) {
ChangeLog resultCL = result.getChangeLog();
if (maxCL < resultCL.getChanged()) {
maxCL = resultCL.getChanged();
}
if (minCL > resultCL.getChanged()) {
minCL = resultCL.getChanged();
}
}
// - initValues on save
// cannot be used, as automatic evaluators replace the value objects
// for (TreeNode treeNode : nodes) {
// ChangeLog nodeCL = treeNode.getChangeLog();
// if (treeNode instanceof Leaf) {
// Leaf leaf = (Leaf)treeNode;
// for (Values values : leaf.getValueMap().values()) {
// for (Value value : values.getList()) {
// ChangeLog valueCL = value.getChangeLog();
// // only the creation time of the value is relevant!
// if (maxCL.getChanged() < valueCL.getCreated()) {
// maxCL = valueCL;
// }
// }
// }
// }
// }
}
minChangeLogs[8] = minCL;
maxChangeLogs[8] = maxCL;
// 9. Evaluate Experiments - RESULTS_CAPTURED(9, "Results Captured")
// - Evaluation
// - ValueMap-Values
minCL = plan.getEvaluation().getChangeLog().getChanged();
maxCL = minCL;
if (minCL <= createdAt) {
minCL = Long.MAX_VALUE;
}
for (TreeNode treeNode : nodes) {
if (treeNode instanceof Leaf) {
Leaf leaf = (Leaf) treeNode;
// ValueMap-Values
for (Values values : leaf.getValueMap().values()) {
for (Value value : values.getList()) {
ChangeLog valueCL = value.getChangeLog();
if (maxCL < valueCL.getChanged()) {
maxCL = valueCL.getChanged();
}
}
}
// values are created in a previous step, therefore the min
// values cannot be set regarding the created timestamp
}
}
minChangeLogs[9] = minCL;
maxChangeLogs[9] = maxCL;
// 10. Transform measured values - TRANSFORMATION_DEFINED(10,
// "Transformations Defined")
// - leaf.transformer
// - Transformation
// - leaf (!! - leaf.aggregationMode )
minCL = plan.getTransformation().getChangeLog().getChanged();
maxCL = minCL;
if (minCL <= createdAt) {
minCL = Long.MAX_VALUE;
}
for (TreeNode treeNode : nodes) {
if (treeNode instanceof Leaf) {
Leaf leaf = (Leaf) treeNode;
if (leaf.getTransformer() != null) {
ChangeLog tCL = leaf.getTransformer().getChangeLog();
if (maxCL < tCL.getChanged()) {
maxCL = tCL.getChanged();
}
if (minCL > tCL.getChanged()) {
minCL = tCL.getChanged();
}
}
}
}
minChangeLogs[10] = minCL;