pub struct DiscreteValueRule { /* private fields */ }
Expand description
§Rule
A Rule may have multiple states that affect agent behavior while it is driving through the rule’s zone. The possible states of a Rule must be semantically coherent. The current state of a Rule is given by a [RuleStateProvider]. States can be:
- range based (RangeValueRule).
- discrete (DiscreteValueRule).
§DiscreteValueRule
DiscreteValues are defined by a string value. Semantics of this rule are based on all possible values that this DiscreteValueRule::type_id could have (as specified by RuleRegistry::FindRuleByType()), not only the subset of values that a specific instance of this rule can be in.
Implementations§
Source§impl DiscreteValueRule
impl DiscreteValueRule
Sourcepub fn type_id(&self) -> String
pub fn type_id(&self) -> String
Returns the type of the rule as a string. Example: “right-of-way-rule-type-id”, “direction-usage-rule-type-id”
§Returns
The type id of the rule.
Sourcepub fn zone(&self) -> LaneSRoute
pub fn zone(&self) -> LaneSRoute
Returns a crate::api::LaneSRoute that represents the zone that the rule applies to.
§Returns
A crate::api::LaneSRoute representing the zone of the rule.
Sourcepub fn states(&self) -> Vec<DiscreteValue>
pub fn states(&self) -> Vec<DiscreteValue>
Returns the states of the rule.
§Returns
A vector of DiscreteValues representing the states of the rule. If the rule has no states, an empty vector is returned.