|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjopt.csp.search.SimpleNeighborhood
A simple collection of neighboring solutions that are predefined and capable of being browsed during a search. Like a friendly suburb where Mr. Rodgers might live.
Constructor Summary | |
SimpleNeighborhood()
Creates a simple neighborhood based on an initial solution |
Method Summary | |
void |
add(SolverSolution neighbor)
Adds a new neighbor to the neighborhood. |
SolverSolution |
getNeighbor(int i)
Returns the neighboring solution at index i |
Neighborhood |
getSelectedNeighborhood()
Returns the Neighborhood represented by the latest selected Neighborhood |
int |
getSelectedNeighborhoodOffset()
Returns the offset into Neighborhood represented by the latest selected Neighborhood |
void |
neighborSelected(int i)
Indicates that a neighbor has been selected from this neighborhood and is about to be used to update the initial solution. |
void |
setInitialSolution(SolverSolution initial)
Sets the initial solution to which this neighborhood is related |
int |
size()
Returns the number of potential solutions contained in the neighborhood |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimpleNeighborhood()
Method Detail |
public void setInitialSolution(SolverSolution initial)
Neighborhood
setInitialSolution
in interface Neighborhood
public int size()
Neighborhood
size
in interface Neighborhood
public SolverSolution getNeighbor(int i)
Neighborhood
i
getNeighbor
in interface Neighborhood
i
- Index of neighbor within neighborhood
public void neighborSelected(int i)
Neighborhood
neighborSelected
in interface Neighborhood
public Neighborhood getSelectedNeighborhood()
getSelectedNeighborhood
in interface Neighborhood
public int getSelectedNeighborhoodOffset()
getSelectedNeighborhoodOffset
in interface Neighborhood
public void add(SolverSolution neighbor)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |