Class KSolutionContainer


  • public class KSolutionContainer
    extends java.lang.Object
    This class represent a pool of solution of a KProblem.
    Example:
    
    KProblem p(...);
    KSolver solver(p);
    solver.optimize();
    KSolution sol = p.getSolutionContainer().getBestSolution();
    

    Since:
    2016.1
    See Also:
    KProblem
    • Field Detail

      • swigCMemOwn

        protected transient boolean swigCMemOwn
    • Constructor Detail

      • KSolutionContainer

        protected KSolutionContainer​(long cPtr,
                                     boolean cMemoryOwn)
      • KSolutionContainer

        public KSolutionContainer()
      • KSolutionContainer

        public KSolutionContainer​(com.artelys.kalis.SWIGTYPE_p_KSolutionContainer_I solutionContainer)
    • Method Detail

      • finalize

        protected void finalize()
        Overrides:
        finalize in class java.lang.Object
      • delete

        public void delete()
      • add

        public void add​(KSolution solution)
        Add a new solution of the solution container
      • getNumberOfSolutions

        public int getNumberOfSolutions()
        Return the number of solutions found
      • clear

        public void clear()
        Remove all solutions from the solution container
      • problemIsSolved

        public boolean problemIsSolved()
        Return true if the problem as at least one solution
      • getLastSolution

        public KSolution getLastSolution()
        Return the last solution found
      • getBestSolution

        public KSolution getBestSolution()
        Return the best solution found (if applicable)
      • getSolution

        public KSolution getSolution​(int index)
        Return solution by index