int extraLength=0;
if (deterministicGraph.getStateNumber() == 1) extraLength=1;//where the diameter is zero (and due
// to subset construction, we are not going to get unreachable states thus getStateNumber()
// is the right way to determine this), we have to set extra length to 1 to ensure walks are generated.
RandomPathGenerator randomPaths = new RandomPathGenerator(deterministicGraph,randomGenerator.getRandom(entryA.getKey()),
extraLength+config.getGdScoreComputationAlgorithm_RandomWalk_ExtraLength(),state,matrixForward.pathroutines.computeAlphabet());
if (config.getGdScoreComputationAlgorithm_RandomWalk_PathLength() > 0)
randomPaths.setPathLength(config.getGdScoreComputationAlgorithm_RandomWalk_PathLength());
randomPaths.generateRandomPosNeg(config.getGdScoreComputationAlgorithm_RandomWalk_NumberOfSequences(), 1,false);
graphwalk=new GraphAndWalk(deterministicGraph,randomPaths.getAllSequences(0));
}
break;
case SCORE_TESTSET:
graphwalk=new GraphAndWalk(deterministicGraph,deterministicGraph.wmethod.computeNewTestSet(state, config.getGdScoreComputationAlgorithm_TestSet_ExtraStates()));
deterministicGraph.learnerCache.invalidate();// reduce memory footprint.