long scoreCurrentFanout = 0, score = 0;
Map<Label,MarkovOutcome> outgoing_red_probabilities=cl.predictTransitionsFromState(red,pathLenBeyondCurrentState,cl.model.getChunkLen(),null);
Map<Label,MarkovOutcome> outgoing_blue_probabilities=cl.predictTransitionsFromState(blue,pathLenBeyondCurrentState,cl.model.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(cl,red,blue,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)