Class FLPSwapNeigh
java.lang.Object
es.urjc.etsii.grafo.solution.neighborhood.Neighborhood<FLPSwapNeigh.SwapMove, FLPSolution, FLPInstance>
es.urjc.etsii.grafo.solution.neighborhood.RandomizableNeighborhood<FLPSwapNeigh.SwapMove, FLPSolution, FLPInstance>
es.urjc.etsii.grafo.flayouts.model.FLPSwapNeigh
public class FLPSwapNeigh
extends RandomizableNeighborhood<FLPSwapNeigh.SwapMove, FLPSolution, FLPInstance>
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class Neighborhood
Neighborhood.EmptyNeighborhood<M,S, I> -
Field Summary
Fields inherited from class Neighborhood
UNKNOWN_SIZE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexplore(FLPSolution solution) Build an exhaustive stream that allows iterating the whole neighborhood Using a stream is more efficient that a list as moves are only generated if they are neededgetRandomMove(FLPSolution solution) Pick a random move within the neighborhoodMethods inherited from class Neighborhood
concat, empty, interleave, neighborhoodSize, random, toString
-
Constructor Details
-
FLPSwapNeigh
public FLPSwapNeigh()
-
-
Method Details
-
explore
Description copied from class:NeighborhoodBuild an exhaustive stream that allows iterating the whole neighborhood Using a stream is more efficient that a list as moves are only generated if they are needed- Specified by:
explorein classNeighborhood<FLPSwapNeigh.SwapMove, FLPSolution, FLPInstance>- Parameters:
solution- Solution used to generate the neighborhood- Returns:
- Stream with all the available moves in the neighborhood
-
getRandomMove
Description copied from class:RandomizableNeighborhoodPick a random move within the neighborhood- Specified by:
getRandomMovein classRandomizableNeighborhood<FLPSwapNeigh.SwapMove, FLPSolution, FLPInstance>- Parameters:
solution- Solution used to generate the neighborhood- Returns:
- a random move, if there is at least one valid move
-