This followed after a discussion with @RobBa
The traces and tails in flexfringe have an incrementing unique identifier. sequence and tail_nr. Inputdata handles correctly numbering these tails and traces. Inputdata maintains a num_sequences and num_tails.
Now, the active learning component also deals with these numbering since it has to add the traces on the fly which do not originate from inputdata. Robert and I were afraid this will go wrong at some time. (Somewhere else in the code, the abbodingoreader also shortcuts the numbering in the read function by using a loop variable.)
They all have one thing in common though. They all call to create_tail or create_trace of the mem_store first. My suggestion would therefore be to have the num_sequences and num_tails to be dealt with the mem_store instead. So maintain a static incrementer in mem_store for num_tails and num_sequences.
Since we are refactoring, maybe rename sequence to trace_nr and num_sequences to num_traces. The name sequence is a bit confusing to me, and this would be inline with how we call it for the traces.
Another thing I noticed is that inputdata maintains a traces list which it sorts after parsing. I don't know if things go wrong if more traces are added afterwards. Should this also be added here? Maybe this can also be dealt with in mem_store. A sorted collection would then be a better choice.
This followed after a discussion with @RobBa
The traces and tails in flexfringe have an incrementing unique identifier.
sequenceandtail_nr. Inputdata handles correctly numbering these tails and traces. Inputdata maintains anum_sequencesandnum_tails.Now, the active learning component also deals with these numbering since it has to add the traces on the fly which do not originate from
inputdata. Robert and I were afraid this will go wrong at some time. (Somewhere else in the code, the abbodingoreader also shortcuts the numbering in the read function by using a loop variable.)They all have one thing in common though. They all call to create_tail or create_trace of the mem_store first. My suggestion would therefore be to have the
num_sequencesandnum_tailsto be dealt with themem_storeinstead. So maintain a static incrementer in mem_store fornum_tailsandnum_sequences.Since we are refactoring, maybe rename
sequencetotrace_nrandnum_sequencestonum_traces. The namesequenceis a bit confusing to me, and this would be inline with how we call it for the traces.Another thing I noticed is that inputdata maintains a traces list which it sorts after parsing. I don't know if things go wrong if more traces are added afterwards. Should this also be added here? Maybe this can also be dealt with in mem_store. A sorted collection would then be a better choice.