org.cpsolver.ifs.util

## Class ProblemLoader<V extends Variable<V,T>,T extends Value<V,T>,M extends Model<V,T>>

- java.lang.Object
- - org.cpsolver.ifs.util.ProblemLoader<V,T,M>

- All Implemented Interfaces:
    Runnable
  Direct Known Subclasses:
    StudentSectioningLoader, TimetableLoader

      public abstract class ProblemLoader<V extends Variable<V,T>,T extends Value<V,T>,M extends Model<V,T>>
      extends Object
      implements Runnable

  Abstract problem loader class.
  Version:
    IFS 1.3 (Iterative Forward Search)
    Copyright (C) 2006 - 2016 Tomáš Müller
    muller@unitime.org
    http://muller.unitime.org
    This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
    This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
    You should have received a copy of the GNU Lesser General Public License along with this library; if not see http://www.gnu.org/licenses/.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ProblemLoader(M model, Assignment<V,T> assignment)` Constructor

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Assignment<V,T>` | `getAssignment()` Returns provided assignment
    `M` | `getModel()` Returns provided model.
    `TerminationCondition<V,T>` | `getTerminationCondition()` Return termination condition so that the save process can be stopped if needed.
    `abstract void` | `load()` Load the model.
    `void` | `run()`
    `void` | `setCallback(Callback callback)` Sets callback class
    `void` | `setTerminationCondition(TerminationCondition<V,T> termination)` Provide termination condition so that the save process can be stopped if needed (optional).

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ProblemLoader

          public ProblemLoader(M model,
                               Assignment<V,T> assignment)

      Constructor
      Parameters:
        `model` - an empty instance of timetable model
        `assignment` - current assignment

  - ### Method Detail

    - #### getModel

          public M getModel()

      Returns provided model.
      Returns:
        provided model

    - #### getAssignment

          public Assignment<V,T> getAssignment()

      Returns provided assignment
      Returns:
        provided assignment

    - #### load

          public abstract void load()
                             throws Exception

      Load the model.
      Throws:
        `Exception` - thrown when the load fails

    - #### setCallback

          public void setCallback(Callback callback)

      Sets callback class
      Parameters:
        `callback` - method `Callback.execute()` is executed when load is done

    - #### setTerminationCondition

          public void setTerminationCondition(TerminationCondition<V,T> termination)

      Provide termination condition so that the save process can be stopped if needed (optional).

    - #### getTerminationCondition

          public TerminationCondition<V,T> getTerminationCondition()

      Return termination condition so that the save process can be stopped if needed.

    - #### run

          public void run()

      Specified by:
        `run` in interface `Runnable`