Forum #18 - Topic #113 - Message List
Hello,
I have two questions about the way to use shooting star in some circumstances.
Suppose you have a checkpoint consisting of 4 edges ("a","b","c","d") intersecting at the (same) vertex 0 as illustrated below:
b
|
--c---0---d--
|
a
The traffic flow through "a" and "b" is more important than through edges "c" and "d". (Every edge can be visited in both directions.)
At the vertex 0, there is a traffic light with an average waiting time of 2 minutes for edges "c" and "d" and of 1 minute for edges "a" and "b". From edge "a" you cannot drive to edge "c" and from edge "b" you cannot drive to edge "d".
In this case, we have:
1°) cost(a,c) = cost(b,d) = infinity
2°) cost(a,d) = cost(a,b) = 1
3°) cost(b,c) = cost(b,a) = 1
4°) cost(c,a) = cost(c,b) = cost(c,d) = 2
5°) cost(d,a) = cost(d,b) = cost(d,c) = 2
My two questions are:
==============
1°) The "rule" and "to_cost" columns for edge "c" would be:
gid | to_cost | rule
---------------------------
c | 2 | a,b,d
Is that correct ?
2°) What would be the "rule" and "to_cost" values for edge "a", since there are two different costs: cost(a,c)<>cost(a,d) ?
Many thanks in advance for your answer!
-
Message #421
1) No, it is not. You rule means that the path a->b->d->c has cost 2.
For edge c you need to create those rules:
gid | to_cost | rule
---------------------
c| Inf | a
gid | to_cost | rule
---------------------
c| 1 | b
gid | to_cost | rule
---------------------
c| 2 | d
In your case it is better to create one more table with restrictions and then link it to the main edges table. The query must be ordered by gid.
2) Rule is assigned to the final edge. Thus, cost(a,c) should be assigned to the edge c and cost(a,d) - to d.
anton02/06/08 10:18:07

