Skip to main content
Ctrl+K

AequilibraE

    • Main menu
    • The AequilibraE Project
    • Project Components
    • Network manipulation
    • Distribution Procedures
    • Path Computation
    • Traffic Assignment
    • Public Transport
    • Transit Assignment
    • Route choice
    • Other Applications
  • Python
  • QGIS
  • GitHub
    • Main menu
    • The AequilibraE Project
    • Project Components
    • Network manipulation
    • Distribution Procedures
    • Path Computation
    • Traffic Assignment
    • Public Transport
    • Transit Assignment
    • Route choice
    • Other Applications
  • Python
  • QGIS
  • GitHub

Section Navigation

  • aequilibrae.project.Project
  • aequilibrae.project.About
  • aequilibrae.project.FieldEditor
  • aequilibrae.project.Log
  • aequilibrae.project.Matrices
  • aequilibrae.project.Network
  • aequilibrae.project.Zoning
  • aequilibrae.project.Zone
  • aequilibrae.project.network.Modes
  • aequilibrae.project.network.LinkTypes
  • aequilibrae.project.network.Links
  • aequilibrae.project.network.Nodes
  • aequilibrae.project.network.Periods
  • aequilibrae.project.network.Mode
  • aequilibrae.project.network.LinkType
  • aequilibrae.project.network.Link
  • aequilibrae.project.network.Node
  • aequilibrae.project.network.Period
  • aequilibrae.distribution.Ipf
  • aequilibrae.distribution.GravityCalibration
  • aequilibrae.distribution.GravityApplication
  • aequilibrae.distribution.SyntheticGravityModel
  • aequilibrae.matrix.AequilibraeMatrix
  • aequilibrae.paths.NetworkSkimming
  • aequilibrae.paths.Graph
  • aequilibrae.paths.TransitGraph
  • aequilibrae.paths.TrafficClass
  • aequilibrae.paths.TransitClass
  • aequilibrae.paths.VDF
  • aequilibrae.paths.TrafficAssignment
  • aequilibrae.paths.TransitAssignment
  • aequilibrae.paths.AssignmentResults
  • aequilibrae.paths.TransitAssignmentResults
  • aequilibrae.paths.SkimResults
  • aequilibrae.paths.PathResults
  • aequilibrae.paths.HyperpathGenerating
  • aequilibrae.paths.OptimalStrategies
  • aequilibrae.paths.RouteChoice
  • aequilibrae.paths.SubAreaAnalysis
  • aequilibrae.transit.Transit
  • aequilibrae.transit.TransitGraphBuilder
  • aequilibrae.transit.lib_gtfs.GTFSRouteSystemBuilder
  • aequilibrae.utils.create_delaunay_network.DelaunayAnalysis
  • aequilibrae.utils.create_example
  • aequilibrae.Parameters
  • aequilibrae.project.network.Link

aequilibrae.project.network.Link#

class aequilibrae.project.network.Link(dataset, project)[source]#

A Link object represents a single record in the links table

>>> project = create_example(project_path)

>>> all_links = project.network.links

# Let's get a mode to work with
>>> modes = project.network.modes
>>> car_mode = modes.get('c')

# We can just get one link in specific
>>> link1 = all_links.get(3)
>>> link2 = all_links.get(17)

# We can find out which fields exist for the links
>>> which_fields_do_we_have = link1.data_fields()

# And edit each one like this
>>> link1.lanes_ab = 3
>>> link1.lanes_ba = 2

# we can drop a mode from the link
>>> link1.drop_mode(car_mode)  # or link1.drop_mode('c')

# we can add a mode to the link
>>> link2.add_mode(car_mode)  # or link2.add_mode('c')

# Or set all modes at once
>>> link2.set_modes('cbtw')

# We can just save the link
>>> link1.save()
>>> link2.save()
__init__(dataset, project)[source]#

Methods

__init__(dataset, project)

add_mode(mode)

Adds a new mode to this link

connect_db()

data_fields()

lists all data fields for the link, as available in the database

delete()

Deletes link from database

drop_mode(mode)

Removes a mode from this link

save()

Saves link to database

set_modes(modes)

Sets the modes acceptable for this link

add_mode(mode: str | Mode)[source]#

Adds a new mode to this link

Raises a warning if mode is already allowed on the link, and fails if mode does not exist

Arguments:

mode_id (str or Mode): Mode_id of the mode or mode object to be added to the link

connect_db()#
data_fields() → list[source]#

lists all data fields for the link, as available in the database

Returns:

data fields (list): list of all fields available for editing

delete()[source]#

Deletes link from database

drop_mode(mode: str | Mode)[source]#

Removes a mode from this link

Raises a warning if mode is already NOT allowed on the link, and fails if mode does not exist

Arguments:

mode_id (str or Mode): Mode_id of the mode or mode object to be removed from the link

save()[source]#

Saves link to database

set_modes(modes: str)[source]#

Sets the modes acceptable for this link

Arguments:

modes (str): string with all mode_ids to be assigned to this link

On this page
  • Link
    • Link.__init__()
    • Link.add_mode()
    • Link.connect_db()
    • Link.data_fields()
    • Link.delete()
    • Link.drop_mode()
    • Link.save()
    • Link.set_modes()

This Page

  • Show Source

© Copyright 2025-01-15, AequilibraE developers.

Created using Sphinx 8.1.3.

Built with the PyData Sphinx Theme 0.16.1.