Package ca.spatial.patchworks
Class ConvergenceSpec
java.lang.Object
ca.spatial.patchworks.ConvergenceSpec
This class describes convergence sub-target criteria and
performance measurements.
-
Constructor Summary
ConstructorsConstructorDescriptionConvergenceSpec(String pattern, double percent, double multiplier, int sampleSize)
Define a sub-target convergence criteria. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Get the current value of the objective function for this sub-target.Return the pattern that is used to identify the targets that this pattern applies to.double
Returns the sub-target objective function convergence criteria.double
Get the previous iteration value of the objective function for this sub-target.void
setMultiplier(double factor)
Set the convergence factor on the stagnation test.
-
Constructor Details
-
ConvergenceSpec
Define a sub-target convergence criteria.- Parameters:
pattern
- Specify a pattern that will be used to identify the accounts that are part of this sub-creteria. The pattern can use either globbing or regex syntax (seeReport.patternToRegex(java.lang.String, boolean)
).percent
- The percent change in the objective function required before returing from the wait state. If this value is zero or less then the function will return after the number of iterations had completed. If the value is greater than zero, then compare the change in the objective function value that has occurred since the last test. If the percent change is positve and less than the value, then return. Otherwise wait for another count attempts and test again.multiplier
- A value that will be used for testing if the sub-criteria has stagnated (seesetMultiplier(double)
for details).sampleSize
- The number of samples used to calculate trends. The scenario monitor will have to observe this many samples before the stagnation detection can begin. A value of 20 woud be reasonable.
-
-
Method Details
-
getPattern
Return the pattern that is used to identify the targets that this pattern applies to. -
getPercent
public double getPercent()Returns the sub-target objective function convergence criteria. The criteria is met when the periodic change in objective function value for the targets that match this pattern is les than this value. -
getCurrentObjective
public double getCurrentObjective()Get the current value of the objective function for this sub-target. -
getPreviousObjective
public double getPreviousObjective()Get the previous iteration value of the objective function for this sub-target. -
setMultiplier
public void setMultiplier(double factor)Set the convergence factor on the stagnation test. Stagnation can happen when the objective is very close to the target, and small changes to the solution can cause the objective value to fluctuate by small amounts up and down. The degree of fluctuation is greatly amplified since it is expressed as a percent. The percent change will indicate that progress is being made, but in fact not much is happening. This test will fail it the criteria is moving in a consistent direction. The method is to see if the objective mean of recent trials is within some multiple of the standard deviation around the mean of previous trials. The multiplier set here specifies how close the means need to be. Setting a value is 0 will disable this stagnation test.
-