public class Neighborhood
extends java.lang.Object
Solution
into a
SolutionSet
.Constructor and Description |
---|
Neighborhood(int solutionSetSize)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
SolutionSet |
getEightNeighbors(SolutionSet population,
int individual)
Returns a
SolutionSet with the North, Sout, East, West,
North-West, South-West, North-East and South-East neighbors solutions of
ratio 0 of a given location into a given SolutionSet . |
SolutionSet |
getFourNeighbors(SolutionSet solutionSet,
int location)
Returns a
SolutionSet with the North, Sout, East and West
neighbors solutions of ratio 0 of a given location into a given
SolutionSet . |
public Neighborhood(int solutionSetSize)
solutionSetSize
- The size.public SolutionSet getFourNeighbors(SolutionSet solutionSet, int location)
SolutionSet
with the North, Sout, East and West
neighbors solutions of ratio 0 of a given location into a given
SolutionSet
.solutionSet
- The SolutionSet
.location
- The location.SolutionSet
with the neighbors.public SolutionSet getEightNeighbors(SolutionSet population, int individual)
SolutionSet
with the North, Sout, East, West,
North-West, South-West, North-East and South-East neighbors solutions of
ratio 0 of a given location into a given SolutionSet
.
solutions of a given location into a given SolutionSet
.population
- The SolutionSet
.individual
- The individual.SolutionSet
with the neighbors.