long scoreCurrentFanout = 0, score = 0;
Map<Label,UpdatableOutcome> outgoing_red_probabilities=Markov.predictTransitionsFromState(origInverse,red,alphabet,pathLenBeyondCurrentState,Markov.getChunkLen());
Map<Label,UpdatableOutcome> outgoing_blue_probabilities=Markov.predictTransitionsFromState(origInverse,blue,alphabet,pathLenBeyondCurrentState,Markov.getChunkLen());
for(Entry<Label,UpdatableOutcome> entry:outgoing_red_probabilities.entrySet())
{
UpdatableOutcome outcomeBlue = outgoing_blue_probabilities.get(entry.getKey());
if (outcomeBlue == null && entry.getValue() == UpdatableOutcome.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,Markov,red,blue,alphabet,pathBeyond,stepNumber-1);
}
++scoreCurrentFanout;
}
}
for(Entry<Label,UpdatableOutcome> entry:outgoing_blue_probabilities.entrySet())
{
UpdatableOutcome outcomeRed = outgoing_red_probabilities.get(entry.getKey());
if (outcomeRed == null && entry.getValue() == UpdatableOutcome.negative)
++scoreCurrentFanout; // blue negative, red absent, hence the two are consistent
if (outcomeRed == entry.getValue()) // or if the two are consistent
{
if (stepNumber > 1)