public class DirectedStep extends SearchAlgorithm
_eventProxy, _messageCenter, _problem
Constructor and Description |
---|
DirectedStep()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
algorithmAvailable(SearchAlgorithm source)
Handle a message that an algorithm is available.
|
void |
algorithmUnavailable(SearchAlgorithm source)
Handle a message that an algorithm is not available.
|
protected double[] |
calculateGradient(Trial originTrial,
AlgorithmRun algorithmRun)
Calculate the gradient for the specified point
|
protected double[] |
calculateVector(TrialPoint originPoint,
TrialPoint targetPoint)
Calculate the vector from the origin point to the target point
|
void |
foundNewOptimalSolution(SolutionJudge source,
java.util.List<Trial> solutions,
Trial solution)
Handle a message that a new optimal solution has been found.
|
java.lang.String |
getLabel()
Return the label for a search algorithm.
|
int |
getMinEvaluationsPerRun()
Get the minimum number of evaluations per run.
|
int |
globalRating()
Returns the global rating which in an integer between 0 and 10.
|
int |
localRating()
Returns the local rating which is an integer between 0 and 10.
|
protected Trial |
performAcceleratedSearch(Trial originTrial,
AlgorithmRun algorithmRun)
Perform an accelerated search.
|
protected Trial |
performGradientAndLinearSearch(Trial originTrial,
AlgorithmRun algorithmRun)
Perform a gradient calculation followed by a linear search along the gradient.
|
void |
performRun(AlgorithmRun algorithmRun)
Calculate the next few trial points.
|
void |
reset()
reset the algorithm for searching from scratch
|
protected Trial |
searchAlongGradient(double[] gradient,
Trial originTrial,
AlgorithmRun algorithmRun)
Search along the gradient from the origin point.
|
protected static TrialPoint |
trialPointAlongGradient(double[] gradient,
TrialPoint originPoint,
double scale,
java.util.List<Variable> variables)
Get a new trial point along the gradient.
|
void |
trialScored(AlgorithmSchedule schedule,
Trial trial)
Handle a message that a trial has been scored.
|
void |
trialVetoed(AlgorithmSchedule schedule,
Trial trial)
Handle a message that a trial has been vetoed.
|
addSearchAlgorithmListener, getMaxEvaluationsPerRun, removeSearchAlgorithmListener, setProblem, strategyExecuted, strategyWillExecute
public void reset()
reset
in class SearchAlgorithm
public java.lang.String getLabel()
getLabel
in class SearchAlgorithm
public void performRun(AlgorithmRun algorithmRun)
performRun
in class SearchAlgorithm
algorithmRun
- the algorithm run to perform the evaluationprotected Trial performAcceleratedSearch(Trial originTrial, AlgorithmRun algorithmRun)
protected Trial performGradientAndLinearSearch(Trial originTrial, AlgorithmRun algorithmRun)
protected double[] calculateGradient(Trial originTrial, AlgorithmRun algorithmRun)
protected double[] calculateVector(TrialPoint originPoint, TrialPoint targetPoint)
protected Trial searchAlongGradient(double[] gradient, Trial originTrial, AlgorithmRun algorithmRun)
protected static TrialPoint trialPointAlongGradient(double[] gradient, TrialPoint originPoint, double scale, java.util.List<Variable> variables)
public int getMinEvaluationsPerRun()
getMinEvaluationsPerRun
in class SearchAlgorithm
public int globalRating()
public int localRating()
public void algorithmAvailable(SearchAlgorithm source)
source
- The source of the available algorithm.public void algorithmUnavailable(SearchAlgorithm source)
source
- The source of the available algorithm.public void trialScored(AlgorithmSchedule schedule, Trial trial)
trialScored
in interface AlgorithmScheduleListener
trialScored
in class SearchAlgorithm
trial
- The trial that was scored.schedule
- the schedule providing this eventpublic void trialVetoed(AlgorithmSchedule schedule, Trial trial)
trialVetoed
in interface AlgorithmScheduleListener
trialVetoed
in class SearchAlgorithm
trial
- The trial that was vetoed.schedule
- the schedule providing this eventpublic void foundNewOptimalSolution(SolutionJudge source, java.util.List<Trial> solutions, Trial solution)
foundNewOptimalSolution
in interface SolutionJudgeListener
foundNewOptimalSolution
in class SearchAlgorithm
source
- The source of the new optimal solution.solutions
- The list of solutions.solution
- The new optimal solution.