- int curx = inter.x;
- int cury = inter.y;
-
- int newx = conInter.x;
- int newy = conInter.y;
- for (hash_map<string, Player>::const_iterator player = _players.begin();
- player != _players.end(); ++player){
- if (player->first == _name)
- continue;
-
- int px = _intersections[player->second.location].x;
- int py = _intersections[player->second.location].y;
-
- double dist1 = sqrt(pow((curx-px),2.0)+pow((cury-py),2.0));
- double dist2 = sqrt(pow((newx-px),2.0)+pow((newy-py),2.0));
- /*cerr << "Original distance: " << dist1 << endl;
- cerr << "New distance: " << dist2 << endl;
- */
-
-
- if (dist2 < 50 && dist2 < dist1)
- goodness *= 0.95;
-
- if (player->second.type == cop_foot && dist2 <= 3)
- goodness /= 100;
- else if (player->second.type == cop_car && dist2 <= 2)
- goodness /= 100;
-
-
+ if (goodness == 0)
+ continue;
+ vector<double> banks;
+ for(hash_map<string,int>::const_iterator bank = _banks.begin();
+ bank != _banks.end(); ++bank){
+ //cerr << "Handling bank at: " << bank->first << endl;
+ if (bank->second > 0){
+ list<string> l = shortestPath(street->first, _type, SimpleSPGoal(bank->first));
+ if (l.size() < 1)
+ continue;
+ list<string>::iterator i = l.begin();
+ //++i;
+ banks.push_back(bank->second/(pow(l.size(),2.0)));
+ }