Localsolver  6.0
localsolver.LSStatistics Class Reference

Detailed Description

Statistics of the search.

The statistics are useful for evaluating the quality of your model. Indeed, your model is suited for LocalSolver (and more generally for local search) if the percentage of accepted moves is larger than 1 % with an annealing level equal to 0. Larger is the percentage of accepted moves, larger is the diversification of the search, better is the convergence toward high-quality solutions. If the number of accepted moves is too low, we suggests you to relax some constraints of the model (goal programming) or to augment the annealing level. A fine modeling is much preferable to a fine tuning of the search, both for effectiveness and for robustness.

Public Member Functions

LocalSolver GetLocalSolver ()
 Returns the LocalSolver object associated to these statistics.
int GetRunningTime ()
 Gets the running time in seconds.
long GetNbIterations ()
 Gets the number of iterations.
long GetNbMoves ()
 Gets the number of (attempted) moves.
long GetNbAcceptedMoves ()
 Gets the number of accepted moves.
long GetNbImprovingMoves ()
 Gets the number of accepted moves having improved the cost of the current solution.
long GetNbRejectedMoves ()
 Gets the number of rejected moves.
long GetNbInfeasibleMoves ()
 Gets the number of moves leading to infeasible solutions.
double GetPercentAcceptedMoves ()
 Gives the percentage of accepted moves relative to the number of moves.
double GetPercentImprovingMoves ()
 Gives the percentage of improving moves relative to the number of moves.
double GetPercentRejectedMoves ()
 Gives the percentage of rejected moves relative to the number of moves.
double GetPercentInfeasibleMoves ()
 Gives the percentage of infeasible moves relative to the number of moves.
string GetInfo ()
 Returns useful info about the search while running.
override string ToString ()
 Returns a string representation of the statistics.

Member Function Documentation

LocalSolver localsolver.LSStatistics.GetLocalSolver ( )

Returns the LocalSolver object associated to these statistics.

Returns
LocalSolver object
int localsolver.LSStatistics.GetRunningTime ( )

Gets the running time in seconds.

Note that is the "real" time spent (and not only the CPU or system time). Only allowed in states LSState::Paused or LSState::Stopped.

Returns
Running time in seconds.
long localsolver.LSStatistics.GetNbIterations ( )

Gets the number of iterations.

Only allowed in states LSState::Paused or LSState::Stopped.

Returns
Number of iterations.
long localsolver.LSStatistics.GetNbMoves ( )

Gets the number of (attempted) moves.

This corresponds to the number of explored solutions (feasible or infeasible). Only allowed in states LSState::Paused or LSState::Stopped.

Returns
Number of (attempted) moves.
long localsolver.LSStatistics.GetNbAcceptedMoves ( )

Gets the number of accepted moves.

Only allowed in states LSState::Paused or LSState::Stopped.

Returns
Number of accepted moves.
long localsolver.LSStatistics.GetNbImprovingMoves ( )

Gets the number of accepted moves having improved the cost of the current solution.

Improving moves are a part of accepted moves. Only allowed in states LSState::Paused or LSState::Stopped.

Returns
Number of improving moves.
long localsolver.LSStatistics.GetNbRejectedMoves ( )

Gets the number of rejected moves.

Only allowed in states LSState::Paused or LSState::Stopped.

Returns
Number of rejected moves.
long localsolver.LSStatistics.GetNbInfeasibleMoves ( )

Gets the number of moves leading to infeasible solutions.

Infeasible moves are a part of rejected moves. Only allowed in states LSState::Paused or LSState::Stopped.

Returns
Number of infeasible moves.
double localsolver.LSStatistics.GetPercentAcceptedMoves ( )

Gives the percentage of accepted moves relative to the number of moves.

Only allowed in states LSState::Paused or LSState::Stopped.

Returns
Percentage of accepted moves.
double localsolver.LSStatistics.GetPercentImprovingMoves ( )

Gives the percentage of improving moves relative to the number of moves.

Only allowed in states LSState::Paused or LSState::Stopped.

Returns
Percentage of improving moves.
double localsolver.LSStatistics.GetPercentRejectedMoves ( )

Gives the percentage of rejected moves relative to the number of moves.

Only allowed in states LSState::Paused or LSState::Stopped.

Returns
Percentage of rejected moves.
double localsolver.LSStatistics.GetPercentInfeasibleMoves ( )

Gives the percentage of infeasible moves relative to the number of moves.

Only allowed in states LSState::Paused or LSState::Stopped.

Returns
Percentage of infeasible moves.
string localsolver.LSStatistics.GetInfo ( )

Returns useful info about the search while running.

Only allowed if the solver has been started at least once. Only allowed in states LSState::Paused or LSState::Stopped. Useful for debugging or logging purposes. Here are some explanations about the output string:

  • "mov" corresponds to the number of moves performed.
  • "inf" corresponds to the percentage of infeasible moves.
  • "acc" corresponds to the percentage of accepted moves.
  • "imp" corresponds to the number of improving moves.
Returns
Info about the search while running.
override string localsolver.LSStatistics.ToString ( )

Returns a string representation of the statistics.

Only allowed in states LSState::Paused or LSState::Stopped. Useful for debugging or logging purposes.

Returns
String representation.