Skip to main content
`Ctrl`+`K`

# aequilibrae.paths.TrafficClass

class aequilibrae.paths.TrafficClass(name: str, graph: Graph, matrix: AequilibraeMatrix)

  Traffic class for equilibrium traffic assignment

      >>> from aequilibrae.paths import TrafficClass

      >>> project = create_example(project_path)
      >>> project.network.build_graphs()

      >>> graph = project.network.graphs['c'] # we grab the graph for cars
      >>> graph.set_graph('free_flow_time') # let's say we want to minimize time
      >>> graph.set_skimming(['free_flow_time', 'distance']) # And will skim time and distance
      >>> graph.set_blocked_centroid_flows(True)

      >>> proj_matrices = project.matrices

      >>> demand = proj_matrices.get_matrix("demand_omx")
      >>> demand.computational_view(['matrix'])

      >>> tc = TrafficClass("car", graph, demand)
      >>> tc.set_pce(1.3)

  __init__(name: str, graph: Graph, matrix: AequilibraeMatrix) → None

    Instantiates the class

    Arguments:

      name (`str`): UNIQUE class name.

      graph (`Graph`): Class/mode-specific graph

      matrix (`AequilibraeMatrix`): Class/mode-specific matrix. Supports multiple user classes

  Methods

  `__init__`(name, graph, matrix) | Instantiates the class
  `set_fixed_cost`(field_name[, multiplier]) | Sets value of time
  `set_pce`(pce) | Sets Passenger Car equivalent
  `set_select_links`(links) | Set the selected links.
  `set_vot`(value_of_time) | Sets value of time

  Attributes

  `info` |

  set_fixed_cost(field_name: str, multiplier=1)

    Sets value of time

    Arguments:

      field_name (`str`): Name of the graph field with fixed costs for this class

      multiplier (`Union[float, int]`): Multiplier for the fixed cost. Defaults to 1 if not set

  set_pce(pce: float | int) → None

    Sets Passenger Car equivalent

    Arguments:

      pce (`Union[float, int]`): PCE. Defaults to 1 if not set

  set_select_links(links: Dict[str, List[Tuple[int, int]]])

    Set the selected links. Checks if the links and directions are valid. Translates link_id and direction into unique link id used in compact graph. Supply links=None to disable select link analysis.

    Arguments:

      links (`Union[None, Dict[str, List[Tuple[int, int]]]]`): name of link set and Link IDs and directions to be used in select link analysis

  set_vot(value_of_time: float) → None

    Sets value of time

    Arguments:

      value_of_time (`Union[float, int]`): Value of time. Defaults to 1 if not set

  property info: dict