d-Rickyy-b/MGGVertretungsplan

Changes are not counted perfectly

d-Rickyy-b opened this issue · 0 comments

The calculation of changes is still buggy. Imagine 2 days being compared. In the newer one, there are 3 new elements and one element missing.

L1	L2
1	1 -> x
2	3 -> u
5	5 -> x
7	  -> u
9	  -> u

x = not unique
u = unique

if (getCancellations() >= ttd.getCancellations())
diffs += getUniques(timeTableElements, ttd.getElements());
else
diffs += getUniques(ttd.getElements(), timeTableElements);

Use symmetric differences (set theory) to calculate the real differences, as shown here!

Maybe even create seperate lists for each day, so that the notification(s) contain the day of the changes.

Symmetric Difference