public class TwoDimensionalMesh<S extends Solution<?>> extends Object implements Neighborhood<S>
| Constructor and Description |
|---|
TwoDimensionalMesh(int rows,
int columns,
int[][] neighborhood)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
List<S> |
findNeighbors(List<S> solutionSet,
int solution,
int[][] neighborhood)
Returns a solutionSet containing the neighbors of a given solution
|
List<S> |
getNeighbors(List<S> solutionList,
int solutionPosition)
Returns the north,south, east, and west solutions of a given solution
|
public TwoDimensionalMesh(int rows,
int columns,
int[][] neighborhood)
public List<S> findNeighbors(List<S> solutionSet, int solution, int[][] neighborhood)
solutionSet - From where neighbors will be obtainedsolution - The solution for which the neighbors will be computedneighborhood - The list of neighbors we want to obtain as shift regarding to solutionpublic List<S> getNeighbors(List<S> solutionList, int solutionPosition)
getNeighbors in interface Neighborhood<S extends Solution<?>>solutionList - the solution set from where the neighbors are takensolutionPosition - Represents the position of the solutionCopyright © 2015. All rights reserved.