Class SetRandomNeighbor

  • All Implemented Interfaces:
    ICause, INeighbor

    public class SetRandomNeighbor
    extends Object
    implements INeighbor
    A random LNS neighbor for a set variable This class serves mostly as an example on how to use LNS with set variables.
    Jean-Guillaume Fages
    • Field Detail

      • var

        protected final SetVar var
      • value

        protected final gnu.trove.list.array.TIntArrayList value
      • rd

        protected final Random rd
    • Constructor Detail

      • SetRandomNeighbor

        public SetRandomNeighbor​(SetVar variable)
    • Method Detail

      • recordSolution

        public void recordSolution()
        Description copied from interface: INeighbor
        Record values of decision variables to freeze some ones during the next LNS run
        Specified by:
        recordSolution in interface INeighbor
      • loadFromSolution

        public void loadFromSolution​(Solution solution)
        Description copied from interface: INeighbor
        Load a solution and record it
        Specified by:
        loadFromSolution in interface INeighbor
        solution - a solution to record