6.1.3.2.2. aequilibrae.project.network.LinkTypes

class aequilibrae.project.network.LinkTypes(net)

Bases: object

Access to the API resources to manipulate the link_types table in the network

from aequilibrae import Project

p = Project()
p.open('path/to/project/folder')

link_types = p.network.link_types

# We can get a dictionary of link types in the model
all_link_types = link_types.all_types()

#And do a bulk change and save it
for link_type_id, link_type_obj in all_link_types.items():
    link_type_obj.beta = 1

# We can save changes for all link types in one go
all_link_types.save()

# or just get one link_type in specific
default_link_type = link_types.get('y')

# or just get it by name
default_link_type = link_types.get_by_name('default')

# We can change the description of the link types
default_link_type.description = 'My own new description'

# Let's say we are using alpha to store lane capacity during the night as 90% of the standard
default_link_type.alpha =0.9 * default_link_type.lane_capacity

# To save this link types we can simply
default_link_type.save()

# We can also create a completely new link_type and add to the model
new_type = all_link_types.new('a')
new_type.link_type_name = 'Arterial'  # Only ASCII letters and *_* allowed
# other fields are not mandatory

# We then save it to the database
new_type.save()

# we can even keep editing and save it directly once we have added it to the project
new_type.lanes = 3
new_type.lane_capacity = 1100
new_type.save()
__init__(net)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(net)

Initialize self.

all_types()

Returns a dictionary with all LinkType objects available in the model.

delete(link_type_id)

Removes the link_type with link_type_id from the project

fields()

Returns a FieldEditor class instance to edit the Link_Types table fields and their metadata

get(link_type_id)

Get a link_type from the network by its link_type_id

get_by_name(link_type)

Get a link_type from the network by its link_type (i.e.

new(link_type_id)

save()

__init__(net)

Initialize self. See help(type(self)) for accurate signature.