Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while (true)
- {
- //hugo construction
- List<Pair> tempHugoNodes = new ArrayList<Pair>();
- for (int i=0;i<hugoNodes.size();i++)
- {
- Point tempPoint = hugoPoints[hugoNodes.get(i).GetPoint()];
- for (int j=0;j<tempPoint.GetPN();j++)
- {
- Path tempPath = tempPoint.GetPath(j);
- int price = hugoNodes.get(i).GetPrice()+tempPath.GetPrice()+points[tempPath.GetFinishPoint()].GetOvernightPrice();
- if (price<leastPrice.GetPrice())
- {
- tempHugoNodes.add(new Pair(tempPath.GetFinishPoint(), price));
- }
- }
- }
- hugoNodes.clear();
- hugoNodes = new ArrayList<Pair>(tempHugoNodes);
- //end
- //quido construction
- List<Pair> tempQuidoNodes = new ArrayList<Pair>();
- for (int i=0;i<quidoNodes.size();i++)
- {
- Point tempPoint = quidoPoints[quidoNodes.get(i).GetPoint()];
- for (int j=0;j<tempPoint.GetPN();j++)
- {
- Path tempPath = tempPoint.GetPath(j);
- int price = hugoNodes.get(i).GetPrice()+tempPath.GetPrice()+points[tempPath.GetFinishPoint()].GetOvernightPrice();
- if (price<leastPrice.GetPrice())
- {
- tempHugoNodes.add(new Pair(tempPath.GetFinishPoint(), price));
- }
- }
- }
- quidoNodes.clear();
- quidoNodes = new ArrayList<Pair>(tempQuidoNodes);
- //end
- for (int i=0;i<hugoNodes.size();i++)
- {
- for (int j=0;j<quidoNodes.size();j++)
- {
- if (hugoNodes.get(i).GetPoint()==quidoNodes.get(j).GetPoint())
- {
- int price = hugoNodes.get(i).GetPrice()+quidoNodes.get(j).GetPrice() - 2*(points[hugoNodes.get(i).GetPoint()].GetOvernightPrice());
- if (price<leastPrice.GetPrice())
- {
- leastPrice = new Pair (hugoNodes.get(i).GetPoint(), price);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement