KSolutionContainer

class KSolutionContainer : public KAutoExternalObject<KSolutionContainer, KSolutionContainer_I>

This class represent a pool of solution of a KProblem. Example:

KProblem p(...);
KSolver solver(p);
solver.optimize();
KSolution sol = p.getSolutionContainer().getBestSolution();

See

KProblem

Since

2016.1

Public Functions

void add(const KSolution &solution)

Add a new solution of the solution container.

int getNumberOfSolutions() const

Return the number of solutions found.

void clear()

Remove all solutions from the solution container.

bool problemIsSolved() const

Return true if the problem as at least one solution.

KSolution &getLastSolution() const

Return the last solution found.

KSolution &getBestSolution() const

Return the best solution found (if applicable)

KSolution &getSolution(const int index) const

Return solution by index.