diff --git a/java/com.sap.sailing.domain.tractracadapter/src/com/sap/sailing/domain/tractracadapter/impl/TracTracRaceTrackerImpl.java b/java/com.sap.sailing.domain.tractracadapter/src/com/sap/sailing/domain/tractracadapter/impl/TracTracRaceTrackerImpl.java index 1de3b4337ee..540193145d4 100755 --- a/java/com.sap.sailing.domain.tractracadapter/src/com/sap/sailing/domain/tractracadapter/impl/TracTracRaceTrackerImpl.java +++ b/java/com.sap.sailing.domain.tractracadapter/src/com/sap/sailing/domain/tractracadapter/impl/TracTracRaceTrackerImpl.java @@ -99,7 +99,9 @@ public class TracTracRaceTrackerImpl extends AbstractRaceTrackerImpl implements * reported by the threads. The function that calculates the total progress is: * *
- * total_progress = sum(progress(thread_i)) / sum(weight(thread_i))+ * total_progress = sum(progress(thread_i)) / sum(weight(thread_i)) + * + * * The weight is also the maximum individual progress that a thread can send: if a thread has a weight = 10 its * progress only can be between 0 and 10, e.g,: *
@@ -113,35 +115,81 @@ public class TracTracRaceTrackerImpl extends AbstractRaceTrackerImpl implements * The total progress that you receive is: * *
- * total_progress = 0 + 0 / 10 + 1 = 0 / 11 = 0+ * total_progress = 0 + 0 / 10 + 1 = 0 / 11 = 0 + * * * Then, the "Course thread" retrieves the course from the server and it sends a new progress message to the system: * *
- * Course thread -> weight = 1, progress = 1 ---> total_progress = 0 + 1 / 10 + 1 = 1 / 11 = 0.090909091+ * Course thread -> weight = 1, progress = 1 ---> total_progress = 0 + 1 / 10 + 1 = 1 / 11 = 0.090909091 + * * * Then, the "Competitor positions thread" goes to the server and it checks that there is a high number of positions * for the competitors. It decides to change its weight: * *
- * Competitor positions thread -> weight = 50, progress = 0 --> total_progress = 0 + 1 / 50 + 1 = 1 / 51 = 0.019607843+ * Competitor positions thread -> weight = 50, progress = 0 --> total_progress = 0 + 1 / 50 + 1 = 1 / 51 = 0.019607843 + * * * Then, the "Competitor positions thread" starts to retrieve positions and it sends several messages updating the * progress: *
Competitor positions thread -> weight = 50, progress = 1 --> total_progress = 1 + 1 / 50 + 1 = 2 / 51 = 0.039215686
Competitor positions thread -> weight = 50, progress = 2 --> total_progress = 2 + 1 / 50 + 1 = 3 / 51 = 0.058823529
Competitor positions thread -> weight = 50, progress = 3 --> total_progress = 3 + 1 / 50 + 1 = 4 / 51 = 0.078431373
...
Competitor positions thread -> weight = 50, progress = 50 --> total_progress = 50 + 1 / 50 + 1 = 51 / 51 = 1.0
+ * Competitor positions thread -> weight = 50, progress = 1 --> total_progress = 1 + 1 / 50 + 1 = 2 / 51 = 0.039215686 + *+ * + *
+ * Competitor positions thread -> weight = 50, progress = 2 --> total_progress = 2 + 1 / 50 + 1 = 3 / 51 = 0.058823529 + *+ * + *
+ * Competitor positions thread -> weight = 50, progress = 3 --> total_progress = 3 + 1 / 50 + 1 = 4 / 51 = 0.078431373 + *+ * + *
+ * ... + *+ * + *
+ * Competitor positions thread -> weight = 50, progress = 50 --> total_progress = 50 + 1 / 50 + 1 = 51 / 51 = 1.0 + *+ * + *
+ * received. It happens because the weight of the threads changes." + *
* - * We assume that there won't be more than six threads in TTCM receiving data for the same race. + * We assume that there won't be more than eight threads in TTCM receiving data for the same race, based on Jorge's + * statement from 2014-02-06: "One thread per subscription where the subscriptions are: + *