Package org.cloudsimplus.heuristics
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 find an optimal or suboptimal
solution for the problem.- Since:
- CloudSim Plus 1.0
- Author:
- Manoel Campos da Silva Filho
-
Field Summary
Modifier and TypeFieldDescriptionstatic final org.slf4j.Logger
static final HeuristicSolution
An attribute that implements the Null Object Design Pattern forHeuristicSolution
objects. -
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 forHeuristicSolution
objects.
-
-
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 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
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:
-
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 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 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.
-