Graph, Graph Algorithm, and Klang
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.0.1.tar.gz
(26.0 kB
view hashes)
Built Distribution
Close
Hashes for klang_valley_transit-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1647e6282119d04683121a03a9c9805bf0ed664d59bc87c3318d0af1e299a575 |
|
MD5 | bf102199e798ba807dc65026d5a93a33 |
|
BLAKE2b-256 | 6f95455d8091fbcdaf9f3654b6474ea012e83246cc88980fc95cfa8431f74613 |
Close
Hashes for klang_valley_transit-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ec236ffc92b863045eba868b830dff82d866c85d1e4f8610ad21cf64f999a97 |
|
MD5 | c9d0d4de325256f2f729a6d90aacd4dc |
|
BLAKE2b-256 | e79dab4b23183b07e41502ec9580b6515f536f69700c446eb6c412045a100cd1 |