net.sf.cpsolver.ifs.extension
Class SearchIntensification<V extends Variable<V,T>,T extends Value<V,T>>

java.lang.Object
  extended by net.sf.cpsolver.ifs.extension.Extension<V,T>
      extended by net.sf.cpsolver.ifs.extension.SearchIntensification<V,T>
All Implemented Interfaces:
ModelListener<V,T>, SolutionListener<V,T>

public class SearchIntensification<V extends Variable<V,T>,T extends Value<V,T>>
extends Extension<V,T>
implements SolutionListener<V,T>

Go back to the best known solution when no better solution is found within the given amount of iterations.

Version:
IFS 1.2 (Iterative Forward Search)
Copyright (C) 2006 - 2010 Tomas Muller
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
SearchIntensification(Solver<V,T> solver, DataProperties properties)
           
 
Method Summary
 void afterAssigned(long iteration, T value)
          Called after a value is assigned to a variable
 void bestCleared(Solution<V,T> solution)
          Called by the solution when method Solution.clearBest() is called.
 void bestRestored(Solution<V,T> solution)
          Called by the solution when method Solution.restoreBest() is called.
 void bestSaved(Solution<V,T> solution)
          Called by the solution when method Solution.saveBest() is called.
 void getInfo(Solution<V,T> solution, Map<String,String> info)
          Called by the solution when it is asked to produce info table, see Solution.getInfo().
 void getInfo(Solution<V,T> solution, Map<String,String> info, Collection<V> variables)
          Called by the solution when it is asked to produce info table, see Solution.getInfo().
 boolean init(Solver<V,T> solver)
          Initialization -- called before the solver is started
 void register(Model<V,T> model)
          Registration of a model.
 void solutionUpdated(Solution<V,T> solution)
          Called by the solution when it is updated, see Solution.update(double).
 void unregister(Model<V,T> model)
          Unregistration of a model.
 
Methods inherited from class net.sf.cpsolver.ifs.extension.Extension
afterUnassigned, beforeAssigned, beforeUnassigned, constraintAdded, constraintRemoved, getModel, getProperties, getSolver, isRegistered, useValueExtra, useVariableExtra, variableAdded, variableRemoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchIntensification

public SearchIntensification(Solver<V,T> solver,
                             DataProperties properties)
Method Detail

init

public boolean init(Solver<V,T> solver)
Description copied from class: Extension
Initialization -- called before the solver is started

Specified by:
init in interface ModelListener<V extends Variable<V,T>,T extends Value<V,T>>
Overrides:
init in class Extension<V extends Variable<V,T>,T extends Value<V,T>>
Parameters:
solver - IFS solver

register

public void register(Model<V,T> model)
Description copied from class: Extension
Registration of a model. This is called by the solver before start.

Overrides:
register in class Extension<V extends Variable<V,T>,T extends Value<V,T>>

unregister

public void unregister(Model<V,T> model)
Description copied from class: Extension
Unregistration of a model. This is called by the solver when extension is removed.

Overrides:
unregister in class Extension<V extends Variable<V,T>,T extends Value<V,T>>

afterAssigned

public void afterAssigned(long iteration,
                          T value)
Description copied from class: Extension
Called after a value is assigned to a variable

Specified by:
afterAssigned in interface ModelListener<V extends Variable<V,T>,T extends Value<V,T>>
Overrides:
afterAssigned in class Extension<V extends Variable<V,T>,T extends Value<V,T>>
Parameters:
iteration - current iteration
value - value to be assigned

bestSaved

public void bestSaved(Solution<V,T> solution)
Description copied from interface: SolutionListener
Called by the solution when method Solution.saveBest() is called.

Specified by:
bestSaved in interface SolutionListener<V extends Variable<V,T>,T extends Value<V,T>>
Parameters:
solution - source solution

solutionUpdated

public void solutionUpdated(Solution<V,T> solution)
Description copied from interface: SolutionListener
Called by the solution when it is updated, see Solution.update(double).

Specified by:
solutionUpdated in interface SolutionListener<V extends Variable<V,T>,T extends Value<V,T>>
Parameters:
solution - source solution

bestCleared

public void bestCleared(Solution<V,T> solution)
Description copied from interface: SolutionListener
Called by the solution when method Solution.clearBest() is called.

Specified by:
bestCleared in interface SolutionListener<V extends Variable<V,T>,T extends Value<V,T>>
Parameters:
solution - source solution

bestRestored

public void bestRestored(Solution<V,T> solution)
Description copied from interface: SolutionListener
Called by the solution when method Solution.restoreBest() is called.

Specified by:
bestRestored in interface SolutionListener<V extends Variable<V,T>,T extends Value<V,T>>
Parameters:
solution - source solution

getInfo

public void getInfo(Solution<V,T> solution,
                    Map<String,String> info)
Description copied from interface: SolutionListener
Called by the solution when it is asked to produce info table, see Solution.getInfo(). A listener can also add some its info into this table.

Specified by:
getInfo in interface SolutionListener<V extends Variable<V,T>,T extends Value<V,T>>
Parameters:
solution - source solution
info - produced info table

getInfo

public void getInfo(Solution<V,T> solution,
                    Map<String,String> info,
                    Collection<V> variables)
Description copied from interface: SolutionListener
Called by the solution when it is asked to produce info table, see Solution.getInfo(). A listener can also add some its info into this table.

Specified by:
getInfo in interface SolutionListener<V extends Variable<V,T>,T extends Value<V,T>>
Parameters:
solution - source solution
info - produced info table
variables - only variables from this set are included


Copyright © 2014 UniTime LLC. All Rights Reserved.