// going through all positive traces
//and partitioning each positive traces into a list of events ( a list of labels based on the chunk length)
for(List<Label> positive_trace:pos)
{
Trace current_positive_trace=new Trace(positive_trace, true);
for(int i=onlyLongest?chunk_Length-1:0;i<chunk_Length;i++)
{
List<Trace> List_traces=get_chunks(current_positive_trace,i+1);
for (Trace tracePos:List_traces)
initialization(tracePos,true);
}
}
// from negative traces initialize the Markov matrix
for(List<Label> negative_trace:neg)
{
for(int i=onlyLongest?chunk_Length-1:0; i<chunk_Length; i++)
{
Trace trace=new Trace(negative_trace,true);
List<Trace> List_traces=get_chunks(trace,i+1);
int chunkNumber = List_traces.size();
if (chunkNumber >= 1)
{
Trace traceNeg=List_traces.get(chunkNumber-1);
initialization(traceNeg,false);
for (Trace tracePos:List_traces)
if (tracePos != traceNeg)
initialization(tracePos,true);
}
}
}
Map<Trace, MarkovOutcome> MarkovMatrix = getMarkov(true);
// construct a matrix from trace data, including marking of conflicting data as invalid (conflicts arise where a path is too short).
// A prefix of either a positive or a negative could be a failure where there are some states from which a shorter sequence is rejected but from other states a longer one is accepted.
Trace trace_to_account_its_probability=null;
for (Entry<Trace, UpdatablePairInteger> e : occurrenceMatrixForward.entrySet())
{
trace_to_account_its_probability=e.getKey();
UpdatablePairInteger Trace_occurence = e.getValue();
if (Trace_occurence.firstElem > 0 && Trace_occurence.secondElem > 0)