Heuristic<S extends HeuristicSolution<?>>¶
Provides the methods to be used for implementation of heuristics to find solution for complex problems where the solution space to search is large. These problems are usually NP-Hard ones which the time to find a solution increases, for instance, in exponential time. Such problems can be, for instance, mapping a set of VMs to existing Hosts or mapping a set of Cloudlets to VMs. A heuristic implementation thus provides an approximation of an optimal solution (a suboptimal solution).
Manoel Campos da Silva Filho
- <S> – the
class of solutionsthe heuristic will deal with
- <S> – the
Creates a neighbor solution cloning a source one and randomly changing some of its values. A neighbor solution is one that is close to the current solution and has just little changes.
- source – the source to create a neighbor solution
the cloned and randomly changed solution that represents a neighbor solution
Computes the acceptance probability to define if a neighbor solution has to be accepted or not, compared to the
Returns: the acceptance probability, in scale from [0 to 1] where 0 is to maintain the
current solution, 1 is to accept the neighbor solution, while intermediate values defines the probability that the neighbor solution will be randomly accepted.
Gets the initial solution that the heuristic will start from in order to try to improve it. If not initial solution was generated yet, one should be randomly generated.
Returns: the initial randomly generated solution
Returns: latest neighbor solution created
Gets a random number between 0 (inclusive) and maxValue (exclusive).
- maxValue – the max value to get a random number (exclusive)
the random number
Returns: the time taken to finish the solution search (in seconds).
Checks if the solution search can be stopped.
Returns: true if the solution search can be stopped, false otherwise.