18 #ifndef HLIDAC_PES_KNOWLEDGE_BASE_H
19 #define HLIDAC_PES_KNOWLEDGE_BASE_H
94 std::pair<uint64_t, double>
infoLP();
146 void record(T value, T& addTo);
157 void record(T value, T& addTo, std::atomic<uint64_t>& counter);
165 std::pair<uint64_t, double>
getInfo(
double& aggregatedValue, std::atomic<uint64_t>& counter);
void reportInfDueToPathChange()
Reports that a diversification change of paths resulted in an infeasible solution.
uint64_t numberOfChangePathBreaks() const
Returns how many times the change of paths resulted in infeasibility.
void reportInfDueToPwrmHeur()
It reports that a power mode change of HeuristicAlgorithms::heuristicPowerModeSelection sub-heuristic...
void addTuple(CircuitTuple &&t)
Add a tuple to the mutex protected queue of tuples.
double mTupleGenTime
Aggregated processor time required for the generation of all the tuples.
The structure representing a solution found by an algorithm.
uint64_t numberOfLocHeurBreaks() const
Returns how many times the change locations sub-heuristic caused the infeasibility of the solution...
double mPwrmHeurTime
Aggregated processor time of all the (de)select power mode sub-heuristic calls.
void record(T value, T &addTo)
It carries out "addTo += value" operation, however protected by a mutex.
void candidate(const Solution &s, const CircuitTuple &t)
If a found solution ranks among the top ones, it is added to the list of elite solutions.
std::atomic< uint64_t > mPathChangeCalls
The number of robot path diversifications, i.e. the number of calls of ParallelHeuristicSolver::chang...
std::list< std::pair< Solution, CircuitTuple > > mEliteSolutions
List of elite solutions.
CircuitTuple getTuple()
Returns a partially fixed solution called tuple.
std::list< std::pair< Solution, CircuitTuple > > eliteSolutions()
Returns a list of elite solutions and their tuples from which they have been calculated.
std::atomic< uint64_t > mProcessedTuples
The number of processed tuples.
uint64_t numberOfLPBreaks() const
Returns how many times it was not possible to obtain an initial solution, i.e. timing.
std::pair< uint64_t, double > infoLocHeur()
Returns the total number of HeuristicAlgorithms::heuristicLocationChanges calls and average runtime f...
double percentageOfProcessed()
Percentage of the processed tuples.
The structures and methods suitable for fast searching in the data structure of the robotic cell...
std::atomic< uint64_t > mAddedTuples
Total number of generated tuples.
std::atomic< uint64_t > mOptimizationPhaseCounter
Records the number of tuples coming to the optimization process of the heuristic. ...
double mSumOfLocHeurErrs
The sum of the relative estimation errors (calculated by the change locations sub-heuristic) of energ...
std::atomic< uint64_t > mInfDueToPwrmHeur
The number of feasibility breakings caused by (de)select power mode sub-heuristic.
Protected access to the shared data of the threads of the parallel heuristic.
Various data structures used by the heuristic.
std::vector< std::string > mErrorMessages
Vector containing error messages of worker threads (to throw an exception later). ...
void recordLPFixDeterioration(double deterioration)
Reports a relative deterioration in the solution quality caused by the resolution of collisions...
std::pair< uint64_t, double > infoLP()
Returns the total number of Linear Programming calls and its average runtime for one worker thread...
void recordInfeasibleLP()
Reports that the solution of the Linear Programming problem was infeasible (one call of LP)...
Solution bestSolution()
Returns the best found solution, throws an exception if not available.
std::atomic< uint64_t > mSumOfIters
The total number of optimization iterations.
void recordChangePathCall()
Reports that robot paths were diversified, i.e. ParallelHeuristicSolver::changeRobotPaths method was ...
std::atomic< uint64_t > mInfeasibleCounter
How many times a Linear Programming solver returned an infeasible solution.
void addErrorMessage(const std::string &msg)
Add an error message to the mutex protected vector of messages.
std::atomic< uint64_t > mPwrmHeurCalls
The number of (de)select power mode sub-heuristic calls.
std::atomic< uint64_t > mInfDueToLP
How many times it was not possible to obtain feasible timing for a tuple.
uint64_t pathChangeCalls() const
The total number of ParallelHeuristicSolver::changeRobotPaths calls.
A partially fixed problem, i.e. tuple.
std::mutex mStatMtx
Mutex ensuring the flawless float operations for multiple concurrent threads.
std::atomic< uint64_t > mLPFixCalls
How many times a partially fixed problem was successfully solved.
void recordPwrmHeurCall(double runtime)
Reports a real time (measured by a timer) required by HeuristicAlgorithms::heuristicPowerModeSelectio...
double mLocHeurTime
Aggregated processor time of all the change locations sub-heuristic calls.
std::atomic< uint64_t > mInfDueToChangedPath
The number of feasibility breakings caused by the path diversification.
void recordLPCall(double runtime)
Reports a real time (measured by a timer) required for solving a partially fixed problem by Linear Pr...
void recordLocHeurRelErr(double relativeEstError)
Reports a relative estimation error of the change locations sub-heuristic for an energy improvement...
void recordNumberOfItersPerTuple(uint64_t iters)
Reports the number of optimization iterations performed for a loaded tuple.
std::mutex mErrorsMtx
Mutex protecting the access to the vector of error messages.
std::atomic< uint64_t > mLocHeurCalls
The number of change locations sub-heuristic calls.
std::atomic< uint64_t > mLPCalls
The number of Linear Programming calls.
std::mutex mTuplesMtx
Mutex protecting the access to the queue that contains tuples.
std::pair< uint64_t, double > infoItersPerTuple()
Returns the total number of tuples used for optimization and the average number of optimization itera...
void recordPwrmHeurRelErr(double relativeEstError)
Reports a relative estimation error of the (de)select power mode sub-heuristic for an energy improvem...
double averageErrOfLocHeur()
Returns an average estimation error of the change locations sub-heuristic.
std::pair< uint64_t, double > getInfo(double &aggregatedValue, std::atomic< uint64_t > &counter)
Auxiliary method used for the calculation of an average time of a call based on a counter value and t...
double averageNumberOfLPCallsForLPFix()
Returns an average number of added precedences required for collisions avoidance. ...
std::atomic< uint64_t > mInfDueToLocHeur
The number of feasibility breakings caused by change locations sub-heuristic.
std::pair< uint64_t, double > infoPwrmHeur()
Returns the total number of HeuristicAlgorithms::heuristicPowerModeSelection calls and average runtim...
std::queue< CircuitTuple > mTuples
Queue with the generated tuples.
void reportInfDueToLocHeur()
It reports that changes of HeuristicAlgorithms::heuristicLocationChanges sub-heuristic caused infeasi...
double mLPTime
Aggregated processor time of all the Linear Programming calls.
A representation of the solution that is algorithm independent.
double mSumOfPwrmHeurErrs
The sum of the relative estimation errors (calculated by the (de)select power mode sub-heuristic) of ...
double averageErrOfPwrmHeur()
Returns an average estimation error of the (de)select power mode sub-heuristic.
std::atomic< uint64_t > mPartProbCalls
How many times a partially fixed problem was evaluated, i.e. the number of calls of HeuristicAlgorith...
void recordPartialProblemSolveCall()
Reports that HeuristicAlgorithms::solvePartialProblem method was called.
std::mutex mEliteMtx
Mutex protecting the access to the list of elite solutions.
void reportInfDueToLP()
Reports that it was not possible to obtain a feasible solution from the generated tuple...
The file contains various classes devoted to abstract representation of the robotic cell...
double mSumOfDeteriorations
The sum of relative deteriorations of the energy consumption caused by the collision resolution...
double averageLPFixDeterioration()
Returns an average quality deterioration caused by the collisions resolution.
std::pair< uint64_t, double > infoTuplesGeneration()
Returns the total number of generated tuples and the average generation time for one worker thread...
uint64_t numberOfPwrmHeurBreaks() const
Returns how many times the (de)select power mode sub-heuristic caused infeasibility.
void recordAddTuplesCall(double runtime)
Reports a real time (measured by a timer) required for ParallelHeuristicSolver::addRandomTuplesToKB c...
double infeasibilityRate()
Infeasibility rate of Linear Programming, i.e. the proportion of infeasible solutions to feasible and...
void recordLocHeurCall(double runtime)
Reports a real time (measured by a timer) required by HeuristicAlgorithms::heuristicLocationChanges s...
std::vector< std::string > errorMessages() const
Returns all the error messages that occurred in the threads of the heuristic.