Unfit  3.1.1
Data fitting and optimization software
Public Member Functions | List of all members
Unfit::TestSimulatedAnnealing Class Reference
Inheritance diagram for Unfit::TestSimulatedAnnealing:
Unfit::SimulatedAnnealing Unfit::GenericOptimizer

Public Member Functions

void AccessInitialiseParameters ()
 
void AccessGenerateTrialPoint (std::vector< double > &trial_point, int i)
 
void AccessUpdateStepSizes ()
 
void AccessResetStepSizes (double step_size)
 
void AccessSetGeneratorSeed (unsigned seed)
 
void SetDimensions (std::size_t dimensions)
 
std::size_t GetDimensions ()
 
std::size_t GetCostIndex ()
 
double GetPreviousBestCost ()
 
void SetStepSizes (std::vector< double > &step_sizes)
 
std::vector< double > GetStepSizes ()
 
void SetAcceptanceRatios (std::vector< double > &ratios)
 
std::vector< double > GetAcceptanceRatios ()
 
double GetRandomNumber ()
 
- Public Member Functions inherited from Unfit::SimulatedAnnealing
 SimulatedAnnealing ()
 
virtual ~SimulatedAnnealing ()=default
 
int FindMin (GenericCostFunction &CostFunction, std::vector< double > &coordinates) override
 A method to find a minimum point of a function using a Simulated Annealing approach. More...
 
void Reset () override
 
- Public Member Functions inherited from Unfit::GenericOptimizer
 GenericOptimizer ()
 
virtual ~GenericOptimizer ()
 
void ResetGenericOptimizer ()
 
virtual double GetCost (std::size_t index=0) const noexcept
 
virtual bool GetIsPopulationBased () const noexcept
 
virtual std::size_t GetNumberOfIterations () const noexcept
 
virtual std::size_t GetNumberOfFunctionEvaluations () const noexcept
 
virtual std::vector< std::vector< double > > GetPopulation () const
 
virtual std::vector< double > GetSolution (std::size_t index=0) const
 
virtual void SetPopulation (const std::vector< std::vector< double >> &population)
 

Additional Inherited Members

- Public Attributes inherited from Unfit::GenericOptimizer
Unfit::Bounds bounds
 
Unfit::Options options
 
- Protected Member Functions inherited from Unfit::GenericOptimizer
virtual bool CalculateCost (GenericCostFunction &CostFunction, std::vector< double > &x)
 
void GeneratePopulation (GenericCostFunction &CostFunction, std::size_t dimensions)
 
void GenerateRandomEngines ()
 
virtual bool IsConverged (const std::vector< double > &best_member, std::size_t truncated_index=0) const
 Checks to see if the population has converged. More...
 
virtual void PrintInitialOutput (double best_cost) const
 
virtual void PrintIterationOutput (double best_cost) const
 
virtual void PrintFinalOutput () const
 
virtual void SortPopulation () noexcept
 
- Protected Attributes inherited from Unfit::GenericOptimizer
std::vector< std::vector< double > > population_
 
std::vector< std::mt19937 > random_engines_
 
std::atomic< std::size_t > function_evaluations_
 
std::atomic< std::size_t > iterations_
 
bool is_population_based_
 

Detailed Description

This class is designed solely to provide the functionality to access the private methods and private members of the SimulatedAnnealing class.

Member Function Documentation

◆ AccessGenerateTrialPoint()

void Unfit::TestSimulatedAnnealing::AccessGenerateTrialPoint ( std::vector< double > &  trial_point,
int  i 
)
inline

This method provides access to the private method GenerateTrialPoint from the SimulatedAnnealing class for testing purposes.

Parameters
trial_pointThe coordinate vector to be perturbed
iThe index (coordinate) to perturb

◆ AccessInitialiseParameters()

void Unfit::TestSimulatedAnnealing::AccessInitialiseParameters ( )
inline

This method provides access to the private method InitialiseParameters from the SimulatedAnnealing class for testing purposes.

◆ AccessResetStepSizes()

void Unfit::TestSimulatedAnnealing::AccessResetStepSizes ( double  step_size)
inline

This method provides access to the private method ResetStepSizes from the SimulatedAnnealing class for testing purposes.

Parameters
step_sizeA value used for scaling the step size

◆ AccessSetGeneratorSeed()

void Unfit::TestSimulatedAnnealing::AccessSetGeneratorSeed ( unsigned  seed)
inline

A function to access the private random number generator in the SimulatedAnnealing class and change its seed.

Parameters
seedThe new seed

◆ AccessUpdateStepSizes()

void Unfit::TestSimulatedAnnealing::AccessUpdateStepSizes ( )
inline

This method provides access to the private method UpdateStepSizes from the SimulatedAnnealing class for testing purposes.

◆ GetAcceptanceRatios()

std::vector<double> Unfit::TestSimulatedAnnealing::GetAcceptanceRatios ( )
inline

Get the private member acceptance_ratios_ of the SimulatedAnnealing class

Returns
The vector of acceptance ratios

◆ GetCostIndex()

std::size_t Unfit::TestSimulatedAnnealing::GetCostIndex ( )
inline

Get the private member cost_ of the SimulatedAnnealing class

Returns
The cost index

◆ GetDimensions()

std::size_t Unfit::TestSimulatedAnnealing::GetDimensions ( )
inline

Get the private member dimensions_ of the SimulatedAnnealing class

Returns
The number of dimensions

◆ GetPreviousBestCost()

double Unfit::TestSimulatedAnnealing::GetPreviousBestCost ( )
inline

Get the private member previous_best_cost_ of the SimulatedAnnealing class

Returns
The cost index

◆ GetRandomNumber()

double Unfit::TestSimulatedAnnealing::GetRandomNumber ( )
inline

A function to access the private random number generator in the SimulatedAnnealing class, and the uniform distribution.

Returns
A uniform random number on the interval [0, 1]

◆ GetStepSizes()

std::vector<double> Unfit::TestSimulatedAnnealing::GetStepSizes ( )
inline

Get the private member step_sizes_ of the SimulatedAnnealing class

Returns
The vector of step sizes

◆ SetAcceptanceRatios()

void Unfit::TestSimulatedAnnealing::SetAcceptanceRatios ( std::vector< double > &  ratios)
inline

Set the private member acceptance_ratios_ of the SimulatedAnnealing class

Parameters
ratiosThe vector of acceptance ratios

◆ SetDimensions()

void Unfit::TestSimulatedAnnealing::SetDimensions ( std::size_t  dimensions)
inline

This method allows the number of dimensions of the problem to be set directly for testing purposes. dimensions_ is a private member of the SimulatedAnnealing Class.

Parameters
dimensionsThe number of dimensions required

◆ SetStepSizes()

void Unfit::TestSimulatedAnnealing::SetStepSizes ( std::vector< double > &  step_sizes)
inline

Set the private member step_sizes_ of the SimulatedAnnealing class

Parameters
step_sizesThe vector of step sizes

The documentation for this class was generated from the following file: