This module aims to assign a priority or order to the components of a network for planning purpose. This is done by converting the inputs into a directed acyclic graph and ordering the nodes by the cumulative "downstream" values defined by the input parameters.
See NetworkPlanner.R for similar work, but in R.
Clone this repository and cd into the directory
Setup a virtual environment (example here uses anaconda)
conda create -n sequencer --file requirements.txt python=2.7
source activate sequencer
The repo contains a sample dataset in the data folder.
You can run a test against it via the command line
./run_sequencer.py --metrics_path data/sumaila/input/metrics-local.csv --network_path data/sumaila/input/networks-proposed.shp --demand_field "Demand...Projected.nodal.demand.per.year" --prioritize_field "Population" --output_path output
Take a look at run_sequencer.py
for an example of how to use the modules from Python
The main output is a table with the original metrics csv data (i.e. the nodes) plus "Sequence" fields as shown below
Out[12]:
Sequence..Decision.metric | Sequence..Downstream.demand.sum.kwh | Sequence..Downstream.distance.sum.m | Sequence..Root.vertex.id | Sequence..Upstream.id | Sequence..Upstream.segment.distance.m | Sequence..Vertex.id | |
---|---|---|---|---|---|---|---|
Sequence..Far.sighted.sequence | |||||||
1 | 2780868.271316 | 28013000 | 10.073472 | 27 | 27 | 10.073472 | 25 |
2 | 7010.936648 | 44720000 | 6378.605633 | 505 | 505 | 16.171168 | 391 |
3 | 960.761193 | 1217000 | 1266.703952 | 392 | 392 | 537.213092 | 342 |
4 | 452.370301 | 330000 | 729.490860 | 392 | 342 | 155.021075 | 304 |
5 | 464.776402 | 267000 | 574.469785 | 392 | 304 | 574.469785 | 212 |
... | ... | ... | ... | ... | ... | ... | ... |
519 | 15.164609 | 165000 | 10880.596829 | 424 | 210 | 6113.945502 | 228 |
520 | 21.818252 | 104000 | 4766.651327 | 424 | 228 | 4766.651327 | 421 |
521 | 13.653252 | 219000 | 16040.134490 | 424 | 210 | 3982.017803 | 486 |
522 | 12.025095 | 145000 | 12058.116687 | 424 | 486 | 6212.158996 | 325 |
523 | 11.460911 | 67000 | 5845.957691 | 424 | 325 | 5845.957691 | 42 |
. . .