traveler.demo.work_location.Tours#

class traveler.demo.work_location.Tours(store, table_name=None, index_array=None)[source]#

Bases: StoredTable

A class representing households in the traveler framework.

Initialize the IndexedTable with an index array and a table.

Parameters:
  • index_array (jax.numpy.ndarray) – An array of indices to index into the table.

  • table (JaxTable) – The table to index into.

  • store (AbstractStore | None)

  • table_name (str)

Methods#

info()

Print summary information about the underlying table.

push_down(*attrs)

Compute a lazy attribute and push it down to the underlying table.

rehash(*args)

Rehash a table's random key by folding in additional values.

table_fields(*[, include_extras])

Return the inherited schema fields declared by class annotations.

to_pandas([include_prng_key, full_table])

Convert the stored table to a pandas DataFrame.

to_polars([include_prng_key, full_table])

Convert the stored table to a polars DataFrame.

validate([verbose, sources, missing_fields])

Validate the table and index array.

with_store(store)

Return a new instance of this StoredTable with the given store.

without_store()

Prepare this stored table for use with JAX tools.

Attributes#

global_random_seed

household

Return households aligned with the indexed tours.

person

Return persons aligned with the indexed tours.

self_idx

Get the index array for this IndexedTable.

sov_available

Whether the SOV mode is available for this tour.

table_id_col

The name of the column that serves as the unique identifier for the table.

table_name

The name of the table in the store.

tour_id

person_id

household_id

otaz

dtaz

out_period

Skims time period for the outbound (first) half of the tour.

in_period

Skims time period for the inbound (second, return) half of the tour.

is_joint

Whether this is a joint tour.

is_atwork_subtour

Whether this is an at-work subtour.

hov2_available

Whether the HOV2 mode is available for this tour.

work_tour_is_SOV

Whether the work tour is SOV.

terminal_time

Terminal time for the tour, used in utility calculations.

number_of_participants

Number of participants in the tour.

daily_parking_cost

Daily parking cost for the tour.