TripList Class Reference

CPP API: mio::abm::TripList Class Reference
mio::abm::TripList Class Reference

A list of Trips a Person follows. More...

#include <trip_list.h>

Public Member Functions

void add_trips (std::vector< Trip > trip)
 Adds Trips to the trip list. More...
 
auto default_serialize ()
 This method is used by the default serialization feature. More...
 
uint32_t get_current_index () const
 Get the current index. More...
 
const Tripget_next_trip () const
 Get the next Trip. More...
 
TimePoint get_next_trip_time () const
 Get the trip_time at which the next Trip will happen. More...
 
void increase_index ()
 Increment the current index to select the next Trip. More...
 
size_t num_trips () const
 Get the length of the TripList. More...
 
void reset_index ()
 Reset the current index to 0. More...
 
 TripList ()=default
 Construct empty TripList. More...
 

Private Attributes

uint32_t m_current_index = 0
 The index of the Trip a Person makes next. More...
 
std::vector< Tripm_trips
 The list of Trips a Person makes on a weekday. More...
 

Detailed Description

A list of Trips a Person follows.

Constructor & Destructor Documentation

◆ TripList()

mio::abm::TripList::TripList ( )
default

Construct empty TripList.

Member Function Documentation

◆ add_trips()

void mio::abm::TripList::add_trips ( std::vector< Trip trip)

Adds Trips to the trip list.

Parameters
[in]tripsThe Trips to be added.
[in]weekendIf the Trip is made on a weekend day.

◆ default_serialize()

auto mio::abm::TripList::default_serialize ( )
inline

This method is used by the default serialization feature.

◆ get_current_index()

uint32_t mio::abm::TripList::get_current_index ( ) const
inline

Get the current index.

◆ get_next_trip()

const Trip & mio::abm::TripList::get_next_trip ( ) const

Get the next Trip.

Parameters
weekendWhether the Trips during the week or on the weekend are used.

◆ get_next_trip_time()

TimePoint mio::abm::TripList::get_next_trip_time ( ) const

Get the trip_time at which the next Trip will happen.

Parameters
weekendWhether the Trips during the week or on the weekend are used.

◆ increase_index()

void mio::abm::TripList::increase_index ( )
inline

Increment the current index to select the next Trip.

◆ num_trips()

size_t mio::abm::TripList::num_trips ( ) const
inline

Get the length of the TripList.

Parameters
weekendWhether the Trips during the week or on the weekend are used.

◆ reset_index()

void mio::abm::TripList::reset_index ( )
inline

Reset the current index to 0.

Member Data Documentation

◆ m_current_index

uint32_t mio::abm::TripList::m_current_index = 0
private

The index of the Trip a Person makes next.

◆ m_trips

std::vector<Trip> mio::abm::TripList::m_trips
private

The list of Trips a Person makes on a weekday.