Skip to main content

TransportLinkOps

Trait TransportLinkOps 

Source
pub trait TransportLinkOps {
    // Required methods
    fn link_density(&self, link_id: LinkId) -> f64;
    fn link_speed(&self, link_id: LinkId) -> f64;
    fn link_free_flow_time(&self, link_id: LinkId) -> f64;
    fn link_travel_time(&self, link_id: LinkId) -> f64;
    fn agent_speed(&self, id: u64) -> Result<f64, LinkSpaceError>;
    fn agent_speed_decision<P: QueuePolicy>(
        &self,
        id: u64,
        policy: &P,
    ) -> Result<SpeedDecision, LinkSpaceError>;
    fn agent_speed_with_policy<P: QueuePolicy>(
        &self,
        id: u64,
        policy: &P,
    ) -> Result<f64, LinkSpaceError>;
    fn volume_capacity_ratio(&self, link_id: LinkId, time_window_s: f64) -> f64;
}
Expand description

Transport-specific operations over LinkSpace<LinkProperties>.

These helpers define a small reusable baseline policy layer. They are suitable for simple transport scenarios and examples, but they do not claim calibrated or reference-grade operational realism.

Required Methods§

Per-link density computed from current occupancy, link length, and lane count.

Per-link snapshot speed computed from the configured fundamental diagram.

Free-flow traversal time using static geometry and free-flow speed.

Snapshot traversal time using current link_speed.

Source

fn agent_speed(&self, id: u64) -> Result<f64, LinkSpaceError>

Simple FIFO/gap-limited speed estimate for one agent on its current link.

Source

fn agent_speed_decision<P: QueuePolicy>( &self, id: u64, policy: &P, ) -> Result<SpeedDecision, LinkSpaceError>

Speed decision for one agent using an explicit queue policy.

Source

fn agent_speed_with_policy<P: QueuePolicy>( &self, id: u64, policy: &P, ) -> Result<f64, LinkSpaceError>

Speed estimate for one agent using an explicit queue policy.

Source

fn volume_capacity_ratio(&self, link_id: LinkId, time_window_s: f64) -> f64

Simple volume/capacity ratio over an externally supplied time window.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl TransportLinkOps for LinkSpace<LinkProperties>

Source§

fn agent_speed(&self, id: u64) -> Result<f64, LinkSpaceError>

Source§

fn agent_speed_decision<P: QueuePolicy>( &self, id: u64, policy: &P, ) -> Result<SpeedDecision, LinkSpaceError>

Source§

fn agent_speed_with_policy<P: QueuePolicy>( &self, id: u64, policy: &P, ) -> Result<f64, LinkSpaceError>

Source§

fn volume_capacity_ratio(&self, link_id: LinkId, time_window_s: f64) -> f64

Implementors§