org.jppf.server.scheduler.bundle.autotuned
Class AnnealingTuneProfile

java.lang.Object
  extended by org.jppf.server.scheduler.bundle.autotuned.AbstractAutoTuneProfile
      extended by org.jppf.server.scheduler.bundle.autotuned.AnnealingTuneProfile
All Implemented Interfaces:
Serializable, LoadBalancingProfile

public class AnnealingTuneProfile
extends AbstractAutoTuneProfile

This class implements the basis of a profile based on simulated annealing strategy. The possible move from the best known solution get smaller each time it make a move. This strategy let the algorithm explore the universe of bundle size with an almost known end. Check method getDecreaseRatio about the maximum number of changes.

Author:
Domingos Creado
See Also:
Serialized Form

Field Summary
protected  float decreaseRatio
          This parameter defines how fast does it will stop generating random numbers.
protected  double maxDeviation
          The percentage of deviation of the current mean to the mean when the system was considered stable.
protected  int maxGuessToStable
          The maximum number of guesses of number generated that were already tested for the algorithm to consider the current best solution stable.
protected  long minSamplesToAnalyse
          The minimum number of samples that must be collected before an analysis is triggered.
protected  long minSamplesToCheckConvergence
          The minimum number of samples to be collected before checking if the performance profile has changed.
protected  float sizeRatioDeviation
          This parameter defines the multiplicity used to define the range available to random generator, as the maximum.
 
Constructor Summary
AnnealingTuneProfile()
          Initialize this profile with default values.
AnnealingTuneProfile(String profileName)
          Initialize this profile with values read from the configuration file.
AnnealingTuneProfile(TypedProperties config)
          Initialize this profile with values read from the configuration file.
 
Method Summary
 LoadBalancingProfile copy()
          Make a copy of this profile.
 int createDiff(int bestSize, int collectedSamples, Random rnd)
          Generate a difference to be applied to the best known bundle size.
protected  double expDist(long max, long x)
          This method implements the always decreasing policy of the algorithm.
 float getDecreaseRatio()
          Get the decrease rate for this profile.
static AnnealingTuneProfile getDefaultProfile()
          Get the default profile with default parameter values.
 double getMaxDeviation()
          Get the percentage of deviation of the current mean to the mean when the system was considered stable.
 int getMaxGuessToStable()
          Get the maximum number of guesses of number generated that were already tested for the algorithm to consider the current best solution stable.
 long getMinSamplesToAnalyse()
          Get the minimum number of samples that must be collected before an analysis is triggered.
 long getMinSamplesToCheckConvergence()
          Get the the minimum number of samples to be collected before checking if the performance profile has changed.
 float getSizeRatioDeviation()
          Get the multiplicity used to define the range available to random generator, as the maximum.
 void setDecreaseRatio(float decreaseRatio)
          Set the decrease rate for this profile.
 void setMaxDeviation(double maxDeviation)
          Set the percentage of deviation of the current mean to the mean when the system was considered stable.
 void setMaxGuessToStable(int maxGuessToStable)
          Set the maximum number of guesses of number generated that were already tested for the algorithm to consider the current best solution stable.
 void setMinSamplesToAnalyse(long minSamplesToAnalyse)
          Set the minimum number of samples that must be collected before an analysis is triggered.
 void setMinSamplesToCheckConvergence(long minSamplesToCheckConvergence)
          Set the the minimum number of samples to be collected before checking if the performance profile has changed.
 void setSizeRatioDeviation(float sizeRatioDeviation)
          Set the multiplicity used to define the range available to random generator, as the maximum.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

minSamplesToAnalyse

protected long minSamplesToAnalyse
The minimum number of samples that must be collected before an analysis is triggered.


minSamplesToCheckConvergence

protected long minSamplesToCheckConvergence
The minimum number of samples to be collected before checking if the performance profile has changed.


maxDeviation

protected double maxDeviation
The percentage of deviation of the current mean to the mean when the system was considered stable.


maxGuessToStable

protected int maxGuessToStable
The maximum number of guesses of number generated that were already tested for the algorithm to consider the current best solution stable.


sizeRatioDeviation

protected float sizeRatioDeviation
This parameter defines the multiplicity used to define the range available to random generator, as the maximum.


decreaseRatio

protected float decreaseRatio
This parameter defines how fast does it will stop generating random numbers. This is essential to define what is the size of the universe will be explored. Greater numbers make the algorithm stop sooner. Just as example, if the best solution is between 0-100, the following might occur: This expected number of guesses might not occur if the number of getMaxGuessToStable() is short.

Constructor Detail

AnnealingTuneProfile

public AnnealingTuneProfile()
Initialize this profile with default values.


AnnealingTuneProfile

public AnnealingTuneProfile(String profileName)
Initialize this profile with values read from the configuration file.

Parameters:
profileName - name of the profile in the configuration file.

AnnealingTuneProfile

public AnnealingTuneProfile(TypedProperties config)
Initialize this profile with values read from the configuration file.

Parameters:
config - contains a mapping of the profile parameters to their value.
Method Detail

getSizeRatioDeviation

public float getSizeRatioDeviation()
Get the multiplicity used to define the range available to random generator, as the maximum.

Returns:
the multiplicity as a float value.

setSizeRatioDeviation

public void setSizeRatioDeviation(float sizeRatioDeviation)
Set the multiplicity used to define the range available to random generator, as the maximum.

Parameters:
sizeRatioDeviation - the multiplicity as a float value.

getDecreaseRatio

public float getDecreaseRatio()
Get the decrease rate for this profile.

Returns:
the decrease rate as a float value.

setDecreaseRatio

public void setDecreaseRatio(float decreaseRatio)
Set the decrease rate for this profile.

Parameters:
decreaseRatio - the decrease rate as a float value.

createDiff

public int createDiff(int bestSize,
                      int collectedSamples,
                      Random rnd)
Generate a difference to be applied to the best known bundle size.

Parameters:
bestSize - the known best size of bundle.
collectedSamples - the number of samples that were already collected.
rnd - a pseudo-random number generator.
Returns:
an always positive diff to be applied to bundle size

expDist

protected double expDist(long max,
                         long x)
This method implements the always decreasing policy of the algorithm. The ratio define how fast this instance will stop generating random numbers. The calculation is performed as max * exp(-x * getDecreaseRatio()).

Parameters:
max - the maximum value this algorithm will generate.
x - a randomly generated bundle size increment.
Returns:
an int value.

getMinSamplesToAnalyse

public long getMinSamplesToAnalyse()
Get the minimum number of samples that must be collected before an analysis is triggered.

Returns:
the number of samples as a long value.

setMinSamplesToAnalyse

public void setMinSamplesToAnalyse(long minSamplesToAnalyse)
Set the minimum number of samples that must be collected before an analysis is triggered.

Parameters:
minSamplesToAnalyse - the number of samples as a long value.

getMinSamplesToCheckConvergence

public long getMinSamplesToCheckConvergence()
Get the the minimum number of samples to be collected before checking if the performance profile has changed.

Returns:
the number of samples as a long value.

setMinSamplesToCheckConvergence

public void setMinSamplesToCheckConvergence(long minSamplesToCheckConvergence)
Set the the minimum number of samples to be collected before checking if the performance profile has changed.

Parameters:
minSamplesToCheckConvergence - the number of samples as a long value.

getMaxDeviation

public double getMaxDeviation()
Get the percentage of deviation of the current mean to the mean when the system was considered stable.

Returns:
the percentage of deviation as a double value.

setMaxDeviation

public void setMaxDeviation(double maxDeviation)
Set the percentage of deviation of the current mean to the mean when the system was considered stable.

Parameters:
maxDeviation - the percentage of deviation as a double value.

getMaxGuessToStable

public int getMaxGuessToStable()
Get the maximum number of guesses of number generated that were already tested for the algorithm to consider the current best solution stable.

Returns:
the number of guesses as an int value.

setMaxGuessToStable

public void setMaxGuessToStable(int maxGuessToStable)
Set the maximum number of guesses of number generated that were already tested for the algorithm to consider the current best solution stable.

Parameters:
maxGuessToStable - the number of guesses as an int value.

copy

public LoadBalancingProfile copy()
Make a copy of this profile.

Returns:
a newly created AutoTuneProfile instance.
See Also:
LoadBalancingProfile.copy()

getDefaultProfile

public static AnnealingTuneProfile getDefaultProfile()
Get the default profile with default parameter values.

Returns:
a AnnealingTuneProfile singleton instance.


Copyright © 2005-2010 JPPF Team.