[−][src]Struct map_model::ControlTrafficSignal
A traffic signal consists of a sequence of Stages that repeat in a cycle. Most Stages last for a fixed duration. During a single Stage, some movements are protected (can proceed with the highest priority), while others are permitted (have to yield before proceeding).
Fields
id: IntersectionID
stages: Vec<Stage>
offset: Duration
movements: BTreeMap<MovementID, Movement>
Implementations
impl ControlTrafficSignal
[src]
pub fn new(
map: &Map,
id: IntersectionID,
timer: &mut Timer<'_>
) -> ControlTrafficSignal
[src]
map: &Map,
id: IntersectionID,
timer: &mut Timer<'_>
) -> ControlTrafficSignal
pub fn get_possible_policies(
map: &Map,
id: IntersectionID,
timer: &mut Timer<'_>
) -> Vec<(String, ControlTrafficSignal)>
[src]
map: &Map,
id: IntersectionID,
timer: &mut Timer<'_>
) -> Vec<(String, ControlTrafficSignal)>
pub fn brute_force(map: &Map, id: IntersectionID)
[src]
pub fn get_min_crossing_time(&self, idx: usize) -> Duration
[src]
pub(crate) fn validate(&self) -> Result<(), String>
[src]
pub fn convert_to_ped_scramble(&mut self) -> bool
[src]
Returns true if this did anything
pub fn turn_to_movement(&self, turn: TurnID) -> MovementID
[src]
pub fn missing_turns(&self) -> BTreeSet<MovementID>
[src]
pub fn compressed_id(&self, turn: TurnID) -> CompressedMovementID
[src]
impl ControlTrafficSignal
[src]
pub fn export(&self, map: &Map) -> TrafficSignal
[src]
pub(crate) fn import(
raw: TrafficSignal,
id: IntersectionID,
map: &Map
) -> Result<ControlTrafficSignal, String>
[src]
raw: TrafficSignal,
id: IntersectionID,
map: &Map
) -> Result<ControlTrafficSignal, String>
Trait Implementations
impl Clone for ControlTrafficSignal
[src]
fn clone(&self) -> ControlTrafficSignal
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ControlTrafficSignal
[src]
impl<'de> Deserialize<'de> for ControlTrafficSignal
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl PartialEq<ControlTrafficSignal> for ControlTrafficSignal
[src]
fn eq(&self, other: &ControlTrafficSignal) -> bool
[src]
fn ne(&self, other: &ControlTrafficSignal) -> bool
[src]
impl Serialize for ControlTrafficSignal
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for ControlTrafficSignal
[src]
Auto Trait Implementations
impl RefUnwindSafe for ControlTrafficSignal
impl Send for ControlTrafficSignal
impl Sync for ControlTrafficSignal
impl Unpin for ControlTrafficSignal
impl UnwindSafe for ControlTrafficSignal
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,