public static Path createTopoCacheDir(Network network, Interval histoInterval, double correlationThreshold, double probabilityThreshold) throws IOException { return PlatformConfig.defaultCacheManager().newCacheEntry("topo") .withKey(histoInterval.toString()) .withKey(Double.toString(correlationThreshold)) .withKey(Double.toString(probabilityThreshold)) .withKeys(StreamSupport.stream(network.getVoltageLevels().spliterator(), false) .map(Identifiable::getId) .sorted() .collect(Collectors.toList())) .build() .create(); }
private CacheManager.CacheEntry getCacheEntry(String url) throws IOException { return PlatformConfig.defaultCacheManager().newCacheEntry(cacheName) .withKey(url) .build(); }
private CacheManager.CacheEntry getInjectionsCacheDir(Interval interval, List<StochasticInjection> networkInjections) { return PlatformConfig.defaultCacheManager().newCacheEntry("uncertainties") .withKey(interval.toString()) .withKeys(networkInjections.stream().map(StochasticInjection::getId).collect(Collectors.toList())) .withKey(SCRIPTS.getVersion()) .withKey(Float.toString(config.getPrctRisk())) .build(); }
boolean isFiltered = DdExportConfig.load().getGensPQfilter(); CacheManager.CacheEntry cacheEntry = PlatformConfig.defaultCacheManager().newCacheEntry("ddb") .withKey(fileName) .withKeys(StreamSupport.stream(filterGenerators(network, isFiltered).spliterator(), false)
private Path getCacheDir(DataMiningFacadeParams dmParams) throws IOException { return PlatformConfig.defaultCacheManager().newCacheEntry(WP41_CACHEDIR_NAME) .withKey(Double.toString(config.getIr())) .withKey(Integer.toString(config.getPar_k())) .withKey(Double.toString(config.getTflag())) .withKey(dmParams.getInterval().toString()) .withKeys(dmParams.getCountries().stream().map(Object::toString).collect(Collectors.toList())) .withKeys(dmParams.getGensIds()) .withKeys(dmParams.getLoadsIds()) .withKeys(dmParams.getDanglingLinesIds()) .build() .create(); }
private CacheManager.CacheEntry getMonthlyCacheDir(Interval interval) { return PlatformConfig.defaultCacheManager().newCacheEntry("uncertainties") .withKey(interval.toString()) .withKey("" + network.getCaseDate().year().get() + network.getCaseDate().monthOfYear().get()) .withKey(SCRIPTS.getVersion()) .withKey(Float.toString(config.getPrctRisk())) .build(); }