protected class RandomShrinkSearch.RandomSearcher extends java.lang.Object implements RandomShrinkSearch.Searcher
| Modifier and Type | Field and Description |
|---|---|
protected double |
_changeProbabilityBase
Description of the Field
|
protected java.util.Random |
_randomGenerator
Description of the Field
|
protected java.util.Map<Variable,java.lang.Number> |
_values
Map of values keyed by variable
|
protected int |
NUM_VARIABLES
Description of the Field
|
| Constructor and Description |
|---|
RandomSearcher()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
newTopSolution(TrialPoint oldPoint,
TrialPoint newPoint)
An event indicating that a new solution has been found which is better than the previous
best solution according to the score given by the evaluator.
|
TrialPoint |
nextPoint()
Get the next trial point.
|
TrialPoint |
nextPoint(int expectedNumToChange)
Get the next trial point given the expected number of variables to change.
|
TrialPoint |
nextTrialPoint()
Get the next trial point.
|
protected double |
proposeValue(Variable variable)
Propose a new value for the variable by selecting a random value in the variable's search
range.
|
void |
reset()
reset for searching from scratch; forget history
|
protected final int NUM_VARIABLES
protected java.util.Random _randomGenerator
protected double _changeProbabilityBase
protected java.util.Map<Variable,java.lang.Number> _values
public void reset()
reset in interface RandomShrinkSearch.Searcherpublic void newTopSolution(TrialPoint oldPoint, TrialPoint newPoint)
newTopSolution in interface RandomShrinkSearch.SearcheroldPoint - The old best point.newPoint - The new best point.public TrialPoint nextTrialPoint()
nextTrialPoint in interface RandomShrinkSearch.Searcherpublic TrialPoint nextPoint()
public TrialPoint nextPoint(int expectedNumToChange)
expectedNumToChange - The average number of variables that we expect to change.protected double proposeValue(Variable variable)
variable - the variable for which to propose a new value