uxsimpp.trafficppy.World

class uxsimpp.trafficppy.World

Bases: pybind11_object

__init__(*args, **kwargs)

Methods

Link_resolve(link_like[, ret_type])

__init__(*args, **kwargs)

addLink(name, start_node, end_node, length)

Add a link to the world.

addNode(name, x, y[, signal_intervals, ...])

Add a node to the world.

adddemand(origin, destination, start_time, ...)

Add demand (vehicle generation) to the world.

check_simulation_ongoing(self)

Check if simulation is still ongoing

eq_Link(link_like1, link_like2)

exec_simulation([duration_t, until_t])

Execute the simulation.

get_link(self, arg0)

Get a Link by name (reference)

get_node(self, arg0)

Get a Node by name (reference)

get_vehicle(self, arg0)

Get a Vehicle by name (reference)

initialize_adj_matrix(self)

Initialize adjacency matrix for network topology

link_inflow(l, t1, t2)

link_outflow(l, t1, t2)

main_loop(self, arg0, arg1)

Execute main simulation loop

print_scenario_stats(self)

Print scenario statistics

print_simple_results(self)

Print simple simulation results

update_adj_time_matrix(self)

Update adjacency time matrix

Attributes

DELTAT

Time step size (alias)

LINKS

Vector of pointers to all Links in the world.

NODES

Vector of pointers to all Nodes in the world.

TMAX

Maximum simulation time (alias)

VEHICLES

Vector of pointers to all Vehicles in the world.

delta_t

Time step size

deltan

Platoon size

name

World name

t_max

Maximum simulation time

time

Current simulation time

timestep

Current simulation timestep

property DELTAT

Time step size (alias)

Vector of pointers to all Links in the world.

property NODES

Vector of pointers to all Nodes in the world.

property TMAX

Maximum simulation time (alias)

property VEHICLES

Vector of pointers to all Vehicles in the world.

__init__(*args, **kwargs)

Add a link to the world.

Parameters:
  • W (World) – The world to which the link belongs.

  • name (str) – The name of the link.

  • start_node (str or Node) – The name of the start node of the link.

  • end_node (str or Node) – The name of the end node of the link.

  • length (float) – The length of the link.

  • free_flow_speed (float, optional) – The free flow speed on the link, default is 20.

  • jam_density (float, optional) – The jam density on the link, default is 0.2.

  • merge_priority (float, optional) – The priority of the link when merging, default is 1.

  • capacity_out (float, optional) – The capacity out of the link, default is -1 (unlimited).

  • signal_group (int or list, optional) – The signal group(s) to which the link belongs, default is [0].

Returns:

The created link.

Return type:

Link

addNode(name, x, y, signal_intervals=[0], signal_offset=0)

Add a node to the world.

Parameters:
  • W (World) – The world to which the node belongs.

  • name (str) – The name of the node.

  • x (float) – The x-coordinate of the node.

  • y (float) – The y-coordinate of the node.

  • signal_intervals (list of float, optional) – A list representing the signal at the node, default is [0].

  • signal_offset (float, optional) – The offset of the signal, default is 0.

Returns:

The created node.

Return type:

Node

adddemand(origin, destination, start_time, end_time, flow, links_preferred_list=[])

Add demand (vehicle generation) to the world.

Parameters:
  • W (World) – The world to which the demand belongs.

  • origin (str or Node) – The origin node.

  • destination (str or Node) – The destination node.

  • start_time (float) – The start time of demand.

  • end_time (float) – The end time of demand.

  • flow (float) – The flow rate of vehicles.

  • links_preferred_list (list of str or Link, optional) – The names of the links the vehicles prefer, default is empty list.

check_simulation_ongoing(self: uxsimpp.trafficppy.World) bool

Check if simulation is still ongoing

property delta_t

Time step size

property deltan

Platoon size

exec_simulation(duration_t=-1, until_t=-1)

Execute the simulation.

Parameters:
  • W (World) – The world simulation object.

  • duration_t (float, optional) – Duration to run simulation, default is -1 (until completion).

  • until_t (float, optional) – Time to run simulation until, default is -1 (until completion).

Get a Link by name (reference)

get_node(self: uxsimpp.trafficppy.World, arg0: str) Node

Get a Node by name (reference)

get_vehicle(self: uxsimpp.trafficppy.World, arg0: str) Vehicle

Get a Vehicle by name (reference)

initialize_adj_matrix(self: uxsimpp.trafficppy.World) None

Initialize adjacency matrix for network topology

main_loop(self: uxsimpp.trafficppy.World, arg0: float, arg1: float) None

Execute main simulation loop

property name

World name

print_scenario_stats(self: uxsimpp.trafficppy.World) None

Print scenario statistics

print_simple_results(self: uxsimpp.trafficppy.World) None

Print simple simulation results

property t_max

Maximum simulation time

property time

Current simulation time

property timestep

Current simulation timestep

update_adj_time_matrix(self: uxsimpp.trafficppy.World) None

Update adjacency time matrix