Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## ifs.solution
Class Solution

    java.lang.Object
      ifs.solution.Solution

    public class Solution

extends Object

Generic solution.
It consist from the model and information about current iteration and solution time.

Version:
  1.0
Author:
  Tomáš Müller
See Also:
  `Model`, `Solver`

Constructor Summary
`Solution(Model model)` Constructor
`Solution(Model model, long iteration, double time)` Constructor

Method Summary
`void` | `addSolutionListener(SolutionListener listener)` Adds solution listner
`void` | `clearBest()` Clear the best ever found solution
`Hashtable` | `getBestInfo()` Info of the best ever found solution
`long` | `getBestIteration()` Iteration when the best ever found solution was found
`int` | `getBestPertirbations()` Number of perturbation variables (variables with non-initial value assigned) if the best ever solution 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
`int` | `getBestValue()` Total value of the best ever found solution -- sum of all assigned values (see `Value.toInt()`).
`Hashtable` | `getInfo()` Solution information.
`long` | `getIteration()` Current iteration
`Model` | `getModel()` The model associated with the solution
`PerturbationsCounter` | `getPerturbationsCounter()` Returns perturbation counter
`double` | `getTime()` Current solution time (time in seconds from the start of the solver)
`void` | `init(Solver solver)` Initialization
`boolean` | `isBestComplete()` Returns true, if all variables of the best ever solution found are assigned
`void` | `removeSolutionListener(SolutionListener 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()`)
`String` | `toString()`
`void` | `update(double time)` Update time, increment current iteration

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### Solution

    public Solution(Model model)

  Constructor

### Solution

    public Solution(Model model,
                    long iteration,
                    double time)

  Constructor

Method Detail

### getIteration

    public long getIteration()

  Current iteration

### getModel

    public Model getModel()

  The model associated with the solution

### getTime

    public double getTime()

  Current solution time (time in seconds from the start of the solver)

### update

    public void update(double time)

  Update time, increment current iteration

### init

    public void init(Solver solver)

  Initialization

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

### getInfo

    public Hashtable getInfo()

  Solution information. It consits from info from the model which is associated with the solution, time, iteration, speed and infos from all solution listeners.

### getBestInfo

    public Hashtable getBestInfo()

  Info of the best ever found solution

### getBestIteration

    public long getBestIteration()

  Iteration when the best ever found solution was found

### getBestTime

    public double getBestTime()

  Solution time when the best ever found solution was found

### getBestPertirbations

    public int getBestPertirbations()

  Number of perturbation variables (variables with non-initial value assigned) if the best ever solution found

### isBestComplete

    public boolean isBestComplete()

  Returns true, if all variables of the best ever solution found are assigned

### getBestValue

    public int getBestValue()

  Total value of the best ever found solution -- sum of all assigned values (see `Value.toInt()`).

### getBestPerturbationsPenalty

    public double getBestPerturbationsPenalty()

  Perturbation penalty of the best ever found solution (see `PerturbationsCounter`)

### getPerturbationsCounter

    public PerturbationsCounter getPerturbationsCounter()

  Returns perturbation counter

### clearBest

    public void clearBest()

  Clear the best ever found solution

### saveBest

    public void saveBest()

  Save the current solution as the best ever found solution (it also calls `Model.saveBest()`)

### restoreBest

    public void restoreBest()

  Restore the best ever found solution into the current solution (it also calls `Model.restoreBest()`)

### addSolutionListener

    public void addSolutionListener(SolutionListener listener)

  Adds solution listner

### removeSolutionListener

    public void removeSolutionListener(SolutionListener listener)

  Removes solution listener

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005 Tomáš Müller