maliput
|
A set of mutually exclusive phases, e.g., that comprise the signaling cycle for an intersection.
#include <include/maliput/api/rules/phase_ring.h>
Classes | |
struct | NextPhase |
Holds a "next phase" specification. More... | |
Public Types | |
using | Id = TypeSpecificIdentifier< class PhaseRing > |
Unique identifier for a PhaseRing. More... | |
Public Member Functions | |
MALIPUT_DEFAULT_COPY_AND_MOVE_AND_ASSIGN (PhaseRing) | |
PhaseRing (const Id &id, const std::vector< Phase > &phases, const std::optional< const std::unordered_map< Phase::Id, std::vector< NextPhase >>> &next_phases=std::nullopt) | |
Constructs a PhaseRing. More... | |
const Id & | id () const |
Returns the phase ring's identifier. More... | |
std::optional< Phase > | GetPhase (const Phase::Id &id) const |
Returns a Phase by its id or std::nullopt when it is not present in this PhaseRing. More... | |
const std::unordered_map< Phase::Id, Phase > & | phases () const |
Returns the catalog of phases. More... | |
const std::unordered_map< Phase::Id, std::vector< NextPhase > > & | next_phases () const |
const std::vector< NextPhase > & | GetNextPhases (const Phase::Id &id) const |
Returns the possible next phases given the current phase with an ID of id . More... | |
using Id = TypeSpecificIdentifier<class PhaseRing> |
Unique identifier for a PhaseRing.
PhaseRing | ( | const Id & | id, |
const std::vector< Phase > & | phases, | ||
const std::optional< const std::unordered_map< Phase::Id, std::vector< NextPhase >>> & | next_phases = std::nullopt |
||
) |
Constructs a PhaseRing.
id | the unique ID of this phase ring |
phases | the phases within this ring. |
next_phases | specifies, for each phase, possible next phases. This can be std::nullopt, in which case, no next phases will be specified. |
std::exception | if phases is empty, phases contains duplicate Phase::Id's, the phases define different sets of RightOfWayRule::Ids and Rule::Ids, or the phases define different sets of bulb states. If next_phases is provided, this method will also throw if next_phases does not define the possible next phases of every phase in phases , or defines a next phase that is not in phases . |
Returns the possible next phases given the current phase with an ID of id
.
std::out_of_range | if no phase with an ID of id exists. |
const Id& id | ( | ) | const |
Returns the phase ring's identifier.
MALIPUT_DEFAULT_COPY_AND_MOVE_AND_ASSIGN | ( | PhaseRing | ) |