public void IterationStarting(int iteration) { Fitness = 0.0f; if (ConfusionMatrix != null) { Choices = ((ITravelDemandModel)Root.MainClient).ZoneSystem.ZoneArray.CreateSquareTwinArray <float>(); } // reload all of the probabilities LocationChoice.LoadLocationChoiceCache(); ZoneSystem = RealRoot.ZoneSystem.ZoneArray; CreateIfObserved(out ObservedWork, ObservedWorkOD); CreateIfObserved(out ObservedMarket, ObservedMarketOD); CreateIfObserved(out ObservedOther, ObservedOtherOD); }
private void LoadLocationChoiceModel() { // will ignore multiple calls if it is already setup on the thread LocationChoiceModel.LoadLocationChoiceCache(); }
/// <summary> /// Load the data we only need to get once /// </summary> public void LoadOneTimeLocalData() { if (AlternativeTravelModeName != null && AlternativeTravelModeName != String.Empty) { var allModes = TashaRuntime.AllModes; bool found = false; foreach (var mode in allModes) { if (mode.ModeName == AlternativeTravelModeName) { AlternativeTravelMode = mode; found = true; break; } } if (!found) { throw new XTMFRuntimeException(this, "Unable to find the Alternative Travel Mode called " + AlternativeTravelModeName); } } LocalScheduler = this; Tasha = TashaRuntime; MinimumWorkingAge = MinWorkingAgeLocal; EpisodeSchedulingAttempts = EpisodeSchedulingAttemptsLocal; ActivityLevels = GetFullPath(ActivityLevelsLocal); SchoolMorningStart = SchoolMorningStartDateTime; SchoolMorningEnd = SchoolMorningEndDateTime; SchoolAfternoonStart = SchoolAfternoonStartDateTime; SchoolAfternoonEnd = SchoolAfternoonEndDateTime; SecondaryWorkThreshold = SecondaryWorkThresholdDateTime; StartTimeQuanta = StartTimeQuantaLocal; StartTimeQuantaInterval = (short)((24 * 60) / StartTimeQuanta); Time.OneQuantum = MinimumDurationDateTime; Time.StartOfDay = new Time() { Hours = 4 }; Time.EndOfDay = new Time() { Hours = 28 }; PercentOverlapAllowed = PercentOverlapAllowedLocal; SecondaryWorkMinStartTime = SecondaryWorkMinStartTimeDateTime; MinPrimaryWorkDurationForReturnHomeFromWork = MinPrimaryWorkDurationForReturnHomeFromWorkDateTime; MaxPrimeWorkStartTimeForReturnHomeFromWork = MaxPrimeWorkStartTimeForReturnHomeFromWorkDateTime; ReturnHomeFromWorkMaxEndTime = ReturnHomeFromWorkMaxEndTimeDateTime; FullTimeActivity = FullTimeActivityDateTime; LocationChoiceModel = LocationChoiceModelLocal; LocationChoiceModel.LoadLocationChoiceCache(); //Distributions AdultDistributionsFile = GetFullPath(AdultDistributionsFileLocal); FrequencyDistributionsFile = GetFullPath(FrequencyDistributionsFileLocal); NumberOfDistributions = NumberOfDistributionsLocal; NumberOfAdultFrequencies = NumberOfAdultFrequenciesLocal; NumberOfAdultDistributions = NumberOfAdultDistributionsLocal; MaxFrequency = MaxFrequencyLocal; Distribution.InitializeDistributions(); HouseholdExtender.TashaRuntime = TashaRuntime; // references in scheduler SchedulerHousehold.TashaRuntime = TashaRuntime; Schedule.Scheduler = this; }