Interface HeuristicSolution<T>

Type Parameters:
T - the type used to store the result of the solution. Check getResult() for more details.
All Superinterfaces:
java.lang.Comparable<HeuristicSolution<T>>
All Known Implementing Classes:
CloudletToVmMappingSolution

public interface HeuristicSolution<T>
extends java.lang.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.
Since:
CloudSim Plus 1.0
Author:
Manoel Campos da Silva Filho
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static org.slf4j.Logger LOGGER  
    static HeuristicSolution NULL
    An attribute that implements the Null Object Design Pattern for HeuristicSolution objects.
  • Method Summary

    Modifier and Type Method Description
    double getCost()
    Defines the cost of using this solution.
    default double getFitness()
    Defines how good the solution is and it the inverse of the getCost().
    Heuristic<HeuristicSolution<T>> getHeuristic()  
    T getResult()
    Gets the result of the solution.

    Methods inherited from interface java.lang.Comparable

    compareTo
  • Field Details

  • Method Details

    • getHeuristic

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

      default 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()
    • 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()
    • 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.