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: ContextSubscriptionResultsImplementations§
Source§impl SimulationScope
impl SimulationScope
Sourcepub fn get_all_subscription_results(&self) -> &SubscriptionResults
pub fn get_all_subscription_results(&self) -> &SubscriptionResults
Return all variable subscription results cached after the last simulation_step.
Sourcepub fn get_subscription_results(&self, obj_id: &str) -> Option<&TraciResults>
pub fn get_subscription_results(&self, obj_id: &str) -> Option<&TraciResults>
Return the variable subscription results for a single object.
Sourcepub fn get_all_context_subscription_results(
&self,
) -> &ContextSubscriptionResults
pub fn get_all_context_subscription_results( &self, ) -> &ContextSubscriptionResults
Return all context subscription results cached after the last simulation_step.
Sourcepub fn get_context_subscription_results(
&self,
obj_id: &str,
) -> Option<&SubscriptionResults>
pub fn get_context_subscription_results( &self, obj_id: &str, ) -> Option<&SubscriptionResults>
Return the context subscription results for a single object.
pub fn get_current_time( &self, client: &mut TraciClient, ) -> Result<i32, TraciError>
pub fn get_time(&self, client: &mut TraciClient) -> Result<f64, TraciError>
pub fn get_loaded_number( &self, client: &mut TraciClient, ) -> Result<i32, TraciError>
pub fn get_loaded_id_list( &self, client: &mut TraciClient, ) -> Result<Vec<String>, TraciError>
pub fn get_departed_number( &self, client: &mut TraciClient, ) -> Result<i32, TraciError>
pub fn get_departed_id_list( &self, client: &mut TraciClient, ) -> Result<Vec<String>, TraciError>
pub fn get_arrived_number( &self, client: &mut TraciClient, ) -> Result<i32, TraciError>
pub fn get_arrived_id_list( &self, client: &mut TraciClient, ) -> Result<Vec<String>, TraciError>
pub fn get_starting_teleport_number( &self, client: &mut TraciClient, ) -> Result<i32, TraciError>
pub fn get_starting_teleport_id_list( &self, client: &mut TraciClient, ) -> Result<Vec<String>, TraciError>
pub fn get_ending_teleport_number( &self, client: &mut TraciClient, ) -> Result<i32, TraciError>
pub fn get_ending_teleport_id_list( &self, client: &mut TraciClient, ) -> Result<Vec<String>, TraciError>
pub fn get_departed_person_number( &self, client: &mut TraciClient, ) -> Result<i32, TraciError>
pub fn get_departed_person_id_list( &self, client: &mut TraciClient, ) -> Result<Vec<String>, TraciError>
pub fn get_arrived_person_number( &self, client: &mut TraciClient, ) -> Result<i32, TraciError>
pub fn get_arrived_person_id_list( &self, client: &mut TraciClient, ) -> Result<Vec<String>, TraciError>
pub fn get_delta_t(&self, client: &mut TraciClient) -> Result<f64, TraciError>
pub fn get_net_boundary( &self, client: &mut TraciClient, ) -> Result<Vec<TraciPosition>, TraciError>
pub fn get_min_expected_number( &self, client: &mut TraciClient, ) -> Result<i32, TraciError>
pub fn get_option( &self, client: &mut TraciClient, option: &str, ) -> Result<String, TraciError>
pub fn get_bus_stop_waiting( &self, client: &mut TraciClient, stop_id: &str, ) -> Result<i32, TraciError>
pub fn get_bus_stop_waiting_id_list( &self, client: &mut TraciClient, stop_id: &str, ) -> Result<Vec<String>, TraciError>
Sourcepub fn convert2d(
&self,
client: &mut TraciClient,
edge_id: &str,
pos: f64,
lane_index: i32,
to_geo: bool,
) -> Result<TraciPosition, TraciError>
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.
Sourcepub fn convert3d(
&self,
client: &mut TraciClient,
edge_id: &str,
pos: f64,
lane_index: i32,
to_geo: bool,
) -> Result<TraciPosition, TraciError>
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.
Sourcepub fn convert_road(
&self,
client: &mut TraciClient,
x: f64,
y: f64,
is_geo: bool,
v_class: &str,
) -> Result<TraciRoadPosition, TraciError>
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.
Sourcepub fn convert_geo(
&self,
client: &mut TraciClient,
x: f64,
y: f64,
from_geo: bool,
) -> Result<TraciPosition, TraciError>
pub fn convert_geo( &self, client: &mut TraciClient, x: f64, y: f64, from_geo: bool, ) -> Result<TraciPosition, TraciError>
Convert between geographic and Cartesian positions.
Sourcepub 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>
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.
Sourcepub fn get_distance_road(
&self,
client: &mut TraciClient,
edge_id1: &str,
pos1: f64,
edge_id2: &str,
pos2: f64,
is_driving: bool,
) -> Result<f64, TraciError>
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.
Sourcepub fn find_route(
&self,
client: &mut TraciClient,
from_edge: &str,
to_edge: &str,
v_type: &str,
pos: f64,
routing_mode: i32,
) -> Result<TraciStage, TraciError>
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.
pub fn load_state( &self, client: &mut TraciClient, path: &str, ) -> Result<(), TraciError>
pub fn save_state( &self, client: &mut TraciClient, destination: &str, ) -> Result<(), TraciError>
pub fn write_message( &self, client: &mut TraciClient, msg: &str, ) -> Result<(), TraciError>
pub fn subscribe( &self, client: &mut TraciClient, vars: &[u8], begin: f64, end: f64, ) -> Result<(), TraciError>
Trait Implementations§
Source§impl Debug for SimulationScope
impl Debug for SimulationScope
Source§impl Default for SimulationScope
impl Default for SimulationScope
Source§fn default() -> SimulationScope
fn default() -> SimulationScope
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SimulationScope
impl RefUnwindSafe for SimulationScope
impl Send for SimulationScope
impl Sync for SimulationScope
impl Unpin for SimulationScope
impl UnsafeUnpin for SimulationScope
impl UnwindSafe for SimulationScope
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more