private static List <HouseholdTemplate> GetFittingtemplates([NotNull] STHouseholdDistribution distribution, [NotNull] SettlementTemplate template) { var fittingtemplates = template.HouseholdTemplates .Where(x => x.HouseholdTemplate?.Persons.Count >= distribution.MinimumNumber && x.HouseholdTemplate?.Persons.Count <= distribution.MaximumNumber) .Select(x => x.HouseholdTemplate).ToList(); foreach (var tag in distribution.Tags) { var todelete = new List <HouseholdTemplate>(); foreach (var householdTemplate in fittingtemplates) { if (householdTemplate.TemplateTags.All(x => x.Tag != tag.Tag)) { todelete.Add(householdTemplate); } } foreach (var householdTemplate in todelete) { fittingtemplates.Remove(householdTemplate); } } if (fittingtemplates.Count == 0) { throw new DataIntegrityException("For the household with size >=" + distribution.MinimumNumber + " and <=" + distribution.MaximumNumber + " and the tags " + distribution.TagDescription + " not enough households could be found and " + "no household template was assigned."); } return(fittingtemplates); }
public static void InitializeHouseSizes([NotNull] SettlementTemplate template) { var foundSolution = false; var multiplier = 0.01; while (!foundSolution) { foreach (var housesize in template.HouseSizes) { housesize.HouseCount = (int)Math.Round(housesize.Percentage * multiplier); } var miniumHousehold = template.HouseSizes.Sum(x => x.MinimumHouseholdCount); var maximumHousehold = template.HouseSizes.Sum(x => x.MaximumHouseholdCount); if (template.DesiredHHCount >= miniumHousehold && template.DesiredHHCount <= maximumHousehold) { foundSolution = true; } else { multiplier += 0.01; } if (multiplier > 1000) { throw new DataIntegrityException( "Could not find a suitable house distribution in 1000 iterations. Please modify the house size distribution."); } } }
public SettlementTemplatePresenter([NotNull] ApplicationPresenter applicationPresenter, [NotNull] SettlementTemplateView view, [NotNull] SettlementTemplate template) : base(view, "ThisTemplate.HeaderString", template, applicationPresenter) { _hhdIntensity = new EnergyIntensityConverter.EnergyIntensityForDisplay(EnergyIntensityType.EnergyIntensive, "Energy Intensive"); _template = template; RefreshGeneratedSettlements(); RefreshGeneratedHouses(); foreach (var tag in Sim.HouseholdTags.It) { var te = new TagEntry(tag, false); AllTags.Add(te); } RefreshTraits(); }
/// <summary> /// Calculates the correct number of households for the distribution /// </summary> /// <param name="template">Template to calculate the counts for</param> private static void MakeHouseholdCounts([NotNull] SettlementTemplate template) { var totalCount = 0; foreach (var distribution in template.HouseholdDistributions) { distribution.PreciseHHCount = template.DesiredHHCount * distribution.PercentOfHouseholds; distribution.RoundedHHCount = (int)Math.Round(distribution.PreciseHHCount); totalCount += distribution.RoundedHHCount; } var hhDistributions = template.HouseholdDistributions.Where(x => x.RoundedHHCount > 0).ToList(); if (hhDistributions.Count == 0) { throw new LPGException("Not a single household distribution was found."); } if (totalCount < template.DesiredHHCount) { hhDistributions.Sort((x, y) => y.HHCountRoundingChange.CompareTo(x.HHCountRoundingChange)); var tooFewCount = template.DesiredHHCount - totalCount; for (var i = 0; i < tooFewCount; i++) { hhDistributions[i].RoundedHHCount++; } } if (totalCount > template.DesiredHHCount) { hhDistributions.Sort((x, y) => y.HHCountRoundingChange.CompareTo(x.HHCountRoundingChange)); var tooManyCount = totalCount - template.DesiredHHCount; for (var i = 0; i < tooManyCount; i++) { hhDistributions[i].RoundedHHCount--; } } var doubleCheckCount = 0; foreach (var stHouseholdDistribution in template.HouseholdDistributions) { doubleCheckCount += stHouseholdDistribution.RoundedHHCount; } if (doubleCheckCount != template.DesiredHHCount) { throw new LPGException("Wrong number of households. This is a bug. Please report."); } }
private static string GetSettlementName([NotNull] Simulator sim, [NotNull] SettlementTemplate template) { var nameoffset = 1; string GetName(int i) { var s = template.NewName + " " + i.ToString("D2", CultureInfo.CurrentCulture); return(s.Replace(" ", " ")); } while (sim.Settlements.IsNameTaken(GetName(nameoffset))) { nameoffset++; } return(GetName(nameoffset)); }
public void SettlementTemplateTest() { using (var db = new DatabaseSetup(Utili.GetCurrentMethodAndClass())) { var sts = new ObservableCollection <SettlementTemplate>(); var templates = db.LoadHouseholdTemplates(out var realDevices, out var deviceCategories, out var timeBasedProfiles, out var timeLimits, out var loadTypes, out var deviceActions, out var deviceActionGroups, out var traits); var variables = db.LoadVariables(); var energyStorages = db.LoadEnergyStorages(loadTypes, variables); var transformationDevices = db.LoadTransformationDevices(loadTypes, variables); var dateBasedProfiles = db.LoadDateBasedProfiles(); var generators = db.LoadGenerators(loadTypes, dateBasedProfiles); var allLocations = db.LoadLocations(realDevices, deviceCategories, loadTypes); var houseTypes = db.LoadHouseTypes(realDevices, deviceCategories, timeBasedProfiles, timeLimits, loadTypes, transformationDevices, energyStorages, generators, allLocations, deviceActions, deviceActionGroups, variables); var tempprofiles = db.LoadTemperatureProfiles(); var geolocs = db.LoadGeographicLocations(out _, timeLimits); var householdTags = db.LoadHouseholdTags(); db.ClearTable(SettlementTemplate.TableName); db.ClearTable(STHouseholdDistribution.TableName); db.ClearTable(STHouseholdTemplate.TableName); db.ClearTable(STHouseSize.TableName); db.ClearTable(STHouseType.TableName); db.ClearTable(STTraitLimit.TableName); var st = new SettlementTemplate("bla", null, "desc", db.ConnectionString, 100, "TestName", null, null, Guid.NewGuid().ToStrGuid()); st.SaveToDB(); st.IntID.Should().NotBe(-1); st.AddHouseholdDistribution(10, 100, 0.2, EnergyIntensityType.AsOriginal); st.AddHouseholdTemplate(templates[0]); st.AddHouseSize(10, 100, 0.2); st.AddHouseType(houseTypes[0]); st.AddTraitLimit(traits[0], 10); SettlementTemplate.LoadFromDatabase(sts, db.ConnectionString, templates, houseTypes, false, tempprofiles, geolocs, householdTags, traits); (sts.Count).Should().Be(1); (sts[0].HouseholdDistributions.Count).Should().Be(1); (sts[0].HouseholdTemplates.Count).Should().Be(1); (sts[0].HouseTypes.Count).Should().Be(1); (sts[0].HouseSizes.Count).Should().Be(1); st = sts[0]; st.DeleteHouseholdDistribution(st.HouseholdDistributions[0]); st.DeleteHouseholdTemplate(st.HouseholdTemplates[0]); st.DeleteHouseType(st.HouseTypes[0]); st.DeleteHouseSize(st.HouseSizes[0]); st.DeleteTraitLimit(st.TraitLimits[0]); sts.Clear(); SettlementTemplate.LoadFromDatabase(sts, db.ConnectionString, templates, houseTypes, false, tempprofiles, geolocs, householdTags, traits); (sts.Count).Should().Be(1); (sts[0].HouseholdDistributions.Count).Should().Be(0); (sts[0].HouseholdTemplates.Count).Should().Be(0); (sts[0].HouseTypes.Count).Should().Be(0); (sts[0].HouseSizes.Count).Should().Be(0); db.Cleanup(); } }
private static void MakeHouseholdDistribution([ItemNotNull][NotNull] ObservableCollection <ModularHousehold> modularHouseholds, [NotNull] Simulator sim, [ItemNotNull][NotNull] List <ICalcObject> resultinghouseholds, [NotNull] Random r, [NotNull] SettlementTemplate template) { foreach (var limit in template.TraitLimits) { limit.Init(template.DesiredHHCount); } var limits = new List <STTraitLimit>(template.TraitLimits); var totalHouseholds = 0; MakeHouseholdCounts(template); var templateStarts = template.HouseholdTemplates .Select(x => x.HouseholdTemplate?.Name.Substring(0, 5)).ToList(); foreach (var distribution in template.HouseholdDistributions) { var matchingCHH = modularHouseholds .Where(x => x.Persons.Count >= distribution.MinimumNumber && x.Persons.Count <= distribution.MaximumNumber && x.EnergyIntensityType == distribution.EnergyIntensity).ToList(); var toDelete = new List <ModularHousehold>(); foreach (var modularHousehold in matchingCHH) { if (!templateStarts.Any(x => modularHousehold.Name.Contains(x))) { toDelete.Add(modularHousehold); } } foreach (var modularHousehold in toDelete) { matchingCHH.Remove(modularHousehold); } foreach (var tag in distribution.Tags) { var todelete = new List <ModularHousehold>(); foreach (var household in matchingCHH) { if (household.ModularHouseholdTags.All(x => x.Tag != tag.Tag)) { todelete.Add(household); } } foreach (var modularHousehold in todelete) { matchingCHH.Remove(modularHousehold); } } GetMachtingCHH(matchingCHH, template); var matchingObjects = new List <ICalcObject>(); matchingObjects.AddRange(matchingCHH); for (var i = 0; i < distribution.RoundedHHCount; i++) { totalHouseholds++; if (matchingObjects.Count > 0) { var idx = r.Next(matchingObjects.Count); resultinghouseholds.Add(matchingObjects[idx]); matchingObjects.RemoveAt(idx); } else { var fittingtemplates = GetFittingtemplates(distribution, template); var templateidx = r.Next(fittingtemplates.Count); var ht = fittingtemplates[templateidx]; ht.Count = 1; ht.EnergyIntensityType = distribution.EnergyIntensity; Logger.Info("Creating new household with the template " + ht.Name); var newhh = ht.GenerateHouseholds(sim, false, limits); resultinghouseholds.AddRange(newhh); } } } if (totalHouseholds > template.DesiredHHCount) { throw new LPGException("Too many households generated. This is a bug. Please report!"); } if (totalHouseholds < template.DesiredHHCount) { throw new LPGException("Too few households generated. This is a bug. Please report!"); } }
private static void GetMachtingCHH([ItemNotNull][NotNull] List <ModularHousehold> matchingCHH, [NotNull] SettlementTemplate template) { var chhIdx = 0; while (chhIdx < matchingCHH.Count) { var chh = matchingCHH[chhIdx]; var remove = false; foreach (var stTraitLimit in template.TraitLimits) { if (stTraitLimit.IsPermitted(chh)) { stTraitLimit.RegisterMHH(chh); } else { remove = true; } } if (remove) { matchingCHH.Remove(chh); chhIdx--; } chhIdx++; } }
public void CreateSettlementFromPreview([NotNull] Simulator sim, [NotNull] SettlementTemplate template) { if (string.IsNullOrEmpty(template.NewName)) { Logger.Error("The new name for the settlement can not be empty."); return; } var sett = sim.Settlements.CreateNewItem(sim.ConnectionString); sett.Name = GetSettlementName(sim, template); sett.EnergyIntensityType = EnergyIntensityType.AsOriginal; sett.Source = "Generated by " + template.Name + " at " + DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString(); sett.CreationType = CreationType.TemplateCreated; if (template.TemperatureProfile != null) { sett.TemperatureProfile = template.TemperatureProfile; } if (template.GeographicLocation != null) { sett.GeographicLocation = template.GeographicLocation; } sett.SaveToDB(); var creationcount = 1; foreach (var housePreviewEntry in _previewHouseEntries) { // look if this entry already exits House newhouse = null; foreach (var house in sim.Houses.It) { var foundMissingEntry = false; if (house.HouseType != housePreviewEntry.HouseType) { continue; } var calcObjects = house.Households.Select(x => x.CalcObject).ToList(); foreach (var household in housePreviewEntry.Households) { if (!calcObjects.Contains(household)) { foundMissingEntry = true; break; } } if (!foundMissingEntry && sett.Households.All(x => x.CalcObject != house)) { newhouse = house; } } if (newhouse == null) { Logger.Info("Creating new house " + creationcount); newhouse = sim.Houses.CreateNewItem(sim.ConnectionString); newhouse.HouseType = housePreviewEntry.HouseType; newhouse.EnergyIntensityType = housePreviewEntry.EnergyIntensityType; newhouse.Name = GetHouseName("(" + sett.Name + ") House", ref creationcount, sim, housePreviewEntry.Households, housePreviewEntry.HouseType); newhouse.CreationType = CreationType.TemplateCreated; foreach (var household in housePreviewEntry.Households) { newhouse.AddHousehold(household, null, null, null); } newhouse.Source = "Generated by " + template.Name + " at " + DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString(); if (template.TemperatureProfile != null) { newhouse.TemperatureProfile = template.TemperatureProfile; } if (template.GeographicLocation != null) { newhouse.GeographicLocation = template.GeographicLocation; } newhouse.SaveToDB(); creationcount++; } sett.AddHousehold(newhouse, 1); } }
public void GenerateSettlementPreview([NotNull] Simulator sim, [NotNull] SettlementTemplate template) { if (Math.Abs(template.HousePercentage - 1) > Constants.Ebsilon) { throw new DataIntegrityException( "The house size distribution doesn't add up to 100%. It is right now " + template.HousePercentage * 100 + "%"); } if (Math.Abs(template.HouseholdPercentage - 1) > Constants.Ebsilon) { throw new DataIntegrityException( "The household size distribution doesn't add up to 100%. It is right now " + template.HouseholdPercentage * 100 + "%"); } if (template.DesiredHHCount == 0) { throw new DataIntegrityException("Can't make a settlement with 0 households."); } var resultinghouseholds = new List <ICalcObject>(); var r = new Random(); MakeHouseholdDistribution(sim.ModularHouseholds.It, sim, resultinghouseholds, r, template); // find a house distribution iteratively by increasing the numbers of each house type. InitializeHouseSizes(template); var previewEntries = new List <HouseEntry>(); // make the basic assignment var housecount = 1; foreach (var stHouseSize in template.HouseSizes) { for (var i = 0; i < stHouseSize.HouseCount; i++) { var span = stHouseSize.MaximumHouseSize - stHouseSize.MinimumHouseSize; var housesize = stHouseSize.MinimumHouseSize + r.Next(span); var he = new HouseEntry(housesize, stHouseSize.MaximumHouseSize, housecount++, EnergyIntensityType.AsOriginal); previewEntries.Add(he); for (var j = 0; j < housesize && resultinghouseholds.Count > 0; j++) { var householdIndex = r.Next(resultinghouseholds.Count); he.Households.Add(resultinghouseholds[householdIndex]); resultinghouseholds.RemoveAt(householdIndex); } } } // assign the leftovers var loopcount = 0; while (resultinghouseholds.Count > 0) { foreach (var houseEntry in previewEntries) { if (houseEntry.Households.Count <= houseEntry.MaximumHouseSize && resultinghouseholds.Count > 0) { var householdIndex = r.Next(resultinghouseholds.Count); houseEntry.Households.Add(resultinghouseholds[householdIndex]); resultinghouseholds.RemoveAt(householdIndex); } } loopcount++; if (loopcount > 300) { throw new LPGException("Could not assign all households to houses. " + resultinghouseholds.Count + " was left over. Please fix somehow."); } } var filteredEntries = previewEntries.Where(x => x.Households.Count > 0).ToList(); // assign the housetypes foreach (var houseEntry in filteredEntries) { var validHouseTypes = template.HouseTypes .Where(x => houseEntry.Households.Count >= x.HouseType?.MinimumHouseholdCount && houseEntry.Households.Count <= x.HouseType?.MaximumHouseholdCount) .Select(x => x.HouseType).ToList(); if (validHouseTypes.Count == 0) { throw new DataIntegrityException("It was not possible to find a house type for a house with " + houseEntry.Households.Count + " households. Please adjust either the house sizes, add more house types " + "or adjust the existing house types to accept a wider range of household counts."); } var idx = r.Next(validHouseTypes.Count); houseEntry.HouseType = validHouseTypes[idx]; } Logger.Get().SafeExecuteWithWait(() => _previewHouseEntries.SynchronizeWithList(filteredEntries)); }
private List <LoadingEntry> GetLoadingActions(bool ignoreMissingTables) { var actions = new List <LoadingEntry> { new LoadingEntry("Loadtypes", () => VLoadType.LoadFromDatabase(LoadTypes.MyItems, ConnectionString, ignoreMissingTables), LoadTypes), new LoadingEntry("Holidays", () => Holiday.LoadFromDatabase(Holidays.MyItems, ConnectionString, ignoreMissingTables), Holidays), new LoadingEntry("Variables", () => Variable.LoadFromDatabase(Variables.It, ConnectionString, ignoreMissingTables), Variables), new LoadingEntry("Date Based Profiles", () => DateBasedProfile.LoadFromDatabase(DateBasedProfiles.MyItems, ConnectionString, ignoreMissingTables), DateBasedProfiles), new LoadingEntry("Vacations", () => Vacation.LoadFromDatabase(Vacations.MyItems, ConnectionString, ignoreMissingTables), Vacations), new LoadingEntry("Desires", () => Desire.LoadFromDatabase(Desires.MyItems, ConnectionString, ignoreMissingTables), Desires), new LoadingEntry("Time Profiles", () => TimeBasedProfile.LoadFromDatabase(Timeprofiles.MyItems, ConnectionString, ignoreMissingTables), Timeprofiles), new LoadingEntry("Temperature Profiles", () => TemperatureProfile.LoadFromDatabase(TemperatureProfiles.MyItems, ConnectionString, ignoreMissingTables), TemperatureProfiles), new LoadingEntry("Generators", () => Generator.LoadFromDatabase(Generators.MyItems, ConnectionString, LoadTypes.MyItems, DateBasedProfiles.MyItems, ignoreMissingTables), Generators), new LoadingEntry("Energy Storages", () => EnergyStorage.LoadFromDatabase(EnergyStorages.MyItems, ConnectionString, LoadTypes.MyItems, Variables.MyItems, ignoreMissingTables), EnergyStorages), new LoadingEntry("Transformation Devices", () => TransformationDevice.LoadFromDatabase(TransformationDevices.MyItems, ConnectionString, LoadTypes.MyItems, Variables.MyItems, ignoreMissingTables), TransformationDevices), new LoadingEntry("Device Categories", () => { DeviceCategory.LoadFromDatabase(DeviceCategories.MyItems, out _dcnone, ConnectionString, RealDevices.MyItems, ignoreMissingTables); DeviceCategories.DeviceCategoryNone = _dcnone; }, DeviceCategories), new LoadingEntry("Real Devices", () => RealDevice.LoadFromDatabase(RealDevices.MyItems, DeviceCategories.MyItems, DeviceCategories.DeviceCategoryNone, ConnectionString, LoadTypes.MyItems, Timeprofiles.MyItems, ignoreMissingTables), RealDevices), new LoadingEntry("Device Action Groups", () => DeviceActionGroup.LoadFromDatabase(DeviceActionGroups.MyItems, ConnectionString, ignoreMissingTables), DeviceActionGroups), new LoadingEntry("Device Actions", () => DeviceAction.LoadFromDatabase(DeviceActions.MyItems, ConnectionString, Timeprofiles.MyItems, RealDevices.MyItems, LoadTypes.MyItems, DeviceActionGroups.MyItems, ignoreMissingTables), DeviceActions), new LoadingEntry("Device Tagging Sets", () => DeviceTaggingSet.LoadFromDatabase(DeviceTaggingSets.MyItems, ConnectionString, ignoreMissingTables, RealDevices.MyItems, LoadTypes.It), DeviceTaggingSets), new LoadingEntry("Persons", () => Person.LoadFromDatabase(Persons.MyItems, ConnectionString, ignoreMissingTables), Persons), new LoadingEntry("Locations", () => Location.LoadFromDatabase(Locations.MyItems, ConnectionString, RealDevices.MyItems, DeviceCategories.MyItems, LoadTypes.MyItems, ignoreMissingTables), Locations), new LoadingEntry("Time Limits", () => TimeLimit.LoadFromDatabase(TimeLimits.MyItems, DateBasedProfiles.MyItems, ConnectionString, ignoreMissingTables), TimeLimits), new LoadingEntry("Geographic Locations", () => GeographicLocation.LoadFromDatabase(GeographicLocations.MyItems, ConnectionString, Holidays.MyItems, TimeLimits.MyItems, ignoreMissingTables), GeographicLocations), new LoadingEntry("Subaffordances", () => SubAffordance.LoadFromDatabase(SubAffordances.MyItems, ConnectionString, Desires.MyItems, ignoreMissingTables, Locations.It, Variables.It), SubAffordances), new LoadingEntry("Affordances", () => Affordance.LoadFromDatabase(Affordances.MyItems, ConnectionString, Timeprofiles.MyItems, DeviceCategories.MyItems, RealDevices.MyItems, Desires.MyItems, SubAffordances.MyItems, LoadTypes.MyItems, TimeLimits.MyItems, DeviceActions.MyItems, DeviceActionGroups.MyItems, Locations.It, ignoreMissingTables, Variables.It), Affordances), new LoadingEntry("Affordance Tagging Sets", () => AffordanceTaggingSet.LoadFromDatabase(AffordanceTaggingSets.MyItems, ConnectionString, ignoreMissingTables, Affordances.MyItems, LoadTypes.It), AffordanceTaggingSets), new LoadingEntry("Trait Tags", () => TraitTag.LoadFromDatabase(TraitTags.MyItems, ConnectionString, ignoreMissingTables), TraitTags), new LoadingEntry("Household Traits", () => HouseholdTrait.LoadFromDatabase(HouseholdTraits.MyItems, ConnectionString, Locations.MyItems, Affordances.MyItems, RealDevices.MyItems, DeviceCategories.MyItems, Timeprofiles.MyItems, LoadTypes.MyItems, TimeLimits.MyItems, Desires.MyItems, DeviceActions.It, DeviceActionGroups.It, TraitTags.It, ignoreMissingTables, Variables.It), HouseholdTraits), new LoadingEntry("Device Selections", () => DeviceSelection.LoadFromDatabase(DeviceSelections.MyItems, ConnectionString, DeviceCategories.MyItems, RealDevices.MyItems, DeviceActions.It, DeviceActionGroups.It, ignoreMissingTables), DeviceSelections), new LoadingEntry("Household Tags", () => HouseholdTag.LoadFromDatabase(HouseholdTags.It, ConnectionString, ignoreMissingTables), HouseholdTags), new LoadingEntry("Modular Households", () => ModularHousehold.LoadFromDatabase(ModularHouseholds.MyItems, ConnectionString, HouseholdTraits.MyItems, DeviceSelections.MyItems, ignoreMissingTables, Persons.MyItems, Vacations.It, HouseholdTags.It, TraitTags.It), ModularHouseholds), new LoadingEntry("Household Templates", () => HouseholdTemplate.LoadFromDatabase(HouseholdTemplates.MyItems, ConnectionString, HouseholdTraits.MyItems, ignoreMissingTables, Persons.MyItems, TraitTags.It, Vacations.It, HouseholdTags.It, DateBasedProfiles.It), HouseholdTemplates), new LoadingEntry("Template Persons", () => TemplatePerson.LoadFromDatabase(TemplatePersons.It, ConnectionString, HouseholdTraits.It, ignoreMissingTables, ModularHouseholds.It, Persons.It), TemplatePersons), new LoadingEntry("Household Plans", () => HouseholdPlan.LoadFromDatabase(HouseholdPlans.MyItems, ConnectionString, ignoreMissingTables, Persons.MyItems, AffordanceTaggingSets.MyItems, ModularHouseholds.MyItems), HouseholdPlans), new LoadingEntry("House Types", () => HouseType.LoadFromDatabase(HouseTypes.MyItems, ConnectionString, RealDevices.MyItems, DeviceCategories.MyItems, Timeprofiles.MyItems, TimeLimits.MyItems, LoadTypes.MyItems, TransformationDevices.MyItems, EnergyStorages.MyItems, Generators.MyItems, ignoreMissingTables, Locations.MyItems, DeviceActions.It, DeviceActionGroups.It, Variables.It), HouseTypes), new LoadingEntry("Transportation Device Categories", () => TransportationDeviceCategory.LoadFromDatabase(TransportationDeviceCategories.It, ConnectionString, ignoreMissingTables), TransportationDeviceCategories), new LoadingEntry("Sites", () => Site.LoadFromDatabase(Sites.It, ConnectionString, ignoreMissingTables, Locations.It), Sites), new LoadingEntry("Transportation Devices", () => TransportationDevice.LoadFromDatabase(TransportationDevices.It, ConnectionString, ignoreMissingTables, TransportationDeviceCategories.It, LoadTypes.It), TransportationDevices), new LoadingEntry("Transportation Device Sets", () => TransportationDeviceSet.LoadFromDatabase(TransportationDeviceSets.It, ConnectionString, ignoreMissingTables, TransportationDevices.It), TransportationDeviceSets), new LoadingEntry("Travel Routes", () => TravelRoute.LoadFromDatabase(TravelRoutes.It, ConnectionString, ignoreMissingTables, TransportationDeviceCategories.It, Sites.It), TravelRoutes), new LoadingEntry("Travel Route Sets", () => TravelRouteSet.LoadFromDatabase(TravelRouteSets.It, ConnectionString, ignoreMissingTables, TravelRoutes.It), TravelRouteSets), new LoadingEntry("Charging Station Sets", () => ChargingStationSet.LoadFromDatabase(ChargingStationSets.It, ConnectionString, ignoreMissingTables, LoadTypes.It, TransportationDeviceCategories.It, Sites.It), ChargingStationSets), new LoadingEntry("Houses", () => House.LoadFromDatabase(Houses.MyItems, ConnectionString, TemperatureProfiles.MyItems, GeographicLocations.MyItems, HouseTypes.MyItems, ModularHouseholds.MyItems, ChargingStationSets.MyItems, TransportationDeviceSets.MyItems, TravelRouteSets.MyItems, ignoreMissingTables), Houses), new LoadingEntry("Settlements", () => Settlement.LoadFromDatabase(Settlements.MyItems, ConnectionString, TemperatureProfiles.MyItems, GeographicLocations.MyItems, ModularHouseholds.MyItems, Houses.MyItems, ignoreMissingTables), Settlements), new LoadingEntry("Settlement Templates", () => SettlementTemplate.LoadFromDatabase(SettlementTemplates.It, ConnectionString, HouseholdTemplates.It, HouseTypes.It, ignoreMissingTables, TemperatureProfiles.It, GeographicLocations.It, HouseholdTags.It, HouseholdTraits.It), SettlementTemplates), new LoadingEntry("Settings", () => MyGeneralConfig = GeneralConfig.LoadFromDatabase(ConnectionString, ignoreMissingTables), null), new LoadingEntry("Calculation Outcomes", () => CalculationOutcome.LoadFromDatabase(CalculationOutcomes.MyItems, ConnectionString, ignoreMissingTables), CalculationOutcomes) }; return(actions); }