public static int getDateDistanceToReference(VoltageLevel vl) { DateTime caseDate; String caseDateStr = vl.getProperties().getProperty(CASE_DATE); if (caseDateStr == null) { caseDate = vl.getSubstation().getNetwork().getCaseDate(); } else { caseDate = DateTime.parse(caseDateStr); } return (int) new Duration(caseDate, vl.getSubstation().getNetwork().getCaseDate()).getStandardMinutes(); }
public NetworkMetadata(Network network) { Objects.requireNonNull(network); this.id = network.getId(); this.sourceFormat = network.getSourceFormat(); this.caseDate = network.getCaseDate(); this.forecastDistance = network.getForecastDistance(); }
n.getCaseDate().toDate().getTime(), valueMapEntry.getKey().forecastDistance);
vl.getProperties().setProperty(CASE_DATE, network.getCaseDate().toString()); vl.getProperties().setProperty(FORECAST_DISTANCE, Integer.toString(network.getForecastDistance()));
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(); }
writer.writeAttribute("caseDate", n.getCaseDate().toString()); writer.writeAttribute("forecastDistance", Integer.toString(n.getForecastDistance())); writer.writeAttribute("sourceFormat", n.getSourceFormat());
valueMap.put(HistoDbMetaAttributeId.datetime, n.getCaseDate().toDate()); valueMap.put(HistoDbMetaAttributeId.daytime, n.getCaseDate().getMillisOfDay()); valueMap.put(HistoDbMetaAttributeId.month, n.getCaseDate().getMonthOfYear());
String date = String.format("%02d", n.getCaseDate().dayOfMonth().get()) + "/" + String.format("%02d", n.getCaseDate().getMonthOfYear()) + "/" + String.format("%02d", n.getCaseDate().getYearOfCentury()); String originatorName = n.getSourceFormat(); double baseMVA = defaultBaseMVA; int year = n.getCaseDate().getYear(); String season = getSeason(n.getCaseDate().getMonthOfYear()); String caseId = n.getId(); powerSystem = new CFPFPowerSystem(date, originatorName, baseMVA, year, season, caseId);
LOG.info("cgmes scenarioTime : {}", modelScenarioTime); LOG.info("cgmes modelCreated : {}", modelCreated); LOG.info("network caseDate : {}", network.getCaseDate()); LOG.info("network forecastDistance : {}", network.getForecastDistance()); Function<PropertyBag, AbstractObjectConversion> convf;