com.powsybl.metrix.mapping.TimeSeriesMappingConfig Maven / Gradle / Ivy
/*
* Copyright (c) 2020, RTE (http://www.rte-france.com)
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
* SPDX-License-Identifier: MPL-2.0
*/
package com.powsybl.metrix.mapping;
import com.powsybl.iidm.network.Bus;
import com.powsybl.iidm.network.Injection;
import com.powsybl.iidm.network.Load;
import com.powsybl.iidm.network.Network;
import com.powsybl.iidm.network.extensions.LoadDetail;
import com.powsybl.timeseries.ast.NodeCalc;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author Paul Bui-Quang {@literal }
*/
public class TimeSeriesMappingConfig {
// Distribution keys
protected final Map distributionKeys = new HashMap<>();
// Time series to equipments
protected final Map> timeSeriesToGeneratorsMapping = new LinkedHashMap<>();
protected final Map> timeSeriesToLoadsMapping = new LinkedHashMap<>();
protected final Map> timeSeriesToDanglingLinesMapping = new LinkedHashMap<>();
protected final Map> timeSeriesToHvdcLinesMapping = new LinkedHashMap<>();
protected final Map> timeSeriesToPhaseTapChangersMapping = new LinkedHashMap<>();
protected final Map> timeSeriesToBreakersMapping = new LinkedHashMap<>();
protected final Map> timeSeriesToTransformersMapping = new LinkedHashMap<>();
protected final Map> timeSeriesToLinesMapping = new LinkedHashMap<>();
protected final Map> timeSeriesToRatioTapChangersMapping = new LinkedHashMap<>();
protected final Map> timeSeriesToLccConverterStationsMapping = new LinkedHashMap<>();
protected final Map> timeSeriesToVscConverterStationsMapping = new LinkedHashMap<>();
// Equipment to time series
protected final Map> generatorToTimeSeriesMapping = new LinkedHashMap<>();
protected final Map> loadToTimeSeriesMapping = new LinkedHashMap<>();
protected final Map> danglingLineToTimeSeriesMapping = new LinkedHashMap<>();
protected final Map> hvdcLineToTimeSeriesMapping = new LinkedHashMap<>();
protected final Map> phaseTapChangerToTimeSeriesMapping = new LinkedHashMap<>();
protected final Map> breakerToTimeSeriesMapping = new LinkedHashMap<>();
protected final Map> transformerToTimeSeriesMapping = new LinkedHashMap<>();
protected final Map> lineToTimeSeriesMapping = new LinkedHashMap<>();
protected final Map> ratioTapChangerToTimeSeriesMapping = new LinkedHashMap<>();
protected final Map> lccConverterStationToTimeSeriesMapping = new LinkedHashMap<>();
protected final Map> vscConverterStationToTimeSeriesMapping = new LinkedHashMap<>();
// Equipment time series (thresholds and costs)
protected final Map> timeSeriesToEquipmentMap = new LinkedHashMap<>();
protected final Map equipmentToTimeSeriesMap = new LinkedHashMap<>();
// Equipments for which time series must be provided
protected final Set generatorTimeSeries = new HashSet<>();
protected final Set loadTimeSeries = new HashSet<>();
protected final Set danglingLineTimeSeries = new HashSet<>();
protected final Set hvdcLineTimeSeries = new HashSet<>();
protected final Set phaseTapChangerTimeSeries = new HashSet<>();
protected final Set breakerTimeSeries = new HashSet<>();
protected final Set transformerTimeSeries = new HashSet<>();
protected final Set lineTimeSeries = new HashSet<>();
protected final Set ratioTapChangerTimeSeries = new HashSet<>();
protected final Set lccConverterStationTimeSeries = new HashSet<>();
protected final Set vscConverterStationTimeSeries = new HashSet<>();
// Groups for which time series must be provided
protected final Map> generatorGroupToTimeSeriesMapping = new LinkedHashMap<>();
protected final Map> loadGroupToTimeSeriesMapping = new LinkedHashMap<>();
// Unmapped equipments
protected final Set unmappedGenerators = new HashSet<>();
protected final Set unmappedLoads = new HashSet<>();
protected final Set unmappedFixedActivePowerLoads = new HashSet<>();
protected final Set unmappedVariableActivePowerLoads = new HashSet<>();
protected final Set unmappedDanglingLines = new HashSet<>();
protected final Set unmappedHvdcLines = new HashSet<>();
protected final Set unmappedPhaseTapChangers = new HashSet<>();
protected final Set unmappedMinPGenerators = new HashSet<>();
protected final Set unmappedMaxPGenerators = new HashSet<>();
protected final Set unmappedMinPHvdcLines = new HashSet<>();
protected final Set unmappedMaxPHvdcLines = new HashSet<>();
// Equipments to ignore concerning unmapped equipments
protected final Set ignoredUnmappedGenerators = new HashSet<>();
protected final Set ignoredUnmappedLoads = new HashSet<>();
protected final Set ignoredUnmappedDanglingLines = new HashSet<>();
protected final Set ignoredUnmappedHvdcLines = new HashSet<>();
protected final Set ignoredUnmappedPhaseTapChangers = new HashSet<>();
// Disconnected equipments
protected final Set disconnectedGenerators = new HashSet<>();
protected final Set disconnectedLoads = new HashSet<>();
protected final Set disconnectedDanglingLines = new HashSet<>();
// Out of main Cc equipments
protected final Set outOfMainCcGenerators = new HashSet<>();
protected final Set outOfMainCcLoads = new HashSet<>();
protected final Set outOfMainCcDanglingLines = new HashSet<>();
// Planned outages
protected final Map> timeSeriesToPlannedOutagesMapping = new LinkedHashMap<>();
// Calculated time series
protected final Map timeSeriesNodes = new HashMap<>();
protected final Map> timeSeriesNodeTags = new HashMap<>();
// Time series used in the mapping
protected final Set mappedTimeSeriesNames = new HashSet<>();
// Time series to map with ignore limits option
protected final Set ignoreLimitsTimeSeriesNames = new HashSet<>();
@Override
public int hashCode() {
return Objects.hash(
distributionKeys,
timeSeriesToGeneratorsMapping,
timeSeriesToLoadsMapping,
timeSeriesToDanglingLinesMapping,
timeSeriesToHvdcLinesMapping,
timeSeriesToPhaseTapChangersMapping,
timeSeriesToBreakersMapping,
timeSeriesToTransformersMapping,
timeSeriesToLinesMapping,
timeSeriesToRatioTapChangersMapping,
timeSeriesToLccConverterStationsMapping,
timeSeriesToVscConverterStationsMapping,
generatorToTimeSeriesMapping,
loadToTimeSeriesMapping,
danglingLineToTimeSeriesMapping,
hvdcLineToTimeSeriesMapping,
phaseTapChangerToTimeSeriesMapping,
breakerToTimeSeriesMapping,
transformerToTimeSeriesMapping,
lineToTimeSeriesMapping,
ratioTapChangerToTimeSeriesMapping,
lccConverterStationToTimeSeriesMapping,
vscConverterStationToTimeSeriesMapping,
generatorTimeSeries,
loadTimeSeries,
danglingLineTimeSeries,
hvdcLineTimeSeries,
phaseTapChangerTimeSeries,
breakerTimeSeries,
transformerTimeSeries,
lineTimeSeries,
ratioTapChangerTimeSeries,
lccConverterStationTimeSeries,
vscConverterStationTimeSeries,
generatorGroupToTimeSeriesMapping,
loadGroupToTimeSeriesMapping,
unmappedGenerators,
unmappedLoads,
unmappedFixedActivePowerLoads,
unmappedVariableActivePowerLoads,
unmappedDanglingLines,
unmappedHvdcLines,
unmappedPhaseTapChangers,
unmappedMinPGenerators,
unmappedMaxPGenerators,
unmappedMinPHvdcLines,
unmappedMaxPHvdcLines,
ignoredUnmappedGenerators,
ignoredUnmappedLoads,
ignoredUnmappedDanglingLines,
ignoredUnmappedHvdcLines,
ignoredUnmappedPhaseTapChangers,
disconnectedGenerators,
disconnectedLoads,
disconnectedDanglingLines,
outOfMainCcGenerators,
outOfMainCcLoads,
outOfMainCcDanglingLines,
timeSeriesNodes,
timeSeriesToEquipmentMap,
equipmentToTimeSeriesMap,
mappedTimeSeriesNames,
ignoreLimitsTimeSeriesNames,
timeSeriesToPlannedOutagesMapping
);
}
@Override
public boolean equals(Object obj) {
if (obj instanceof TimeSeriesMappingConfig other) {
return distributionKeys.equals(other.getDistributionKeys())
&& timeSeriesToGeneratorsMapping.equals(other.getTimeSeriesToGeneratorsMapping())
&& timeSeriesToLoadsMapping.equals(other.getTimeSeriesToLoadsMapping())
&& timeSeriesToDanglingLinesMapping.equals(other.getTimeSeriesToDanglingLinesMapping())
&& timeSeriesToHvdcLinesMapping.equals(other.getTimeSeriesToHvdcLinesMapping())
&& timeSeriesToPhaseTapChangersMapping.equals(other.getTimeSeriesToPhaseTapChangersMapping())
&& timeSeriesToBreakersMapping.equals(other.getTimeSeriesToBreakersMapping())
&& timeSeriesToTransformersMapping.equals(other.getTimeSeriesToTransformersMapping())
&& timeSeriesToLinesMapping.equals(other.getTimeSeriesToLinesMapping())
&& timeSeriesToRatioTapChangersMapping.equals(other.getTimeSeriesToRatioTapChangersMapping())
&& timeSeriesToLccConverterStationsMapping.equals(other.getTimeSeriesToLccConverterStationsMapping())
&& timeSeriesToVscConverterStationsMapping.equals(other.getTimeSeriesToVscConverterStationsMapping())
&& generatorToTimeSeriesMapping.equals(other.getGeneratorToTimeSeriesMapping())
&& loadToTimeSeriesMapping.equals(other.getLoadToTimeSeriesMapping())
&& danglingLineToTimeSeriesMapping.equals(other.getDanglingLineToTimeSeriesMapping())
&& hvdcLineToTimeSeriesMapping.equals(other.getHvdcLineToTimeSeriesMapping())
&& phaseTapChangerToTimeSeriesMapping.equals(other.getPhaseTapChangerToTimeSeriesMapping())
&& breakerToTimeSeriesMapping.equals(other.getBreakerToTimeSeriesMapping())
&& transformerToTimeSeriesMapping.equals(other.getTransformerToTimeSeriesMapping())
&& lineToTimeSeriesMapping.equals(other.getLineToTimeSeriesMapping())
&& ratioTapChangerToTimeSeriesMapping.equals(other.getRatioTapChangerToTimeSeriesMapping())
&& lccConverterStationToTimeSeriesMapping.equals(other.getLccConverterStationToTimeSeriesMapping())
&& vscConverterStationToTimeSeriesMapping.equals(other.getVscConverterStationToTimeSeriesMapping())
&& generatorTimeSeries.equals(other.getGeneratorTimeSeries())
&& loadTimeSeries.equals(other.getLoadTimeSeries())
&& danglingLineTimeSeries.equals(other.getDanglingLineTimeSeries())
&& hvdcLineTimeSeries.equals(other.getHvdcLineTimeSeries())
&& phaseTapChangerTimeSeries.equals(other.getPhaseTapChangerTimeSeries())
&& breakerTimeSeries.equals(other.getBreakerTimeSeries())
&& transformerTimeSeries.equals(other.getTransformerTimeSeries())
&& lineTimeSeries.equals(other.getLineTimeSeries())
&& ratioTapChangerTimeSeries.equals(other.getRatioTapChangerTimeSeries())
&& lccConverterStationTimeSeries.equals(other.getLccConverterStationTimeSeries())
&& vscConverterStationTimeSeries.equals(other.getVscConverterStationTimeSeries())
&& generatorGroupToTimeSeriesMapping.equals(other.getGeneratorGroupTimeSeries())
&& loadGroupToTimeSeriesMapping.equals(other.getLoadGroupTimeSeries())
&& unmappedGenerators.equals(other.getUnmappedGenerators())
&& unmappedLoads.equals(other.getUnmappedLoads())
&& unmappedFixedActivePowerLoads.equals(other.getUnmappedFixedActivePowerLoads())
&& unmappedVariableActivePowerLoads.equals(other.getUnmappedVariableActivePowerLoads())
&& unmappedDanglingLines.equals(other.getUnmappedDanglingLines())
&& unmappedHvdcLines.equals(other.getUnmappedHvdcLines())
&& unmappedPhaseTapChangers.equals(other.getUnmappedPhaseTapChangers())
&& unmappedMinPGenerators.equals(other.getUnmappedMinPGenerators())
&& unmappedMaxPGenerators.equals(other.getUnmappedMaxPGenerators())
&& unmappedMinPHvdcLines.equals(other.getUnmappedMinPHvdcLines())
&& unmappedMaxPHvdcLines.equals(other.getUnmappedMaxPHvdcLines())
&& ignoredUnmappedGenerators.equals(other.getIgnoredUnmappedGenerators())
&& ignoredUnmappedLoads.equals(other.getIgnoredUnmappedLoads())
&& ignoredUnmappedDanglingLines.equals(other.getIgnoredUnmappedDanglingLines())
&& ignoredUnmappedHvdcLines.equals(other.getIgnoredUnmappedHvdcLines())
&& ignoredUnmappedPhaseTapChangers.equals(other.getIgnoredUnmappedPhaseTapChangers())
&& disconnectedGenerators.equals(other.getDisconnectedGenerators())
&& disconnectedLoads.equals(other.getDisconnectedLoads())
&& disconnectedDanglingLines.equals(other.getDisconnectedDanglingLines())
&& outOfMainCcGenerators.equals(other.getOutOfMainCcGenerators())
&& outOfMainCcLoads.equals(other.getOutOfMainCcLoads())
&& outOfMainCcDanglingLines.equals(other.getOutOfMainCcDanglingLines())
&& timeSeriesNodes.equals(other.getTimeSeriesNodes())
&& timeSeriesToEquipmentMap.equals(other.getTimeSeriesToEquipment())
&& equipmentToTimeSeriesMap.equals(other.getEquipmentToTimeSeries())
&& mappedTimeSeriesNames.equals(other.getMappedTimeSeriesNames())
&& ignoreLimitsTimeSeriesNames.equals(other.getIgnoreLimitsTimeSeriesNames())
&& timeSeriesToPlannedOutagesMapping.equals(other.getTimeSeriesToPlannedOutagesMapping());
}
return false;
}
private void init(Injection> connectable, Set unmappedEquipments, Set disconnectedEquipments, Set outOfMainCcEquipments) {
Bus bus = connectable.getTerminal().getBusView().getBus();
if (bus != null) {
if (bus.isInMainConnectedComponent()) {
unmappedEquipments.add(connectable.getId());
} else {
outOfMainCcEquipments.add(connectable.getId());
}
} else {
disconnectedEquipments.add(connectable.getId());
}
}
private static void init(Load load, Set unmappedFixedActivePowerLoads, Set unmappedVariableActivePowerLoads) {
Bus bus = load.getTerminal().getBusView().getBus();
if (bus != null && bus.isInMainConnectedComponent() && load.getExtension(LoadDetail.class) != null) {
unmappedFixedActivePowerLoads.add(load.getId());
unmappedVariableActivePowerLoads.add(load.getId());
}
}
protected void init(Network network) {
network.getGenerators().forEach(generator -> init(generator, unmappedGenerators, disconnectedGenerators, outOfMainCcGenerators));
network.getLoads().forEach(load -> init(load, unmappedLoads, disconnectedLoads, outOfMainCcLoads));
network.getDanglingLines().forEach(danglingLine -> init(danglingLine, unmappedDanglingLines, disconnectedDanglingLines, outOfMainCcDanglingLines));
network.getHvdcLines().forEach(hvdcLine -> unmappedHvdcLines.add(hvdcLine.getId()));
network.getTwoWindingsTransformers().forEach(transformer -> {
if (transformer.hasPhaseTapChanger()) {
unmappedPhaseTapChangers.add(transformer.getId());
}
});
network.getLoads().forEach(load -> init(load, unmappedFixedActivePowerLoads, unmappedVariableActivePowerLoads));
unmappedMinPGenerators.addAll(unmappedGenerators);
unmappedMaxPGenerators.addAll(unmappedGenerators);
unmappedMinPHvdcLines.addAll(unmappedHvdcLines);
unmappedMaxPHvdcLines.addAll(unmappedHvdcLines);
}
public TimeSeriesMappingConfig() {
}
public TimeSeriesMappingConfig(Network network) {
init(network);
}
// Distribution keys
public void setDistributionKeys(Map keys) {
distributionKeys.putAll(keys);
}
public Map getDistributionKeys() {
return distributionKeys;
}
public DistributionKey getDistributionKey(MappingKey equipmentId) {
return distributionKeys.get(equipmentId);
}
// Time series to equipments
public void setTimeSeriesToGeneratorsMapping(Map> map) {
timeSeriesToGeneratorsMapping.putAll(map);
}
public void setTimeSeriesToLoadsMapping(Map> map) {
timeSeriesToLoadsMapping.putAll(map);
}
public void setTimeSeriesToDanglingLinesMapping(Map> map) {
timeSeriesToDanglingLinesMapping.putAll(map);
}
public void setTimeSeriesToHvdcLinesMapping(Map> map) {
timeSeriesToHvdcLinesMapping.putAll(map);
}
public void setTimeSeriesToPhaseTapChangersMapping(Map> map) {
timeSeriesToPhaseTapChangersMapping.putAll(map);
}
public void setTimeSeriesToBreakersMapping(Map> map) {
timeSeriesToBreakersMapping.putAll(map);
}
public void setTimeSeriesToTransformersMapping(Map> map) {
timeSeriesToTransformersMapping.putAll(map);
}
public void setTimeSeriesToLinesMapping(Map> map) {
timeSeriesToLinesMapping.putAll(map);
}
public void setTimeSeriesToRatioTapChangersMapping(Map> map) {
timeSeriesToRatioTapChangersMapping.putAll(map);
}
public void setTimeSeriesToLccConverterStationsMapping(Map> map) {
timeSeriesToLccConverterStationsMapping.putAll(map);
}
public void setTimeSeriesToVscConverterStationsMapping(Map> map) {
timeSeriesToVscConverterStationsMapping.putAll(map);
}
public Map> getTimeSeriesToGeneratorsMapping() {
return Collections.unmodifiableMap(timeSeriesToGeneratorsMapping);
}
public Map> getTimeSeriesToLoadsMapping() {
return Collections.unmodifiableMap(timeSeriesToLoadsMapping);
}
public Map> getTimeSeriesToDanglingLinesMapping() {
return Collections.unmodifiableMap(timeSeriesToDanglingLinesMapping);
}
public Map> getTimeSeriesToHvdcLinesMapping() {
return Collections.unmodifiableMap(timeSeriesToHvdcLinesMapping);
}
public Map> getTimeSeriesToPhaseTapChangersMapping() {
return Collections.unmodifiableMap(timeSeriesToPhaseTapChangersMapping);
}
public Map> getTimeSeriesToBreakersMapping() {
return Collections.unmodifiableMap(timeSeriesToBreakersMapping);
}
public Map> getTimeSeriesToTransformersMapping() {
return Collections.unmodifiableMap(timeSeriesToTransformersMapping);
}
public Map> getTimeSeriesToLinesMapping() {
return Collections.unmodifiableMap(timeSeriesToLinesMapping);
}
public Map> getTimeSeriesToRatioTapChangersMapping() {
return Collections.unmodifiableMap(timeSeriesToRatioTapChangersMapping);
}
public Map> getTimeSeriesToLccConverterStationsMapping() {
return Collections.unmodifiableMap(timeSeriesToLccConverterStationsMapping);
}
public Map> getTimeSeriesToVscConverterStationsMapping() {
return Collections.unmodifiableMap(timeSeriesToVscConverterStationsMapping);
}
// Equipment to time series
public void setGeneratorToTimeSeriesMapping(Map> map) {
generatorToTimeSeriesMapping.putAll(map);
}
public void setLoadToTimeSeriesMapping(Map> map) {
loadToTimeSeriesMapping.putAll(map);
}
public void setDanglingLineToTimeSeriesMapping(Map> map) {
danglingLineToTimeSeriesMapping.putAll(map);
}
public void setHvdcLineToTimeSeriesMapping(Map> map) {
hvdcLineToTimeSeriesMapping.putAll(map);
}
public void setPhaseTapChangerToTimeSeriesMapping(Map> map) {
phaseTapChangerToTimeSeriesMapping.putAll(map);
}
public void setBreakerToTimeSeriesMapping(Map> map) {
breakerToTimeSeriesMapping.putAll(map);
}
public void setTransformerToTimeSeriesMapping(Map> map) {
transformerToTimeSeriesMapping.putAll(map);
}
public void setLineToTimeSeriesMapping(Map> map) {
lineToTimeSeriesMapping.putAll(map);
}
public void setRatioTapChangerToTimeSeriesMapping(Map> map) {
ratioTapChangerToTimeSeriesMapping.putAll(map);
}
public void setLccConverterStationToTimeSeriesMapping(Map> map) {
lccConverterStationToTimeSeriesMapping.putAll(map);
}
public void setVscConverterStationToTimeSeriesMapping(Map> map) {
vscConverterStationToTimeSeriesMapping.putAll(map);
}
public Map> getGeneratorToTimeSeriesMapping() {
return Collections.unmodifiableMap(generatorToTimeSeriesMapping);
}
public Map> getLoadToTimeSeriesMapping() {
return Collections.unmodifiableMap(loadToTimeSeriesMapping);
}
public Map> getDanglingLineToTimeSeriesMapping() {
return Collections.unmodifiableMap(danglingLineToTimeSeriesMapping);
}
public Map> getHvdcLineToTimeSeriesMapping() {
return Collections.unmodifiableMap(hvdcLineToTimeSeriesMapping);
}
public Map> getPhaseTapChangerToTimeSeriesMapping() {
return Collections.unmodifiableMap(phaseTapChangerToTimeSeriesMapping);
}
public Map> getBreakerToTimeSeriesMapping() {
return Collections.unmodifiableMap(breakerToTimeSeriesMapping);
}
public Map> getTransformerToTimeSeriesMapping() {
return Collections.unmodifiableMap(transformerToTimeSeriesMapping);
}
public Map> getLineToTimeSeriesMapping() {
return Collections.unmodifiableMap(lineToTimeSeriesMapping);
}
public Map> getRatioTapChangerToTimeSeriesMapping() {
return Collections.unmodifiableMap(ratioTapChangerToTimeSeriesMapping);
}
public Map> getLccConverterStationToTimeSeriesMapping() {
return Collections.unmodifiableMap(lccConverterStationToTimeSeriesMapping);
}
public Map> getVscConverterStationToTimeSeriesMapping() {
return Collections.unmodifiableMap(vscConverterStationToTimeSeriesMapping);
}
// Equipment time series (thresholds and costs)
public void setTimeSeriesToEquipment(Map> map) {
timeSeriesToEquipmentMap.putAll(map);
}
public Map> getTimeSeriesToEquipment() {
return timeSeriesToEquipmentMap;
}
public Set getEquipmentIds(String timeSeriesName) {
return timeSeriesToEquipmentMap.get(timeSeriesName);
}
public void setEquipmentToTimeSeries(Map map) {
equipmentToTimeSeriesMap.putAll(map);
}
public Map getEquipmentToTimeSeries() {
return equipmentToTimeSeriesMap;
}
public String getTimeSeriesName(MappingKey key) {
return equipmentToTimeSeriesMap.get(key);
}
public Set getEquipmentIds() {
return equipmentToTimeSeriesMap.keySet().stream().map(MappingKey::getId).collect(Collectors.toSet());
}
public void addEquipmentTimeSeries(String timeSeriesName, MappingVariable variable, String id) {
MappingKey mappingKey = new MappingKey(variable, id);
equipmentToTimeSeriesMap.computeIfPresent(mappingKey, (k, v) -> {
timeSeriesToEquipmentMap.get(v).remove(mappingKey);
return v;
});
equipmentToTimeSeriesMap.put(mappingKey, timeSeriesName);
timeSeriesToEquipmentMap.computeIfAbsent(timeSeriesName, k -> new LinkedHashSet<>()).add(mappingKey);
}
public void removeEquipmentTimeSeries(MappingVariable variable, String id) {
MappingKey mappingKey = new MappingKey(variable, id);
String timeSeriesName = equipmentToTimeSeriesMap.get(mappingKey);
equipmentToTimeSeriesMap.remove(mappingKey);
Set keys = timeSeriesToEquipmentMap.get(timeSeriesName);
keys.remove(mappingKey);
if (keys.isEmpty()) {
timeSeriesToEquipmentMap.remove(timeSeriesName);
}
}
// Equipments for which time series must be provided
public void setGeneratorTimeSeries(Set set) {
generatorTimeSeries.addAll(set);
}
public void setLoadTimeSeries(Set set) {
loadTimeSeries.addAll(set);
}
public void setDanglingLineTimeSeries(Set set) {
danglingLineTimeSeries.addAll(set);
}
public void setHvdcLineTimeSeries(Set set) {
hvdcLineTimeSeries.addAll(set);
}
public void setPhaseTapChangerTimeSeries(Set set) {
phaseTapChangerTimeSeries.addAll(set);
}
public void setBreakerTimeSeries(Set set) {
breakerTimeSeries.addAll(set);
}
public void setTransformerTimeSeries(Set set) {
transformerTimeSeries.addAll(set);
}
public void setLineTimeSeries(Set set) {
lineTimeSeries.addAll(set);
}
public void setRatioTapChangerTimeSeries(Set set) {
ratioTapChangerTimeSeries.addAll(set);
}
public void setLccConverterStationTimeSeries(Set set) {
lccConverterStationTimeSeries.addAll(set);
}
public void setVscConverterStationTimeSeries(Set set) {
vscConverterStationTimeSeries.addAll(set);
}
public Set getGeneratorTimeSeries() {
return Collections.unmodifiableSet(generatorTimeSeries);
}
public Set getLoadTimeSeries() {
return Collections.unmodifiableSet(loadTimeSeries);
}
public Set getDanglingLineTimeSeries() {
return Collections.unmodifiableSet(danglingLineTimeSeries);
}
public Set getHvdcLineTimeSeries() {
return Collections.unmodifiableSet(hvdcLineTimeSeries);
}
public Set getPhaseTapChangerTimeSeries() {
return Collections.unmodifiableSet(phaseTapChangerTimeSeries);
}
public Set getBreakerTimeSeries() {
return Collections.unmodifiableSet(breakerTimeSeries);
}
public Set getTransformerTimeSeries() {
return Collections.unmodifiableSet(transformerTimeSeries);
}
public Set getLineTimeSeries() {
return Collections.unmodifiableSet(lineTimeSeries);
}
public Set getRatioTapChangerTimeSeries() {
return Collections.unmodifiableSet(ratioTapChangerTimeSeries);
}
public Set getLccConverterStationTimeSeries() {
return Collections.unmodifiableSet(lccConverterStationTimeSeries);
}
public Set getVscConverterStationTimeSeries() {
return Collections.unmodifiableSet(vscConverterStationTimeSeries);
}
// Groups for which time series must be provided
public Map> setGeneratorGroupTimeSeries(Map> map) {
generatorGroupToTimeSeriesMapping.putAll(map);
return getGeneratorGroupTimeSeries();
}
public Map> setLoadGroupTimeSeries(Map> map) {
loadGroupToTimeSeriesMapping.putAll(map);
return getLoadGroupTimeSeries();
}
public Map> getGeneratorGroupTimeSeries() {
return generatorGroupToTimeSeriesMapping;
}
public Map> getLoadGroupTimeSeries() {
return loadGroupToTimeSeriesMapping;
}
// Unmapped equipments
public void setUnmappedGenerators(Set set) {
unmappedGenerators.addAll(set);
}
public void setUnmappedLoads(Set set) {
unmappedLoads.addAll(set);
}
public void setUnmappedFixedActivePowerLoads(Set set) {
unmappedFixedActivePowerLoads.addAll(set);
}
public void setUnmappedVariableActivePowerLoads(Set set) {
unmappedVariableActivePowerLoads.addAll(set);
}
public void setUnmappedDanglingLines(Set set) {
unmappedDanglingLines.addAll(set);
}
public void setUnmappedHvdcLines(Set set) {
unmappedHvdcLines.addAll(set);
}
public void setUnmappedPhaseTapChangers(Set set) {
unmappedPhaseTapChangers.addAll(set);
}
public void setUnmappedMinPGenerators(Set set) {
unmappedMinPGenerators.addAll(set);
}
public void setUnmappedMaxPGenerators(Set set) {
unmappedMaxPGenerators.addAll(set);
}
public void setUnmappedMinPHvdcLines(Set set) {
unmappedMinPHvdcLines.addAll(set);
}
public void setUnmappedMaxPHvdcLines(Set set) {
unmappedMaxPHvdcLines.addAll(set);
}
public Set getUnmappedGenerators() {
return Collections.unmodifiableSet(unmappedGenerators);
}
public Set getUnmappedLoads() {
return Collections.unmodifiableSet(unmappedLoads);
}
public Set getUnmappedFixedActivePowerLoads() {
return Collections.unmodifiableSet(unmappedFixedActivePowerLoads);
}
public Set getUnmappedVariableActivePowerLoads() {
return Collections.unmodifiableSet(unmappedVariableActivePowerLoads);
}
public Set getUnmappedDanglingLines() {
return Collections.unmodifiableSet(unmappedDanglingLines);
}
public Set getUnmappedHvdcLines() {
return Collections.unmodifiableSet(unmappedHvdcLines);
}
public Set getUnmappedPhaseTapChangers() {
return Collections.unmodifiableSet(unmappedPhaseTapChangers);
}
public Set getUnmappedMinPGenerators() {
return Collections.unmodifiableSet(unmappedMinPGenerators);
}
public Set getUnmappedMaxPGenerators() {
return Collections.unmodifiableSet(unmappedMaxPGenerators);
}
public Set getUnmappedMinPHvdcLines() {
return Collections.unmodifiableSet(unmappedMinPHvdcLines);
}
public Set getUnmappedMaxPHvdcLines() {
return Collections.unmodifiableSet(unmappedMaxPHvdcLines);
}
// Equipments to ignore concerning unmapped equipments
public void setIgnoredUnmappedGenerators(Set set) {
ignoredUnmappedGenerators.addAll(set);
}
public void setIgnoredUnmappedLoads(Set set) {
ignoredUnmappedLoads.addAll(set);
}
public void setIgnoredUnmappedDanglingLines(Set set) {
ignoredUnmappedDanglingLines.addAll(set);
}
public void setIgnoredUnmappedHvdcLines(Set set) {
ignoredUnmappedHvdcLines.addAll(set);
}
public void setIgnoredUnmappedPhaseTapChangers(Set set) {
ignoredUnmappedPhaseTapChangers.addAll(set);
}
public Set getIgnoredUnmappedGenerators() {
return Collections.unmodifiableSet(ignoredUnmappedGenerators);
}
public Set getIgnoredUnmappedLoads() {
return Collections.unmodifiableSet(ignoredUnmappedLoads);
}
public Set getIgnoredUnmappedDanglingLines() {
return Collections.unmodifiableSet(ignoredUnmappedDanglingLines);
}
public Set getIgnoredUnmappedHvdcLines() {
return Collections.unmodifiableSet(ignoredUnmappedHvdcLines);
}
public Set getIgnoredUnmappedPhaseTapChangers() {
return Collections.unmodifiableSet(ignoredUnmappedPhaseTapChangers);
}
// Disconnected equipments
public void setDisconnectedGenerators(Set set) {
disconnectedGenerators.addAll(set);
}
public void setDisconnectedLoads(Set set) {
disconnectedLoads.addAll(set);
}
public void setDisconnectedDanglingLines(Set set) {
disconnectedDanglingLines.addAll(set);
}
public Set getDisconnectedGenerators() {
return Collections.unmodifiableSet(disconnectedGenerators);
}
public Set getDisconnectedLoads() {
return Collections.unmodifiableSet(disconnectedLoads);
}
public Set getDisconnectedDanglingLines() {
return Collections.unmodifiableSet(disconnectedDanglingLines);
}
// Out of main Cc equipments
public void setOutOfMainCcGenerators(Set set) {
outOfMainCcGenerators.addAll(set);
}
public void setOutOfMainCcLoads(Set set) {
outOfMainCcLoads.addAll(set);
}
public void setOutOfMainCcDanglingLines(Set set) {
outOfMainCcDanglingLines.addAll(set);
}
public Set getOutOfMainCcGenerators() {
return Collections.unmodifiableSet(outOfMainCcGenerators);
}
public Set getOutOfMainCcLoads() {
return Collections.unmodifiableSet(outOfMainCcLoads);
}
public Set getOutOfMainCcDanglingLines() {
return Collections.unmodifiableSet(outOfMainCcDanglingLines);
}
// Planned outages
public void setTimeSeriesToPlannedOutagesMapping(Map> map) {
timeSeriesToPlannedOutagesMapping.putAll(map);
}
public Map> getTimeSeriesToPlannedOutagesMapping() {
return Collections.unmodifiableMap(timeSeriesToPlannedOutagesMapping);
}
// Calculated time series
public void setTimeSeriesNodes(Map nodes) {
timeSeriesNodes.putAll(nodes);
}
public Map getTimeSeriesNodes() {
return timeSeriesNodes;
}
public Set getTimeSeriesNodesKeys() {
return timeSeriesNodes.keySet();
}
public void setTimeSeriesNodeTags(Map> tags) {
timeSeriesNodeTags.putAll(tags);
}
public Map> getTimeSeriesNodeTags() {
return timeSeriesNodeTags;
}
public void addTag(String timeSeriesName, String tag, String parameter) {
if (timeSeriesNodes.containsKey(timeSeriesName)) {
timeSeriesNodeTags.computeIfAbsent(timeSeriesName, k -> new HashMap<>());
timeSeriesNodeTags.get(timeSeriesName).putIfAbsent(tag, parameter);
}
}
// Time series used in the mapping
public void setMappedTimeSeriesNames(Set timeSeriesNames) {
mappedTimeSeriesNames.addAll(timeSeriesNames);
}
public Set getMappedTimeSeriesNames() {
return Collections.unmodifiableSet(mappedTimeSeriesNames);
}
// Time series to map with ignore limits option
public void setIgnoreLimitsTimeSeriesNames(Set timeSeriesNames) {
ignoreLimitsTimeSeriesNames.addAll(timeSeriesNames);
}
public Set getIgnoreLimitsTimeSeriesNames() {
return Collections.unmodifiableSet(ignoreLimitsTimeSeriesNames);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy