Architecture and Toolkit

Updated: 2026-05-28

The architecture of the Road resource is a direct evolution of the algorithm used in Conveyor. Both share the same fundamental philosophy:

  • completely decouple visualization from logic,
  • represent movement through mathematical regimes,
  • and resolve only relevant changes through discrete events.

However, the kinematic problem of vehicles introduces two fundamental differences that profoundly transform the system's internal architecture.

 

1. Explicit Causal Topology

In Conveyor, to put it more clearly, the logic searched for the entity relevant to each geometric calculation. In the Road resource, we now introduce a doubly linked list in each vehicle to identify which vehicle is ahead and which is behind it.

  • the preceding vehicle (RR_CarFront)
  • the following vehicle (RR_CarRear)

The system also keeps track of:

  • the current leader (RR_CarLeader)
  • and the last vehicle on the road (RR_CarTail)

In this way, fundamental operations no longer require global searches across the resource and can instead be resolved through direct access.

 

2. Timeouts No Longer Represent Possibilities

In Conveyor, a TIMEOUT represented the next geometrically possible instant at which a constraint could change. It was recalculated if the expected conditions had not been met at that time. It could never occur earlier.

In Road, this is not the case.

Each vehicle has its own kinematic regime and therefore any future prediction depends entirely on that regime remaining valid. Since there is no way to know whether a change will occur at a later time, the prediction must be discarded.

This introduces a new concept into the engine:

A future event does not represent a future truth, but rather a mathematical hypothesis that is valid under a specific regime.

When a vehicle catches up with the one ahead, its dynamic regime changes automatically: it inherits the speed, acceleration, and a new time reference.

At that moment, all previous predictions cease to have physical meaning.

To solve this problem, each entity maintains a kinematic version identifier (RR_RegimeVersion).

Whenever the regime changes, the version number is incremented, and all future events scheduled with older versions automatically invalidate themselves when executed.

This turns TIMEOUT events into self-consistent, disposable predictions.

The engine does not need to cancel events globally; they invalidate themselves.

As a side note, the same problem could also be solved by directly invalidating the timeout, storing its D$N and sending it a signal. However, the mechanism based on kinematic versions (RR_RegimeVersion) is more decoupled and robust, since it avoids explicitly managing the lifecycle of pending virtual entities and makes each prediction self-contained and self-invalidating.