Beispiel #1
0
        public int GetRandomFeasibleMinute(ITripWrapper trip, HTripTime time)
        {
            if (trip == null || time == null)
            {
                throw new ArgumentNullException("trip time");
            }

            ITimeWindow timeWindow    = trip.Tour.ParentTour == null ? trip.Tour.PersonDay.TimeWindow : trip.Tour.ParentTour.TimeWindow;
            int         departureTime = timeWindow.GetAvailableMinute(trip.Household.RandomUtility, time.EarliestFeasibleDepatureTime, time.LatestFeasibleDepartureTime);

            //if (departureTime == Constants.DEFAULT_VALUE) {
            //    throw new InvalidDepartureTimeException();
            //}

            return(departureTime);
        }
Beispiel #2
0
        public int GetDepartureTime(ITripWrapper trip)
        {
            if (trip == null)
            {
                throw new ArgumentNullException("trip");
            }

            ITimeWindow timeWindow    = trip.Tour.ParentTour == null ? trip.Tour.PersonDay.TimeWindow : trip.Tour.ParentTour.TimeWindow;
            int         departureTime = timeWindow.GetAvailableMinute(trip.Household.RandomUtility, DeparturePeriod.Start, DeparturePeriod.End);

            //if (departureTime == Constants.DEFAULT_VALUE) {
            //    throw new InvalidDepartureTimeException();
            //}

            return(departureTime);
        }
Beispiel #3
0
        public int GetRandomDepartureTime(IHouseholdDayWrapper householdDay, ITourWrapper tour)
        {
            if (tour == null)
            {
                throw new ArgumentNullException("trip");
            }

            ITimeWindow timeWindow = tour.GetRelevantTimeWindow(householdDay);

            int departureTime = timeWindow.GetAvailableMinute(tour.Household.RandomUtility, DeparturePeriod.Start, DeparturePeriod.End);

            //if (departureTime == Constants.DEFAULT_VALUE) {
            //    throw new InvalidDepartureTimeException();
            //}

            return(departureTime);
        }