Distance event evaluation

Distance events may be configured to be evaluated in any trigger of the session. The range of hits that are evaluated is from the last tracked instance to the current hit.

Depending on the trigger in which the distance event is evaluated, the following values may be returned:

Trigger
Returnable Value
First Hit of Session, Every Hit, After Every Hit, Last Hit
Last value
End of Session
First, Minimum, Maximum, and Last values

The calculation method applies to all four distances: first, last, minimum, and maximum. To find a distance between Event A and Event B:

  • Event B is found.
  • Step backwards through the session to find Event A.
  • The distance between these two events is calculated.
    • If the two events occur on the same hit, the distance is recorded as 0 (zero).
  • Pairs of events are gathered, and their distances and are calculated in this manner until all condition events are traversed for the session.
    1. This process may be shortened in some situations. For example, if the first distance is wanted, then when the first distance is found, the traversal of the condition events is stopped.
    2. In the worst case scenario, the maximum, minimum, and last distances are known after all event conditions are traversed.

The distance evaluation is reset if any of the following conditions is met:

  • A complete match is found.

For example, assume that the events triggered as below and the event measures the distance between events A and B. Disregard the specified range for the first part of this example.

Hit Number Event
1 A
2 A
3 B
4 B
5 A
6 C
7 B

Your allowable values would be as follows:

  • First = 1: This value is the distance between event B on hit 3 and event A on hit 2.
  • Last = 2: This value is the distance between event B on hit 7 and event A on hit 5.
  • Minimum = 1
  • Maximum = 2

The distance between event B on hit 4 and event A on hit 1 is not used because event A also occurred on hit 2. This scenario would reset the evaluation to start from hit 2. Event B on hit 4 is not used since a complete match is found by hit 3, which resets the evaluation. Event A does not occur again after the complete match (hit 3) and hit 4.

Hits 4 and 5 are not used because the events occur in the wrong order. B occurs first, followed by A. However, the conditions are looking for A then B.

If you specified that the distance must be 2 - 4 hits, then the first, last, minimum, and maximum values would all be 2. Only the match between event B on hit 7 and event A on hit 5 is at least 2 hits but less than 4 hits apart.

  • Since event B on hit 3 and event A on hit 2 are just 1 hit apart, that distance does not fall within the acceptable range and is discarded.