Map<Trace, MarkovOutcome> markovMatrix = markov.getMarkov(predictForward);
Map<Label,MarkovOutcome> outgoing_red_probabilities=MarkovUniversalLearner.predictTransitionsFromState(markovMatrix,origInverse,predictForward,red,alphabet,pathLenBeyondCurrentState,markov.getChunkLen(),null);
Map<Label,MarkovOutcome> outgoing_blue_probabilities=MarkovUniversalLearner.predictTransitionsFromState(markovMatrix,origInverse,predictForward,blue,alphabet,pathLenBeyondCurrentState,markov.getChunkLen(),null);
for(Entry<Label,MarkovOutcome> entry:outgoing_red_probabilities.entrySet())
{
MarkovOutcome outcomeBlue = outgoing_blue_probabilities.get(entry.getKey());
if (outcomeBlue == null && entry.getValue() == MarkovOutcome.negative)
++scoreCurrentFanout; // red negative, blue absent, hence the two are consistent
if (outcomeBlue == entry.getValue()) // or if the two are consistent
{
if (stepNumber > 1)
{
LinkedList<Label> pathBeyond = new LinkedList<Label>(pathLenBeyondCurrentState);pathBeyond.add(entry.getKey());
score+=comparePredictedFanouts(graph,origInverse,predictForward,markov,red,blue,alphabet,pathBeyond,stepNumber-1);
}
++scoreCurrentFanout;
}
}
for(Entry<Label,MarkovOutcome> entry:outgoing_blue_probabilities.entrySet())
{
MarkovOutcome outcomeRed = outgoing_red_probabilities.get(entry.getKey());
if (outcomeRed == null && entry.getValue() == MarkovOutcome.negative)
++scoreCurrentFanout; // blue negative, red absent, hence the two are consistent
if (outcomeRed == entry.getValue()) // or if the two are consistent
{
if (stepNumber > 1)