public BusinessProfileProvider([NotNull] ServiceRepository services, [NotNull] ScenarioSliceParameters slice, [NotNull] SLPProvider slpProvider, [NotNull] DBDto dbDto) : base(nameof(BusinessProfileProvider), services, slice) { _slpProvider = slpProvider; _dbDto = dbDto; DevelopmentStatus.Add("Make visualisations of the sum profile of each household"); DevelopmentStatus.Add("add the original isn of each business to the business entry"); DevelopmentStatus.Add("use the correct business isn"); DevelopmentStatus.Add("add the total energy checks back in"); DevelopmentStatus.Add("connect the business to the correct hausanschluss"); _repository = new BusinessProfileOverrideRepository(services.RunningConfig); }
public HouseholdLoadProfileProvider([NotNull] ServiceRepository services, [NotNull] ScenarioSliceParameters slice, [NotNull][ItemNotNull] List <HouseCreationAndCalculationJob> districtsToBeCreated, [NotNull] SLPProvider slpProvider, [NotNull] DBDto dbDto, [NotNull] CachingLPGProfileLoader lpgloader) : base(nameof(HouseholdLoadProfileProvider), services, slice) { _housesToBeCreated = districtsToBeCreated ?? throw new ArgumentNullException(nameof(districtsToBeCreated)); _slpProvider = slpProvider; _dbDto = dbDto; _lpgloader = lpgloader; var profileCacheDb = services.SqlConnectionPreparer.GetDatabaseConnection(Stage.ProfileGeneration, slice, DatabaseCode.HouseholdProfiles); _saveableEntry = SaveableEntry <Profile> .GetSaveableEntry(profileCacheDb, SaveableEntryTableType.LPGProfile, services.Logger); _saveableEntry.MakeTableForListOfFieldsIfNotExists(true); }
public void RunTest() { Random rnd = new Random(); // ReSharper disable twice AssignNullToNotNullAttribute ServiceRepository services = new ServiceRepository(null, null, Logger, Config, rnd); var dbSrcProfiles = services.SqlConnectionPreparer.GetDatabaseConnection(Stage.Raw, Constants.PresentSlice); var vdewvals = dbSrcProfiles.Fetch <VDEWProfileValue>(); var feiertage = dbSrcProfiles.Fetch <FeiertagImport>(); SLPProvider slp = new SLPProvider(2017, vdewvals, feiertage); DBDto dbDto = new DBDto(new List <House>(), new List <Hausanschluss>(), new List <Car>(), new List <Household>(), new List <RlmProfile>()); BusinessProfileProvider bpp = new BusinessProfileProvider(services, Constants.PresentSlice, slp, dbDto); BusinessEntry be = new BusinessEntry(Guid.NewGuid().ToString(), "businessname", BusinessType.Brauerei, "housename"); HouseComponentRo hcro = new HouseComponentRo("name", "type", 1, 1, "status", "", "standort", 0); ProviderParameterDto parameeters = new ProviderParameterDto(be, "", hcro); bpp.PrepareLoadProfileIfNeeded(parameeters); var prosumer = bpp.ProvideProfile(parameeters); Assert.NotNull(prosumer); }
public void Run() { var slp = new SLPProvider(2017, null, null); //winter Assert.Equal(Season.Winter, slp.GetSeason(new DateTime(2017, 3, 20))); Assert.Equal(Season.Winter, slp.GetSeason(new DateTime(2017, 11, 1))); Assert.Equal(Season.Winter, slp.GetSeason(new DateTime(2017, 1, 1))); Assert.Equal(Season.Winter, slp.GetSeason(new DateTime(2017, 12, 31))); //sommer Assert.Equal(Season.Sommer, slp.GetSeason(new DateTime(2017, 05, 15))); Assert.Equal(Season.Sommer, slp.GetSeason(new DateTime(2017, 07, 20))); Assert.Equal(Season.Sommer, slp.GetSeason(new DateTime(2017, 09, 14))); //uebergangszeit Assert.Equal(Season.Uebergang, slp.GetSeason(new DateTime(2017, 3, 21))); Assert.Equal(Season.Uebergang, slp.GetSeason(new DateTime(2017, 4, 21))); Assert.Equal(Season.Uebergang, slp.GetSeason(new DateTime(2017, 05, 14))); Assert.Equal(Season.Uebergang, slp.GetSeason(new DateTime(2017, 9, 15))); Assert.Equal(Season.Uebergang, slp.GetSeason(new DateTime(2017, 10, 1))); Assert.Equal(Season.Uebergang, slp.GetSeason(new DateTime(2017, 10, 31))); }