Package es.urjc.etsii.grafo.testutil
Class TestNeighborhood
java.lang.Object
es.urjc.etsii.grafo.solution.neighborhood.Neighborhood<TestMove,TestSolution,TestInstance>
es.urjc.etsii.grafo.solution.neighborhood.RandomizableNeighborhood<TestMove,TestSolution,TestInstance>
es.urjc.etsii.grafo.testutil.TestNeighborhood
-
Nested Class Summary
-
Field Summary
Fields inherited from class es.urjc.etsii.grafo.solution.neighborhood.Neighborhood
UNKNOWN_SIZE
-
Constructor Summary
ConstructorsConstructorDescriptionTestNeighborhood
(TestSolution fakeSolution, double... values) TestNeighborhood
(List<TestMove> fakeMoves) -
Method Summary
Modifier and TypeMethodDescriptionexplore
(TestSolution 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
(TestSolution solution) Pick a random move within the neighborhoodMethods inherited from class es.urjc.etsii.grafo.solution.neighborhood.Neighborhood
concat, empty, interleave, neighborhoodSize, random, toString
-
Constructor Details
-
TestNeighborhood
-
TestNeighborhood
-
-
Method Details
-
explore
Description copied from class:Neighborhood
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 needed- Specified by:
explore
in classNeighborhood<TestMove,
TestSolution, TestInstance> - Parameters:
solution
- Solution used to generate the neighborhood- Returns:
- Stream with all the available moves in the neighborhood
-
getRandomMove
Description copied from class:RandomizableNeighborhood
Pick a random move within the neighborhood- Specified by:
getRandomMove
in classRandomizableNeighborhood<TestMove,
TestSolution, TestInstance> - Parameters:
solution
- Solution used to generate the neighborhood- Returns:
- a random move, if there is at least one valid move
-