Skip to content

Test Spat Time Change Details Event

Ivan Yourshaw edited this page Jan 31, 2025 · 10 revisions

Test for SPAT Time Change Details Events

Note: SPAT Time Change Details Events can be configured to enable aggregation using the spat.time.change.details.aggregateEvents configuration setting, or the ENABLE_AGGREGATE_SPAT_TIME_CHANGE_DETAILS_EVENTS environment variable. If aggregation is enabled, events will be delayed by up to the configured aggregation.interval, which is 60 seconds by default.

Output Topics

If aggregation is enabled, events are output to:

  • topic.CmSpatTimeChangeDetailsEventAggregation

If aggregation is disabled, events are output to:

  • topic.CmSpatTimeChangeDetailsEvent

Inputs

  • SPATs containing one or more examples of each type of time change event between consecutive SPAT for the same signal group and event;
    • minEndTime decreasing
    • maxEndTime increasing
    • PROTECTED_CLEARANCE event state with minEndTime not eqaual to maxEndTime
    • PROTECTED_CLEARANCE event state with decreasing/increrasing minEndTime and maxEndTime

The test SPATS contain time change events for signal groups 2, 4 and 6.

Test Script

Script: SPAT_TimeChangeDetails.csv

SPAT Data: SPATData_TimeChangeDetailsEvents.jsonl

With Aggregation

Expected Output

One or several events for each type of time change detail.

Actual Output

Topic: topic.CmSpatTimeChangeDetailsEvent
Key: 10.11.81.12_null_12109
Offset: 38
Timestamp: 1711563892433
Value: 
{
    "eventGeneratedAt":1711563897780,
    "eventType":"TimeChangeDetails",
    "intersectionID":12109,
    "roadRegulatorID":-1,
    "signalGroup":4,
    "firstSpatTimestamp":1711563892433,
    "secondSpatTimestamp":1711563892536,
    "firstTimeMarkType":"maxEndTime",
    "secondTimeMarkType":"maxEndTime",
    "firstConflictingTimemark":3070,
    "secondConflictingTimemark":3150,
    "firstState":"PROTECTED_MOVEMENT_ALLOWED",
    "secondState":"PROTECTED_MOVEMENT_ALLOWED",
    "firstConflictingUtcTimestamp":1711562707000,
    "secondConflictingUtcTimestamp":1711562715000,
    "source":"{\"rsuId\":\"10.11.81.12\",\"intersectionId\":12109,\"region\":-1}"
}
% Reached end of topic topic.CmSpatTimeChangeDetailsEvent [0] at offset 39

Topic: topic.CmSpatTimeChangeDetailsEvent
Key: 10.11.81.12_null_12109
Offset: 39
Timestamp: 1711563893396
Value: 
{
    "eventGeneratedAt":1711563898739,
    "eventType":"TimeChangeDetails",
    "intersectionID":12109,
    "roadRegulatorID":-1,
    "signalGroup":2,
    "firstSpatTimestamp":1711563893396,
    "secondSpatTimestamp":1711563893503,
    "firstTimeMarkType":"minEndTime",
    "secondTimeMarkType":"minEndTime",
    "firstConflictingTimemark":3221,
    "secondConflictingTimemark":3211,
    "firstState":"STOP_AND_REMAIN",
    "secondState":"STOP_AND_REMAIN",
    "firstConflictingUtcTimestamp":1711562722100,
    "secondConflictingUtcTimestamp":1711562721100,
    "source":"{\"rsuId\":\"10.11.81.12\",\"intersectionId\":12109,\"region\":-1}"
}

Topic: topic.CmSpatTimeChangeDetailsEvent
Key: 10.11.81.12_null_12109
Offset: 40
Timestamp: 1711563893396
Value: 
{
    "eventGeneratedAt":1711563898739,
    "eventType":"TimeChangeDetails",
    "intersectionID":12109,
    "roadRegulatorID":-1,
    "signalGroup":4,
    "firstSpatTimestamp":1711563893396,
    "secondSpatTimestamp":1711563893503,
    "firstTimeMarkType":"minEndTime",
    "secondTimeMarkType":"minEndTime",
    "firstConflictingTimemark":3070,
    "secondConflictingTimemark":3060,
    "firstState":"PROTECTED_MOVEMENT_ALLOWED",
    "secondState":"PROTECTED_MOVEMENT_ALLOWED",
    "firstConflictingUtcTimestamp":1711562707000,
    "secondConflictingUtcTimestamp":1711562706000,
    "source":"{\"rsuId\":\"10.11.81.12\",\"intersectionId\":12109,\"region\":-1}"
}

Topic: topic.CmSpatTimeChangeDetailsEvent
Key: 10.11.81.12_null_12109
Offset: 41
Timestamp: 1711563893396
Value: 
{
    "eventGeneratedAt":1711563898740,
    "eventType":"TimeChangeDetails",
    "intersectionID":12109,
    "roadRegulatorID":-1,
    "signalGroup":6,
    "firstSpatTimestamp":1711563893396,
    "secondSpatTimestamp":1711563893503,
    "firstTimeMarkType":"minEndTime",
    "secondTimeMarkType":"minEndTime",
    "firstConflictingTimemark":3221,
    "secondConflictingTimemark":3211,
    "firstState":"STOP_AND_REMAIN",
    "secondState":"STOP_AND_REMAIN",
    "firstConflictingUtcTimestamp":1711562722100,
    "secondConflictingUtcTimestamp":1711562721100,
    "source":"{\"rsuId\":\"10.11.81.12\",\"intersectionId\":12109,\"region\":-1}"
}
% Reached end of topic topic.CmSpatTimeChangeDetailsEvent [0] at offset 42

Topic: topic.CmSpatTimeChangeDetailsEvent
Key: 10.11.81.12_null_12109
Offset: 42
Timestamp: 1711563894475
Value: 
{
    "eventGeneratedAt":1711563899709,
    "eventType":"TimeChangeDetails",
    "intersectionID":12109,
    "roadRegulatorID":-1,
    "signalGroup":2,
    "firstSpatTimestamp":1711563894475,
    "secondSpatTimestamp":1711563894567,
    "firstTimeMarkType":"minEndTime",
    "secondTimeMarkType":"minEndTime",
    "firstConflictingTimemark":3211,
    "secondConflictingTimemark":3201,
    "firstState":"STOP_AND_REMAIN",
    "secondState":"STOP_AND_REMAIN",
    "firstConflictingUtcTimestamp":1711562721100,
    "secondConflictingUtcTimestamp":1711562720100,
    "source":"{\"rsuId\":\"10.11.81.12\",\"intersectionId\":12109,\"region\":-1}"
}

Topic: topic.CmSpatTimeChangeDetailsEvent
Key: 10.11.81.12_null_12109
Offset: 43
Timestamp: 1711563894475
Value: 
{
    "eventGeneratedAt":1711563899709,
    "eventType":"TimeChangeDetails",
    "intersectionID":12109,
    "roadRegulatorID":-1,
    "signalGroup":4,
    "firstSpatTimestamp":1711563894475,
    "secondSpatTimestamp":1711563894567,
    "firstTimeMarkType":"minEndTime",
    "secondTimeMarkType":"minEndTime",
    "firstConflictingTimemark":3060,
    "secondConflictingTimemark":3050,
    "firstState":"PROTECTED_MOVEMENT_ALLOWED",
    "secondState":"PROTECTED_MOVEMENT_ALLOWED",
    "firstConflictingUtcTimestamp":1711562706000,
    "secondConflictingUtcTimestamp":1711562705000,
    "source":"{\"rsuId\":\"10.11.81.12\",\"intersectionId\":12109,\"region\":-1}"
}

Topic: topic.CmSpatTimeChangeDetailsEvent
Key: 10.11.81.12_null_12109
Offset: 44
Timestamp: 1711563894475
Value: 
{
    "eventGeneratedAt":1711563899709,
    "eventType":"TimeChangeDetails",
    "intersectionID":12109,
    "roadRegulatorID":-1,
    "signalGroup":6,
    "firstSpatTimestamp":1711563894475,
    "secondSpatTimestamp":1711563894567,
    "firstTimeMarkType":"minEndTime",
    "secondTimeMarkType":"minEndTime",
    "firstConflictingTimemark":3211,
    "secondConflictingTimemark":3201,
    "firstState":"STOP_AND_REMAIN",
    "secondState":"STOP_AND_REMAIN",
    "firstConflictingUtcTimestamp":1711562721100,
    "secondConflictingUtcTimestamp":1711562720100,
    "source":"{\"rsuId\":\"10.11.81.12\",\"intersectionId\":12109,\"region\":-1}"
}
% Reached end of topic topic.CmSpatTimeChangeDetailsEvent [0] at offset 45

Topic: topic.CmSpatTimeChangeDetailsEvent
Key: 10.11.81.12_null_12109
Offset: 45
Timestamp: 1711563895531
Value: 
{
    "eventGeneratedAt":1711563900877,
    "eventType":"TimeChangeDetails",
    "intersectionID":12109,
    "roadRegulatorID":-1,
    "signalGroup":2,
    "firstSpatTimestamp":1711563895531,
    "secondSpatTimestamp":1711563895623,
    "firstTimeMarkType":"minEndTime",
    "secondTimeMarkType":"minEndTime",
    "firstConflictingTimemark":3201,
    "secondConflictingTimemark":3191,
    "firstState":"STOP_AND_REMAIN",
    "secondState":"STOP_AND_REMAIN",
    "firstConflictingUtcTimestamp":1711562720100,
    "secondConflictingUtcTimestamp":1711562719100,
    "source":"{\"rsuId\":\"10.11.81.12\",\"intersectionId\":12109,\"region\":-1}"
}

Topic: topic.CmSpatTimeChangeDetailsEvent
Key: 10.11.81.12_null_12109
Offset: 46
Timestamp: 1711563895531
Value: 
{
    "eventGeneratedAt":1711563900878,
    "eventType":"TimeChangeDetails",
    "intersectionID":12109,
    "roadRegulatorID":-1,
    "signalGroup":4,
    "firstSpatTimestamp":1711563895531,
    "secondSpatTimestamp":1711563895623,
    "firstTimeMarkType":"minEndTime",
    "secondTimeMarkType":"minEndTime",
    "firstConflictingTimemark":3050,
    "secondConflictingTimemark":3040,
    "firstState":"PROTECTED_MOVEMENT_ALLOWED",
    "secondState":"PROTECTED_MOVEMENT_ALLOWED",
    "firstConflictingUtcTimestamp":1711562705000,
    "secondConflictingUtcTimestamp":1711562704000,
    "source":"{\"rsuId\":\"10.11.81.12\",\"intersectionId\":12109,\"region\":-1}"
}

Topic: topic.CmSpatTimeChangeDetailsEvent
Key: 10.11.81.12_null_12109
Offset: 47
Timestamp: 1711563895531
Value: 
{
    "eventGeneratedAt":1711563900878,
    "eventType":"TimeChangeDetails",
    "intersectionID":12109,
    "roadRegulatorID":-1,
    "signalGroup":6,
    "firstSpatTimestamp":1711563895531,
    "secondSpatTimestamp":1711563895623,
    "firstTimeMarkType":"minEndTime",
    "secondTimeMarkType":"minEndTime",
    "firstConflictingTimemark":3201,
    "secondConflictingTimemark":3191,
    "firstState":"STOP_AND_REMAIN",
    "secondState":"STOP_AND_REMAIN",
    "firstConflictingUtcTimestamp":1711562720100,
    "secondConflictingUtcTimestamp":1711562719100,
    "source":"{\"rsuId\":\"10.11.81.12\",\"intersectionId\":12109,\"region\":-1}"
}

Topic: topic.CmSpatTimeChangeDetailsEvent
Key: 10.11.81.12_null_12109
Offset: 48
Timestamp: 1711563895623
Value: 
{
    "eventGeneratedAt":1711563900878,
    "eventType":"TimeChangeDetails",
    "intersectionID":12109,
    "roadRegulatorID":-1,
    "signalGroup":2,
    "firstSpatTimestamp":1711563895623,
    "secondSpatTimestamp":1711563895732,
    "firstTimeMarkType":"maxEndTime",
    "secondTimeMarkType":"maxEndTime",
    "firstConflictingTimemark":3191,
    "secondConflictingTimemark":3221,
    "firstState":"STOP_AND_REMAIN",
    "secondState":"STOP_AND_REMAIN",
    "firstConflictingUtcTimestamp":1711562719100,
    "secondConflictingUtcTimestamp":1711562722100,
    "source":"{\"rsuId\":\"10.11.81.12\",\"intersectionId\":12109,\"region\":-1}"
}

Topic: topic.CmSpatTimeChangeDetailsEvent
Key: 10.11.81.12_null_12109
Offset: 49
Timestamp: 1711563895623
Value: 
{
    "eventGeneratedAt":1711563900878,
    "eventType":"TimeChangeDetails",
    "intersectionID":12109,
    "roadRegulatorID":-1,
    "signalGroup":4,
    "firstSpatTimestamp":1711563895623,
    "secondSpatTimestamp":1711563895732,
    "firstTimeMarkType":"maxEndTime",
    "secondTimeMarkType":"maxEndTime",
    "firstConflictingTimemark":3121,
    "secondConflictingTimemark":3151,
    "firstState":"PROTECTED_MOVEMENT_ALLOWED",
    "secondState":"PROTECTED_MOVEMENT_ALLOWED",
    "firstConflictingUtcTimestamp":1711562712100,
    "secondConflictingUtcTimestamp":1711562715100,
    "source":"{\"rsuId\":\"10.11.81.12\",\"intersectionId\":12109,\"region\":-1}"
}

Topic: topic.CmSpatTimeChangeDetailsEvent
Key: 10.11.81.12_null_12109
Offset: 50
Timestamp: 1711563895623
Value: 
{
    "eventGeneratedAt":1711563900878,
    "eventType":"TimeChangeDetails",
    "intersectionID":12109,
    "roadRegulatorID":-1,
    "signalGroup":6,
    "firstSpatTimestamp":1711563895623,
    "secondSpatTimestamp":1711563895732,
    "firstTimeMarkType":"maxEndTime",
    "secondTimeMarkType":"maxEndTime",
    "firstConflictingTimemark":3191,
    "secondConflictingTimemark":3221,
    "firstState":"STOP_AND_REMAIN",
    "secondState":"STOP_AND_REMAIN",
    "firstConflictingUtcTimestamp":1711562719100,
    "secondConflictingUtcTimestamp":1711562722100,
    "source":"{\"rsuId\":\"10.11.81.12\",\"intersectionId\":12109,\"region\":-1}"
}
% Reached end of topic topic.CmSpatTimeChangeDetailsEvent [0] at offset 51

Topic: topic.CmSpatTimeChangeDetailsEvent
Key: 10.11.81.12_null_12109
Offset: 51
Timestamp: 1711563897666
Value: 
{
    "eventGeneratedAt":1711563902927,
    "eventType":"TimeChangeDetails",
    "intersectionID":12109,
    "roadRegulatorID":-1,
    "signalGroup":2,
    "firstSpatTimestamp":1711563897666,
    "secondSpatTimestamp":1711563897759,
    "firstTimeMarkType":"minEndTime",
    "secondTimeMarkType":"minEndTime",
    "firstConflictingTimemark":3221,
    "secondConflictingTimemark":3211,
    "firstState":"STOP_AND_REMAIN",
    "secondState":"STOP_AND_REMAIN",
    "firstConflictingUtcTimestamp":1711562722100,
    "secondConflictingUtcTimestamp":1711562721100,
    "source":"{\"rsuId\":\"10.11.81.12\",\"intersectionId\":12109,\"region\":-1}"
}

Topic: topic.CmSpatTimeChangeDetailsEvent
Key: 10.11.81.12_null_12109
Offset: 52
Timestamp: 1711563897666
Value: 
{
    "eventGeneratedAt":1711563902927,
    "eventType":"TimeChangeDetails",
    "intersectionID":12109,
    "roadRegulatorID":-1,
    "signalGroup":4,
    "firstSpatTimestamp":1711563897666,
    "secondSpatTimestamp":1711563897759,
    "firstTimeMarkType":"minEndTime",
    "secondTimeMarkType":"minEndTime",
    "firstConflictingTimemark":3080,
    "secondConflictingTimemark":3070,
    "firstState":"PROTECTED_MOVEMENT_ALLOWED",
    "secondState":"PROTECTED_MOVEMENT_ALLOWED",
    "firstConflictingUtcTimestamp":1711562708000,
    "secondConflictingUtcTimestamp":1711562707000,
    "source":"{\"rsuId\":\"10.11.81.12\",\"intersectionId\":12109,\"region\":-1}"
}

Topic: topic.CmSpatTimeChangeDetailsEvent
Key: 10.11.81.12_null_12109
Offset: 53
Timestamp: 1711563897666
Value: 
{
    "eventGeneratedAt":1711563902927,
    "eventType":"TimeChangeDetails",
    "intersectionID":12109,
    "roadRegulatorID":-1,
    "signalGroup":6,
    "firstSpatTimestamp":1711563897666,
    "secondSpatTimestamp":1711563897759,
    "firstTimeMarkType":"minEndTime",
    "secondTimeMarkType":"minEndTime",
    "firstConflictingTimemark":3221,
    "secondConflictingTimemark":3211,
    "firstState":"STOP_AND_REMAIN",
    "secondState":"STOP_AND_REMAIN",
    "firstConflictingUtcTimestamp":1711562722100,
    "secondConflictingUtcTimestamp":1711562721100,
    "source":"{\"rsuId\":\"10.11.81.12\",\"intersectionId\":12109,\"region\":-1}"
}
% Reached end of topic topic.CmSpatTimeChangeDetailsEvent [0] at offset 54

All the events are for signal group 4 with "firstTimeMarkType" and "secondTimeMarkType" equal to 0.

Comments

-Key is concatenated string

With Aggregation

TODO