/// <summary> /// Creates a new <see cref="RandomRestartHillClimber{TState, TEvaluation}"/> that will perform numRestarts number of climber operations /// </summary> /// <param name="numRestarts">The number of climber operations to perform before returning a result</param> /// <param name="climberConfiguration">A configuration for the climber that will be executed at each restart</param> /// <param name="randomizationFunction">A function that will be given an instance of <see cref="TState"/> and should return a random <see cref="TState"/></param> public RandomRestartHillClimber(uint numRestarts, IClimberConfiguration <TState, TEvaluation> climberCofiguration, Func <TState, TState> randomizationFunction) { this.numRestarts = numRestarts; this.randomizationFunction = randomizationFunction; iterationClimberConfiguration = climberCofiguration; }
/// <summary> /// Creates a new <see cref="RandomRestartHillClimber{TState, TEvaluation}"/> that will perform numRestarts number of climber operations /// </summary> /// <param name="numRestarts">The number of climber operations to perform before returning a result</param> /// <param name="stateRandomizer">A complex state randomization strategy</param> /// <param name="climberConfiguration">A configuration for the climber that will be executed at each restart</param> public RandomRestartHillClimber(uint numRestarts, ISuccessorSelector <TState, TEvaluation> stateRandomizer, IClimberConfiguration <TState, TEvaluation> climberConfiguration) : this(numRestarts, climberConfiguration, c => stateRandomizer.Next(c)) { }