@SuppressWarnings("rawtypes")
Object targets = ((Map)graphToCheckForConsistency.transitionMatrix.get(vert)).get(lbl);
if (targets != null) // there are transitions with the considered label, hence update Markov
for(List<Label> pathToUseWithMarkovToPredictOutgoing:markovPathsToUpdate)
{
Trace predictedTrace= new Trace();
if (model.predictForwardOrSideways)
{
for(int i=pathToUseWithMarkovToPredictOutgoing.size()-1;i>=0;--i) predictedTrace.add(pathToUseWithMarkovToPredictOutgoing.get(i));
}
else
{
predictedTrace.getList().addAll(pathToUseWithMarkovToPredictOutgoing);
}
predictedTrace.add(lbl);
MarkovOutcome newValue = null;
UpdatablePairInteger p=model.occurrenceMatrix.get(predictedTrace);if (p == null) { p=new UpdatablePairInteger(0, 0);model.occurrenceMatrix.put(predictedTrace,p); }
boolean foundAccept = false, foundReject = false;
for(Object vObj:graphToCheckForConsistency.getTargets(targets))
{
if ( ((CmpVertex)vObj).isAccept() ) foundAccept = true;
if ( !((CmpVertex)vObj).isAccept() ) foundReject = true;
}
// By construction of an inverse graph and its immutability, it is either accept, reject, or both. getTargets will never be empty.
if (foundAccept && foundReject)
throw new IllegalArgumentException("inconsistent inverse graph: path "+predictedTrace.getList()+" is both accepted and rejected");
if (foundAccept)
{
newValue=MarkovOutcome.positive;p.add(1, 0);
}