Graph, Graph Algorithm, and Klang Valley Transit Routing
Project description
Klang Valley Transit
Installation
- 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 SearchFilter, LineNameEnum
# 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 fron 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-0.1.0.tar.gz
(24.9 kB
view hashes)
Built Distribution
Close
Hashes for klang_valley_transit-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e7683086d341eb54ddaf36e77a7eb8fe01503f7088a5e23eb222d6389bfd5f0 |
|
MD5 | 4beb634586d864711133fa07391f68b0 |
|
BLAKE2b-256 | a24f188b00d9a5be8c384aecbab08dd80706f46e4e345d7e18a81d0fe59f6c2f |
Close
Hashes for klang_valley_transit-0.1.0-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8268ea64c19348f1321ba9c317336deab7d05105f0cbeaa0b33ea6c57c86f49a |
|
MD5 | 48a70cf0195fdff8f557a729ffa80f2a |
|
BLAKE2b-256 | 178b9e92ed6a0fe5e84402308988f394624801bf5fe7a06ad2ebdb59a134294b |