Most algorithms have two functions:
- A normal one: like dijkstra()
Cost-version: like DijkstraCost()
I want the result of the
cost version: A fast computation of the total seconds.
In mine edges table I have the following fields:
Seconds: Time to walk
Score: More a 'road class'
Penalty: Take the escalator above the stairs (which is not faster if you stand still)
The field I use in SQL for DijkstraCost():
In many cases the costs are in seconds, but not here. So DijkstraCost() returns the real costs (in my case for every edge: score*penalty into an aggregate)
My question is :
How do I get the total sum of seconds with a
Cost-version like DijkstraCost()
My SQL looks like this:
SELECT * FROM pgr_dijkstraCost( 'SELECT id, source, target, score* penalty AS cost, score* penalty AS reverse_cost, penalty, length, geom AS the_geom FROM network' ,20,30)