I don't understand why I'm getting this error. All I did was copy a working method and changed the variables. I also created a new edge class and a new vert class and changed all their variables.
Thanx
Daren
cityToCity.java:66: incompatible types
found : Prices
required: edgeP
for (edgeP eP : up.adjPrices)
^
public static void runPricePaths(Prices sourceP)
{
sourceP.minPrice = 0.;
PriorityQueue<Prices> pQueue = new PriorityQueue<Prices>();
pQueue.add(sourceP);
while (!pQueue.isEmpty())
{
Prices up = pQueue.poll();
// Visit each edge exiting u
for (edgeP eP : up.adjPrices)
{
Prices p = eP.targetP;
double pweight = eP.weightP;
double distanceThroughU = up.minPrice + pweight;
if (distanceThroughU < p.minPrice)
{
pQueue.remove(p);
p.minPrice = distanceThroughU ;
p.prev = up;
pQueue.add(p);
}
}
}
}
Bookmarks