Class FLPRelocateNeigh
java.lang.Object
es.urjc.etsii.grafo.solution.neighborhood.Neighborhood<FLPRelocateNeigh.RelocateMove, FLPSolution, FLPInstance>
es.urjc.etsii.grafo.solution.neighborhood.RandomizableNeighborhood<FLPRelocateNeigh.RelocateMove, FLPSolution, FLPInstance>
es.urjc.etsii.grafo.flayouts.model.FLPRelocateNeigh
public class FLPRelocateNeigh
extends RandomizableNeighborhood<FLPRelocateNeigh.RelocateMove, FLPSolution, FLPInstance>
Move one element A from its position I to another position J, displacing all elements between those positions
-
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
-
FLPRelocateNeigh
public FLPRelocateNeigh(boolean insertBySwap)
-
-
Method Details
-
explore
public ExploreResult<FLPRelocateNeigh.RelocateMove, FLPSolution, FLPInstance> explore(FLPSolution solution) 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<FLPRelocateNeigh.RelocateMove, 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<FLPRelocateNeigh.RelocateMove, FLPSolution, FLPInstance>- Parameters:
solution- Solution used to generate the neighborhood- Returns:
- a random move, if there is at least one valid move
-