/lib-router

Arrow Library - Fleet Routing Algorithm Library

Primary LanguageRust

Arrow Banner

Arrow Router Library (Decommissioned)

⚠️ This library is no longer under maintenance. The library has been integrated into svc-scheduler, further changes/features will be done as a part of svc-scheduler's development. You are still welcome to use this library on a standalone basis.

Rust Checks Python Flake8 Arrow DAO Discord

🔭 Overview

The router library provides an engine for routing queries.

Under the hood, the router engine builds a graph of nodes and edges. A node represents a "stop" like a vertipad, vertiport, or a rooftop where aircraft can land and/or take off. An edge represents a "route" between two nodes. The router engine provides a number of functionalities to query the graph, such as finding the shortest path between two nodes, or finding all nodes within a certain distance of a given node (WIP).

Directory:

  • src/: Source Code and Unit Tests
  • tests/: Integration Tests
  • docs/: Library Documentation

⚙️ Installation

Install Rust with Rustup.

cargo test

Make

Build and test

To ensure consistent build and test outputs, Arrow provides a Docker image with all required software installed to build and test Rust projects. Using the Makefile, you can easily test and build your code.

# Run tests
make test

# Run build
make build

Formatting

The Arrow docker image has some formatting tools installed which can fix your code formatting for you. Using the Makefile, you can easily run the formatters on your code. Make sure to commit your code before running these commands, as they might not always result in a desired outcome.

# Format TOML files
make toml-tidy

# Format Rust files
make rust-tidy

# Format Python files
make python-tidy

# Format all at once
make tidy

Other make targets

There are additional make targets available. You can find all possible targets by running make without a target or use make help

📜 Documentation

The following documents are relevant to this library:

🧭 Roadmap

Engine APIs:

  • add_node: Add a node to the graph
  • add_edge: Add an edge to the graph
  • remove_node: Remove a node from the graph
  • remove_edge: Remove an edge from the graph
  • get_node_by_uid: Get a node by its unique ID
  • get_edges_by_node_uid: Get all edges connected to a node
  • update_weight: Update the weight of an edge given two nodes
  • has_node: Check if a node exists in the graph (this can be achieved by calling the get_node_index function. If the node does not exist, it will just return None)
  • has_edge: Check if an edge exists in the graph
  • get_nodes_within_distance: Get all nodes within a certain distance of a given node This functionality is now expected to be implemented by the user.

Tests:

  • Integration tests.
  • Graphical representation: possibly using leaflet.js or similar.

👥 Arrow DAO

Learn more about us: