public class Solution<V extends Variable<V,T>,T extends Value<V,T>> extends Object
Model
,
Solver
Constructor and Description |
---|
Solution(Model<V,T> model)
Constructor
|
Solution(Model<V,T> model,
long iteration,
double time)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addSolutionListener(SolutionListener<V,T> listener)
Adds solution listner
|
void |
clearBest()
Clear the best ever found solution
|
Map<String,String> |
getBestInfo()
Info of the best ever found solution
|
long |
getBestIteration()
Iteration when the best ever found solution was found
|
double |
getBestPerturbationsPenalty()
Perturbation penalty of the best ever found solution (see
PerturbationsCounter ) |
double |
getBestTime()
Solution time when the best ever found solution was found
|
double |
getBestValue()
Total value of the best ever found solution -- sum of all assigned values
(see
Value.toDouble() ). |
Map<String,String> |
getExtendedInfo()
Extended solution information.
|
Map<String,String> |
getInfo()
Solution information.
|
Map<String,String> |
getInfo(Collection<V> variables)
Solution information.
|
long |
getIteration()
Current iteration
|
Model<V,T> |
getModel()
The model associated with the solution
|
PerturbationsCounter<V,T> |
getPerturbationsCounter()
Returns perturbation counter
|
double |
getTime()
Current solution time (time in seconds from the start of the solver)
|
void |
init(Solver<V,T> solver)
Initialization
|
boolean |
isBestComplete()
Returns true, if all variables of the best ever solution found are
assigned
|
void |
removeSolutionListener(SolutionListener<V,T> listener)
Removes solution listener
|
void |
restoreBest()
Restore the best ever found solution into the current solution (it also
calls
Model.restoreBest() ) |
void |
saveBest()
Save the current solution as the best ever found solution (it also calls
Model.saveBest() ) |
void |
setBestValue(double bestValue)
Set total value of the best ever found solution
|
String |
toString() |
void |
update(double time)
Update time, increment current iteration
|
public long getIteration()
public double getTime()
public void update(double time)
public Map<String,String> getInfo()
public Map<String,String> getExtendedInfo()
getInfo()
, but
some more information (that is more expensive to compute) might be added.
Also extended model information is added (see
Model.getExtendedInfo()
) into the resultant table.public Map<String,String> getInfo(Collection<V> variables)
public Map<String,String> getBestInfo()
public long getBestIteration()
public double getBestTime()
public boolean isBestComplete()
public double getBestValue()
Value.toDouble()
).public void setBestValue(double bestValue)
public double getBestPerturbationsPenalty()
PerturbationsCounter
)public PerturbationsCounter<V,T> getPerturbationsCounter()
public void clearBest()
public void saveBest()
Model.saveBest()
)public void restoreBest()
Model.restoreBest()
)public void addSolutionListener(SolutionListener<V,T> listener)
public void removeSolutionListener(SolutionListener<V,T> listener)