Stochastic Hill Climber
A class that implements the Stochastic Hill Climbing optimization algorithm. This algorithm searches for an optimal solution by iteratively evaluating and moving to neighborhood solutions, as determined by the evaluator and the problem definition. It uses a stochastic approach to explore the solution space by leveraging a random number stream.
Parameters
An evaluator object that provides the problem definition and performs solution evaluation.
The maximum number of iterations the algorithm is allowed to execute.
An instance of ReplicationPerEvaluationIfc
defining the strategy for determining the number of replications per evaluation.
the random number stream number, defaults to 0, which means the next stream
the provider of random number streams, defaults to KSLRandom.DefaultRNStreamProvider
An optional name for this solver instance.
Constructors
Constructs an instance of StochasticHillClimber with specified parameters.
Creates a StochasticHillClimber instance with the provided evaluator, maximum iterations, replications per evaluation strategy, and an optional random number stream and name.
Properties
If true, the stream will automatically participate in having its stream advanced to the next sub-stream via stream managers
Tells the stream to start producing antithetic variates
The best solution found so far in the search. Some algorithms may allow the current solution to vary from the best solution due to randomness or other search needs (e.g., explore bad areas with the hope of getting better). The algorithm should ensure the updating of the best solution found across any iteration.
Represents the current point (input settings) of the solver during its iterative process.
The current (or last) solution that was accepted as a possible solution to recommend for the solver. It is the responsibility of the subclass to determine the current solution.
Indicates whether the solver allows infeasible requests to be sent to the evaluator. The default is false. That is, the solver is allowed to send infeasible problem requests for evaluation by the evaluator.
The initial point associated with the initial solution.
Returns the number of times the main iteration function was called.
Allow the status of the iterative process to be accessible
The maximum number of iterations when sampling for an input feasible point
The maximum number of iterations permitted for the main loop. This must be greater than 0.
The user can supply a function that will generate a neighbor for the evaluation process. If supplied, this function will be used instead of the pre-defined generateNeighbor() function. The user may also override the generateNeighbor() function when developing subclasses.
Counts the number of times that a new current solution replaced the current best solution. This can be used to measure how often an iteration results in a better solution being found.
The difference between the previous solution's penalized objective function value and the current solution's penalized objective function value.
The previous point in the solution process. It is associated with the previous solution.
The previous solution in the sequence of solutions.
A convenience property to access the problem being solved
If true, the stream will automatically participate in having its stream reset to its start stream via stream managers
rnStream provides a reference to the underlying stream of random numbers
If true, updates to the current solution will be captured automatically to memory. The default is false.
The user can supply a comparator for comparing whether one solution is smaller, equal to, or larger than another solution. If supplied, this function will be used instead of the implemented compare() function. The user can supply a function or override the compare function to specialize how solutions are compared.
A variable representing an instance of the SolutionQualityEvaluatorIfc
interface. It is used to assess and evaluate the quality of a given solution. The variable can hold a nullable implementation of the interface.
A read-only view of the solutions evaluated by the solver. Not all solvers retain past solutions. Also, in general, the evaluator will have access to a cache of solutions.
An initial starting point for the solver. If supplied, this point will be used instead of the returned value of the startingPoint() function. The default is null, which indicates that the function should be called to obtain the initial starting point.
The difference between the previous solution's unpenalized objective function value and the current solution's unpenalized objective function value.
Functions
Positions the RNG at the beginning of its next substream
Recognizing the need to be able to compare solutions that may have sampling error, the user can override this function to provide more extensive comparison or supply an instance of the CompareSolutionsIfc interface via the solutionComparer property Returns -1 if first is less than the second solution, 0 if the solutions are to be considered equivalent, and 1 if the first is larger than the second solution.
Note that the iterations can only be ended before running all iterations or before running the next iteration. Use stopIterations() to cause a graceful completion of inner and outer iterations.
Generates a random neighbor of the current point that satisfies input feasibility constraints. The method attempts to generate a feasible point by randomizing the input variables of the current point. If a feasible point cannot be generated within a maximum number of iterations, an exception is thrown.
Checks if the iterative process has additional iterations to execute. This does not check other stopping criteria related to solution quality or convergence. This is about how many iterations have been executed from the maximum specified.
Causes the solver to be initialized. It will then be in a state that allows for the running of the iterations.
The resetStartStream method will position the RNG at the beginning of its stream. This is the same location in the stream as assigned when the RNG was created and initialized.
Resets the position of the RNG at the start of the current substream
Causes the solver to run all iterations until its stopping criteria is met or the maximum number of iterations has been reached.
Runs the next iteration. Only valid if the solver has been initialized and there are additional iterations to run.
Causes a graceful stopping of the iterative processes for the solver. The inner process will complete its current iteration, and then no more outer iterations will start.