{
CmpVertex redVertex = null;
if (listOfPairsToWrite != null)
{
redVertex = tentativeRedNodes.iterator().next();
listOfPairsToWrite.add(new PairOfPaths(coregraph, new PairScore(null, redVertex, 0, 0)));
}
if(listOfPairsToCheckAgainstIterator != null)
{
PairOfPaths pair = listOfPairsToCheckAgainstIterator.next();
Assert.assertNull(pair.getQ());
redVertex = coregraph.getVertex(pair.getR());
}
return redVertex;
}
@SuppressWarnings("unused")
@Override
public CmpVertex resolveDeadEnd(LearnerGraph coregraph,
Collection<CmpVertex> reds,
Collection<PairScore> pairs) {
return null;
}});
if (!outcome.isEmpty())
{
if (listOfPairsToWrite != null)
{
//System.out.println("Optimized: "+useOptimizedMerge+", matrix: "+graph.config.getTransitionMatrixImplType()+", pair : "+outcome.peek());
listOfPairsToWrite.add(new PairOfPaths(graph, outcome.peek()));
}
if(listOfPairsToCheckAgainstIterator != null)
{
PairOfPaths pair = listOfPairsToCheckAgainstIterator.next();
//System.out.println("chosen "+outcome.peek()+", expected "+new PairScore(graph.getVertex(pair.getQ()),graph.getVertex(pair.getR()),0,0));
pair.rebuildStack(graph, outcome);
}
}
return outcome;
}