Skip to main content

SimulationScope

Struct SimulationScope 

Source
pub struct SimulationScope {
    pub subscription_results: SubscriptionResults,
    pub context_subscription_results: ContextSubscriptionResults,
}
Expand description

Scope for querying and controlling the SUMO simulation.

Fields§

§subscription_results: SubscriptionResults§context_subscription_results: ContextSubscriptionResults

Implementations§

Source§

impl SimulationScope

Source

pub fn get_all_subscription_results(&self) -> &SubscriptionResults

Return all variable subscription results cached after the last simulation_step.

Source

pub fn get_subscription_results(&self, obj_id: &str) -> Option<&TraciResults>

Return the variable subscription results for a single object.

Source

pub fn get_all_context_subscription_results( &self, ) -> &ContextSubscriptionResults

Return all context subscription results cached after the last simulation_step.

Source

pub fn get_context_subscription_results( &self, obj_id: &str, ) -> Option<&SubscriptionResults>

Return the context subscription results for a single object.

Source

pub fn get_current_time( &self, client: &mut TraciClient, ) -> Result<i32, TraciError>

Source

pub fn get_time(&self, client: &mut TraciClient) -> Result<f64, TraciError>

Source

pub fn get_loaded_number( &self, client: &mut TraciClient, ) -> Result<i32, TraciError>

Source

pub fn get_loaded_id_list( &self, client: &mut TraciClient, ) -> Result<Vec<String>, TraciError>

Source

pub fn get_departed_number( &self, client: &mut TraciClient, ) -> Result<i32, TraciError>

Source

pub fn get_departed_id_list( &self, client: &mut TraciClient, ) -> Result<Vec<String>, TraciError>

Source

pub fn get_arrived_number( &self, client: &mut TraciClient, ) -> Result<i32, TraciError>

Source

pub fn get_arrived_id_list( &self, client: &mut TraciClient, ) -> Result<Vec<String>, TraciError>

Source

pub fn get_starting_teleport_number( &self, client: &mut TraciClient, ) -> Result<i32, TraciError>

Source

pub fn get_starting_teleport_id_list( &self, client: &mut TraciClient, ) -> Result<Vec<String>, TraciError>

Source

pub fn get_ending_teleport_number( &self, client: &mut TraciClient, ) -> Result<i32, TraciError>

Source

pub fn get_ending_teleport_id_list( &self, client: &mut TraciClient, ) -> Result<Vec<String>, TraciError>

Source

pub fn get_departed_person_number( &self, client: &mut TraciClient, ) -> Result<i32, TraciError>

Source

pub fn get_departed_person_id_list( &self, client: &mut TraciClient, ) -> Result<Vec<String>, TraciError>

Source

pub fn get_arrived_person_number( &self, client: &mut TraciClient, ) -> Result<i32, TraciError>

Source

pub fn get_arrived_person_id_list( &self, client: &mut TraciClient, ) -> Result<Vec<String>, TraciError>

Source

pub fn get_delta_t(&self, client: &mut TraciClient) -> Result<f64, TraciError>

Source

pub fn get_net_boundary( &self, client: &mut TraciClient, ) -> Result<Vec<TraciPosition>, TraciError>

Source

pub fn get_min_expected_number( &self, client: &mut TraciClient, ) -> Result<i32, TraciError>

Source

pub fn get_option( &self, client: &mut TraciClient, option: &str, ) -> Result<String, TraciError>

Source

pub fn get_bus_stop_waiting( &self, client: &mut TraciClient, stop_id: &str, ) -> Result<i32, TraciError>

Source

pub fn get_bus_stop_waiting_id_list( &self, client: &mut TraciClient, stop_id: &str, ) -> Result<Vec<String>, TraciError>

Source

pub fn convert2d( &self, client: &mut TraciClient, edge_id: &str, pos: f64, lane_index: i32, to_geo: bool, ) -> Result<TraciPosition, TraciError>

Convert a road position (edge + offset + lane) to a 2-D or geographic position.

Source

pub fn convert3d( &self, client: &mut TraciClient, edge_id: &str, pos: f64, lane_index: i32, to_geo: bool, ) -> Result<TraciPosition, TraciError>

Convert a road position to a 3-D or geographic+alt position.

Source

pub fn convert_road( &self, client: &mut TraciClient, x: f64, y: f64, is_geo: bool, v_class: &str, ) -> Result<TraciRoadPosition, TraciError>

Convert a 2-D (or geo) position to a road position.

Source

pub fn convert_geo( &self, client: &mut TraciClient, x: f64, y: f64, from_geo: bool, ) -> Result<TraciPosition, TraciError>

Convert between geographic and Cartesian positions.

Source

pub fn get_distance_2d( &self, client: &mut TraciClient, x1: f64, y1: f64, x2: f64, y2: f64, is_geo: bool, is_driving: bool, ) -> Result<f64, TraciError>

Get the distance between two 2-D (or geo) positions.

Source

pub fn get_distance_road( &self, client: &mut TraciClient, edge_id1: &str, pos1: f64, edge_id2: &str, pos2: f64, is_driving: bool, ) -> Result<f64, TraciError>

Get the distance between two road positions.

Source

pub fn find_route( &self, client: &mut TraciClient, from_edge: &str, to_edge: &str, v_type: &str, pos: f64, routing_mode: i32, ) -> Result<TraciStage, TraciError>

Find a route between two edges, returning a TraciStage.

Source

pub fn load_state( &self, client: &mut TraciClient, path: &str, ) -> Result<(), TraciError>

Source

pub fn save_state( &self, client: &mut TraciClient, destination: &str, ) -> Result<(), TraciError>

Source

pub fn write_message( &self, client: &mut TraciClient, msg: &str, ) -> Result<(), TraciError>

Source

pub fn subscribe( &self, client: &mut TraciClient, vars: &[u8], begin: f64, end: f64, ) -> Result<(), TraciError>

Trait Implementations§

Source§

impl Debug for SimulationScope

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SimulationScope

Source§

fn default() -> SimulationScope

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.