HeuristicSolution

public interface HeuristicSolution<T> extends Comparable<HeuristicSolution<T>>

A solution for a complex problem found using a Heuristic implementation. A heuristic can generate multiple solutions until find an optimal or suboptimal solution for the problem.

Author:

Manoel Campos da Silva Filho

Parameters:
  • <T> – the type used to store the result of the solution. Check getResult() for more details.

Fields

NULL

HeuristicSolution NULL

An attribute that implements the Null Object Design Pattern for HeuristicSolution objects.

Methods

getCost

double getCost()

Defines the cost of using this solution. As higher is the cost, worse is a solution. How a solution cost is computed is totally dependent of the heuristic implementation being used to find a solution.

Returns:the solution cost

See also: .getFitness()

getFitness

double getFitness()

Defines how good the solution is and it the inverse of the getCost(). As higher is the fitness, better is a solution. How a solution fitness is computed is totally dependent of the heuristic implementation being used to find a solution.

Returns:the solution fitness

See also: .getCost()

getHeuristic

Heuristic<HeuristicSolution<T>> getHeuristic()
Returns:the heuristic that generated this solution.

getResult

T getResult()

Gets the result of the solution. For instance, if a implementation of this interface aims to provide a mapping between Cloudlets and Vm’s, this type would be a Map<Cloudlet, Vm>, that will indicate which Vm will run each Cloudlet. This way, the type T of the solution is totally dependent of the problem being solved by the heuristic implementation.

The result of solution is generated by a heuristic. Getting an optimal or sub-optimal solution is the final goal of a heuristic.

Returns:the object containing the result of the generated solution.