public class MeasurementResultAnalyserAverage extends Object implements MeasurementResultAnalyser, BlackboardStorer<HashMap<MeasurableSeffElement,Integer>>
MeasurementResultAnalyser
will contribute with static
created ProposedExpressions. It will take all SeffElements and use respectively all
their MeasurementResults on the Blackboard
and calculate thereby an expression
that fits best to the average expectancy value. Its implementation of
canContribute(ReadOnlyMeasurementResultAnalyserBlackboardView)
checks if there
are any MeasurementResults for a SeffElement, that have not been flown into the average
proposed Expression so far.Constructor and Description |
---|
MeasurementResultAnalyserAverage() |
Modifier and Type | Method and Description |
---|---|
boolean |
canContribute(ReadOnlyMeasurementResultAnalyserBlackboardView blackboard)
Determines whether this analyser can potentially contribute knowledge in the
moment.
|
void |
contribute(MeasurementResultAnalyserBlackboardView blackboard)
Contributes this analyser’s knowledge to the passed blackboard.
|
public boolean canContribute(ReadOnlyMeasurementResultAnalyserBlackboardView blackboard)
MeasurementResultAnalyser
true
is returned, the analyser can potentially contribute, but
might still be unable to generate meaningful results when being executed. If
false
is returned, calling MeasurementResultAnalyser.contribute(de.uka.ipd.sdq.beagle.core.analysis.MeasurementResultAnalyserBlackboardView)
will not yield any new
results. Calling this method has no implications on whether or when
MeasurementResultAnalyser.contribute(de.uka.ipd.sdq.beagle.core.analysis.MeasurementResultAnalyserBlackboardView)
will be called. Passing a blackboard
that was last
modified by this analyser’s MeasurementResultAnalyser.contribute(de.uka.ipd.sdq.beagle.core.analysis.MeasurementResultAnalyserBlackboardView)
must always result in false
.
This method must behave entirely stateless, meaning that its result do not
depend on any prior calls to any method but only on the passed blackboard
.
Furthermore, calls with equal blackboard contents must always result in the same
value.
canContribute
in interface MeasurementResultAnalyser
blackboard
- The current blackboard.true
only if MeasurementResultAnalyser.contribute(de.uka.ipd.sdq.beagle.core.analysis.MeasurementResultAnalyserBlackboardView)
may be called.public void contribute(MeasurementResultAnalyserBlackboardView blackboard)
MeasurementResultAnalyser
Calling this method with a blackboard for which MeasurementResultAnalyser.canContribute(de.uka.ipd.sdq.beagle.core.analysis.ReadOnlyMeasurementResultAnalyserBlackboardView)
returns
false
results in undefined behaviour. This method must
MeasurementResultAnalyser.canContribute(de.uka.ipd.sdq.beagle.core.analysis.ReadOnlyMeasurementResultAnalyserBlackboardView)
) but only on the passed
blackboard
.
blackboard
.
MeasurementResultAnalyser.canContribute(de.uka.ipd.sdq.beagle.core.analysis.ReadOnlyMeasurementResultAnalyserBlackboardView)
is called with the blackboard like its
left by this method, it will return false
.
Implementing BlackboardStorer
and using
Blackboard.writeFor(Class, java.io.Serializable)
is, if needed, the recommended way to achieve the behaviour described above.
contribute
in interface MeasurementResultAnalyser
blackboard
- The current blackboard.