/// <summary> /// alpha * (score + 0.5*distance_to_dest)) - beta * (time_to_location + pickup_time + time_to_dest) /// </summary> /// <param name="passenger"></param> /// <returns></returns> private double SinglePassengerWeight(Player player, Passenger passenger) { // get the wiehgts from the configuration file double ALPHA = 7.0; double BETA = 1.0; double DIST_CONTSTANT = 0.5; // time to perform pickup of player int PICKUP_TIME = 130; if (passenger.Lobby != null ) { return ALPHA * (passenger.PointsDelivered + DIST_CONTSTANT * pFinder.DistanceSrcDest(passenger.Lobby.BusStop, passenger.Destination.BusStop)) - BETA * (pFinder.getTimeForPath(pFinder.computeFastestPath(player.Limo.TilePosition, passenger.Lobby.BusStop)) + PICKUP_TIME + pFinder.getTimeForPath(pFinder.computeFastestPath(passenger.Lobby.BusStop, passenger.Route[0].BusStop)) ); } else { return -1.0F; } }
/* * checks if player is finished route */ private static bool DestinationNull(Passenger passenger) { return passenger.Destination == null; }
private Point GetDestination(Passenger passenger) { throw new NotImplementedException(); }