net.sf.cpsolver.ifs.model
Class LazySwap<V extends Variable<V,T>,T extends Value<V,T>>

java.lang.Object
  extended by net.sf.cpsolver.ifs.model.Neighbour<V,T>
      extended by net.sf.cpsolver.ifs.model.LazyNeighbour<V,T>
          extended by net.sf.cpsolver.ifs.model.LazySwap<V,T>

public class LazySwap<V extends Variable<V,T>,T extends Value<V,T>>
extends LazyNeighbour<V,T>

Lazy swap of two variables. See LazyNeighbour.

Version:
IFS 1.2 (Iterative Forward Search)
Copyright (C) 2013 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/.

Nested Class Summary
 
Nested classes/interfaces inherited from class net.sf.cpsolver.ifs.model.LazyNeighbour
LazyNeighbour.LazyNeighbourAcceptanceCriterion<V extends Variable<V,T>,T extends Value<V,T>>
 
Constructor Summary
LazySwap(T v1, T v2)
          Constructor
 
Method Summary
protected  void doAssign(long iteration)
          Perform swap
 Model<V,T> getModel()
          Return problem model
 String toString()
          String representation
protected  void undoAssign(long iteration)
          Undo the swap
 
Methods inherited from class net.sf.cpsolver.ifs.model.LazyNeighbour
assign, setAcceptanceCriterion, value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LazySwap

public LazySwap(T v1,
                T v2)
Constructor

Parameters:
v1 - first variable
v2 - second variable
Method Detail

doAssign

protected void doAssign(long iteration)
Perform swap

Specified by:
doAssign in class LazyNeighbour<V extends Variable<V,T>,T extends Value<V,T>>

undoAssign

protected void undoAssign(long iteration)
Undo the swap

Specified by:
undoAssign in class LazyNeighbour<V extends Variable<V,T>,T extends Value<V,T>>

getModel

public Model<V,T> getModel()
Return problem model

Specified by:
getModel in class LazyNeighbour<V extends Variable<V,T>,T extends Value<V,T>>

toString

public String toString()
String representation

Overrides:
toString in class Object


Copyright © 2014 UniTime LLC. All Rights Reserved.