Class Neighbourhood
- java.lang.Object
-
- ch.idsia.crema.inference.approxlp1.Neighbourhood
-
- All Implemented Interfaces:
NeighbourhoodFunction<Move,Solution>
public class Neighbourhood extends Object implements NeighbourhoodFunction<Move,Solution>
-
-
Constructor Summary
Constructors Constructor Description Neighbourhood(GraphicalModel<? extends GenericFactor> model, int... locked)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Solution
move(Solution from, Move doing)
Perform the specified move for the `from` solution.List<Move>
neighbours(Solution solution)
Provide the caller with the possible moves available when in the specified Solution.Solution
random()
Generate a random solution.
-
-
-
Constructor Detail
-
Neighbourhood
public Neighbourhood(GraphicalModel<? extends GenericFactor> model, int... locked)
-
-
Method Detail
-
neighbours
public List<Move> neighbours(Solution solution)
Description copied from interface:NeighbourhoodFunction
Provide the caller with the possible moves available when in the specified Solution.- Specified by:
neighbours
in interfaceNeighbourhoodFunction<Move,Solution>
- Returns:
- A list of moves
-
random
public Solution random()
Description copied from interface:NeighbourhoodFunction
Generate a random solution. This can be used for generating a starting point for some algorithms.- Specified by:
random
in interfaceNeighbourhoodFunction<Move,Solution>
- Returns:
-
move
public Solution move(Solution from, Move doing)
Description copied from interface:NeighbourhoodFunction
Perform the specified move for the `from` solution. The resulting solution is returned- Specified by:
move
in interfaceNeighbourhoodFunction<Move,Solution>
- Returns:
-
-