Graph, Graph Algorithm, and Klang Valley Transit Routing
Project description
Klang Valley Transit
Installation
- install from PyPI
pip install klang-valley-transit
- install directly from github repository
pip install git+https://gitlab.com/packages4240711/klangvalleytransit@master
sample use case
- LRT and MRT station Listing
from klang_valley_transit.trainNetwork import TrainNetwork
from klang_valley_transit.trainNetwork import SearchFilter, LineNameEnum
# initiate the instance
t = TrainNetwork()
# List all LRT and MRT stations
s,err = t.ListStation(SearchFilter(line_name="*"))
if err: raise(err)
print(s)
# List LRT or MRT stations where LineName is AMPANG_LRT
s,err = t.ListStation(SearchFilter(line_name=LineNameEnum.AG))
if err: raise(err)
print(s)
# List AMPANG LRT where the code is AG11
s,err = t.ListStation(SearchFilter(line_name=LineNameEnum.AG, code="AG11"))
if err: raise(err)
print(s)
# Search from all AMPANG LRT stations where station name like sentul
s,err = t.ListStation(SearchFilter(line_name=LineNameEnum.AG, station_name="sentul"))
if err: raise(err)
print(s)
- MRT and LRT station routing
from klang_valley_transit.trainNetwork import TrainNetwork
# initiate the instance
t = TrainNetwork()
# getting 2 random station id
[fromID,toID], error = t.getRandomVerticesID(2)
if error: print(error)
print(fromID,toID)
# routing the station base on ID
res,err = t.breadthFirstSearch(fromID,toID)
if err : raise(err)
print("explored : ",res.explored )
print("path : ",res.path)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
klang_valley_transit-1.0.1.tar.gz
(25.0 kB
view hashes)
Built Distributions
Close
Hashes for klang_valley_transit-1.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 029d7131e63e6a490dcac0056f2ac62e01af44dfa2acbfa8ee8b6da153539771 |
|
MD5 | aef9e6af33cfc79d626ad61af100331a |
|
BLAKE2b-256 | 24b236e11aecca336b7368d503cf4c50fa53fe279563d3407780bf1a0e7bb35b |
Close
Hashes for klang_valley_transit-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b663a3072a9a561711b9e308485613f7581b481c2d5d13d85d0490499cc634b5 |
|
MD5 | 25f9a691bf13b514dbc8c82bc5920252 |
|
BLAKE2b-256 | 6983ab7ccb69ff19ca87211a4cef834d5df6a0bc285ecf0e64255f3814fc2ebd |
Close
Hashes for klang_valley_transit-1.0.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 020b81acb2e4f3ccc5f4e906eb7a39b1761b11f3bf729ff954a4b8500cbe40dc |
|
MD5 | ab7073562fdd4eaeb5c2a718fe1e9a8c |
|
BLAKE2b-256 | 32986ccd82b168de89c30e4007b9366608454280ec7bbbb85d817cd3fcbc76f2 |