LSStatistics Class¶
-
class
localsolver::
LSStatistics
¶ Statistics of the search.
Summary¶
getRunningTime |
Gets the running time in seconds. |
getNbIterations |
Gets the number of iterations. |
getNbMoves |
Gets the number of (attempted) moves. |
getNbAcceptedMoves |
Gets the number of accepted moves. |
getNbImprovingMoves |
Gets the number of accepted moves having improved the cost of the current solution. |
getNbRejectedMoves |
Gets the number of rejected moves. |
getNbInfeasibleMoves |
Gets the number of moves leading to infeasible solutions. |
getPercentAcceptedMoves |
Gives the percentage of accepted moves relative to the number of moves. |
getPercentImprovingMoves |
Gives the percentage of improving moves relative to the number of moves. |
getPercentRejectedMoves |
Gives the percentage of rejected moves relative to the number of moves. |
getPercentInfeasibleMoves |
Gives the percentage of infeasible moves relative to the number of moves. |
toString |
Returns a string representation of the statistics. |
getInfo |
Returns useful info about the search while running. |
Functions¶
-
int
getRunningTime
() const¶ 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 S_Paused or S_Stopped.
Return: Running time in seconds.
-
long long
getNbIterations
() const¶ Gets the number of iterations.
Only allowed in states S_Paused or S_Stopped.
Return: Number of iterations.
-
long long
getNbMoves
() const¶ Gets the number of (attempted) moves.
This corresponds to the number of explored solutions (feasible or infeasible). Only allowed in states S_Paused or S_Stopped. DEPRECATED since 9.0 : This parameter gives an inaccurate view of LocalSolver search.
Return: Number of (attempted) moves.
-
long long
getNbAcceptedMoves
() const¶ Gets the number of accepted moves.
Only allowed in states S_Paused or S_Stopped. DEPRECATED since 9.0 : This parameter gives an inaccurate view of LocalSolver search.
Return: Number of accepted moves.
-
long long
getNbImprovingMoves
() const¶ 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 S_Paused or S_Stopped. DEPRECATED since 9.0 : This parameter gives an inaccurate view of LocalSolver search.
Return: Number of improving moves.
-
long long
getNbRejectedMoves
() const¶ Gets the number of rejected moves.
Only allowed in states S_Paused or S_Stopped. DEPRECATED since 9.0 : This parameter gives an inaccurate view of LocalSolver search.
Return: Number of rejected moves.
-
long long
getNbInfeasibleMoves
() const¶ Gets the number of moves leading to infeasible solutions.
Infeasible moves are a part of rejected moves. Only allowed in states S_Paused or S_Stopped. DEPRECATED since 9.0 : This parameter gives an inaccurate view of LocalSolver search.
Return: Number of infeasible moves.
-
double
getPercentAcceptedMoves
() const¶ Gives the percentage of accepted moves relative to the number of moves.
Only allowed in states S_Paused or S_Stopped. DEPRECATED since 9.0 : This parameter gives an inaccurate view of LocalSolver search.
Return: Percentage of accepted moves.
-
double
getPercentImprovingMoves
() const¶ Gives the percentage of improving moves relative to the number of moves.
Only allowed in states S_Paused or S_Stopped. DEPRECATED since 9.0 : This parameter gives an inaccurate view of LocalSolver search.
Return: Percentage of improving moves.
-
double
getPercentRejectedMoves
() const¶ Gives the percentage of rejected moves relative to the number of moves.
Only allowed in states S_Paused or S_Stopped. DEPRECATED since 9.0 : This parameter gives an inaccurate view of LocalSolver search.
Return: Percentage of rejected moves.
-
double
getPercentInfeasibleMoves
() const¶ Gives the percentage of infeasible moves relative to the number of moves.
Only allowed in states S_Paused or S_Stopped. DEPRECATED since 9.0 : This parameter gives an inaccurate view of LocalSolver search.
Return: Percentage of infeasible moves.
-
std::string
toString
() const¶ Returns a string representation of the statistics.
Only allowed in states S_Paused or S_Stopped. Useful for debugging or logging purposes.
Return: String representation.
-
std::string
getInfo
() const¶ Returns useful info about the search while running.
Only allowed if the solver has been started at least once. Only allowed in states S_Paused or S_Stopped. Useful for debugging or logging purposes.
- “sec” stands for the number of seconds.
- “itr” stands for the number of iterations.
- “infeas” corresponds to the infeasibility score of the best solution found, if infeasible.
- “obj” corresponds to the objective values of the best solution found, if feasible.
Return: Info about the search while running.