Interface HeuristicSolution<T>
- Type Parameters:
T- the type used to store the result of the solution. CheckgetResult()for more details.
- All Superinterfaces:
Comparable<HeuristicSolution<T>>
- All Known Implementing Classes:
CloudletToVmMappingSolution
A solution for a complex problem found using a
Heuristic implementation.
A heuristic can generate multiple solutions until finding an optimal or suboptimal
solution for the problem.- Since:
- CloudSim Plus 1.0
- Author:
- Manoel Campos da Silva Filho
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.slf4j.Loggerstatic final HeuristicSolutionAn attribute that implements the Null Object Design Pattern forHeuristicSolutionobjects. -
Method Summary
Methods inherited from interface java.lang.Comparable
compareTo
-
Field Details
-
LOGGER
static final org.slf4j.Logger LOGGER -
NULL
An attribute that implements the Null Object Design Pattern forHeuristicSolutionobjects.
-
-
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 thegetCost(). As higher the fitness, the better a solution is. How a solution fitness is computed is totally dependent on the heuristic implementation being used to find a solution.- Returns:
- the solution fitness
- See Also:
-
getCost
double getCost()Defines the cost of using this solution. As higher is the cost, the worse a solution is. How a solution cost is computed is totally dependent on the heuristic implementation being used to find a solution.- Returns:
- the solution cost
- See Also:
-
getResult
T getResult()Gets the result of the solution. For instance, if an implementation of this interface aims to provide a mapping between Cloudlets and Vm's, this type would be aMap<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 a solution is generated by a heuristic. Getting an optimal or suboptimal solution is the final goal of a heuristic.
- Returns:
- the object containing the result of the generated solution.
-