本文整理了Java中com.powsybl.iidm.network.Network.getVoltageLevels()
方法的一些代码示例,展示了Network.getVoltageLevels()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Network.getVoltageLevels()
方法的具体详情如下:
包路径:com.powsybl.iidm.network.Network
类名称:Network
方法名:getVoltageLevels
[英]Get all substation voltage levels.
[中]获取所有变电站电压水平。
代码示例来源:origin: itesla/ipst
public static EurostagFakeNodes build(Network network, EurostagEchExportConfig config) {
Objects.requireNonNull(network);
Objects.requireNonNull(config);
BiMap<String, String> fakeNodesMap = HashBiMap.create(new HashMap<>());
AtomicLongMap<String> countUsesMap = AtomicLongMap.create();
//adds 2 default fake nodes
fakeNodesMap.put(EchUtil.FAKE_NODE_NAME1, EchUtil.FAKE_NODE_NAME1);
countUsesMap.getAndIncrement(EchUtil.FAKE_NODE_NAME1);
fakeNodesMap.put(EchUtil.FAKE_NODE_NAME2, EchUtil.FAKE_NODE_NAME2);
countUsesMap.getAndIncrement(EchUtil.FAKE_NODE_NAME2);
Identifiables.sort(network.getVoltageLevels()).stream().map(VoltageLevel::getId).forEach(vlId ->
fakeNodesMap.put(vlId, newEsgId(fakeNodesMap, vlId)));
return new EurostagFakeNodes(fakeNodesMap, countUsesMap, network);
}
代码示例来源:origin: itesla/ipst
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();
}
代码示例来源:origin: itesla/ipst
public static Set<Zone> getZone(ActionsContingencies actionContingencies, Network network) {
Set<Zone> zones = new HashSet<Zone>();
Zones xmlZones = actionContingencies.getZones();
Iterable<VoltageLevel> voltageLevels = network.getVoltageLevels();
for (VoltageLevel vl: voltageLevels) {
String networkVoltagelevelId = vl.getId();
for (Zone z :xmlZones.getZone()) {
if (z.getVoltageLevels() != null) {
for (eu.itesla_project.iidm.actions_contingencies.xml.mapping.VoltageLevel zvl : z.getVoltageLevels().getVoltageLevel()) {
if (networkVoltagelevelId.equals(zvl.getID())) {
zones.add(z);
break;
}
}
}
}
}
return zones;
}
代码示例来源:origin: itesla/ipst
/**
* Automatically find the best slack bus list
*/
public static Bus selectSlackbus(Network network, EurostagEchExportConfig config) {
// avoid buses connected to a switch because of Eurostag LF crash (LU factorisation issue)
Set<String> busesToAvoid = new HashSet<>();
for (VoltageLevel vl : network.getVoltageLevels()) {
for (Switch s : EchUtil.getSwitches(vl, config)) {
busesToAvoid.add(EchUtil.getBus1(vl, s.getId(), config).getId());
busesToAvoid.add(EchUtil.getBus2(vl, s.getId(), config).getId());
}
}
Bus bus = selectSlackbusCriteria1(network, config, busesToAvoid);
if (bus == null) {
bus = selectSlackbusCriteria1(network, config, Collections.emptySet());
}
return bus;
}
代码示例来源:origin: itesla/ipst
for (VoltageLevel vl : network.getVoltageLevels()) {
vl.getProperties().setProperty(CASE_DATE, network.getCaseDate().toString());
vl.getProperties().setProperty(FORECAST_DISTANCE, Integer.toString(network.getForecastDistance()));
代码示例来源:origin: itesla/ipst
for (VoltageLevel station : network.getVoltageLevels()) {
if (station.getName().equals(connectingStation)) {
代码示例来源:origin: itesla/ipst
public void build(Network network) {
// build a unique topology for each of the substation reflecting history
Map<String, UniqueTopology> uniqueTopos = build();
// remove from the reference network equipments not in the history, i.e always disconnected in the history
cleanNetwork(network, uniqueTopos);
// apply unique topology to the network
for (VoltageLevel vl : network.getVoltageLevels()) {
UniqueTopology uniqueTopo = uniqueTopos.get(vl.getId());
// uniqueTopo.print(System.out);
uniqueTopo.apply(network);
}
Networks.printBalanceSummary("unique topo", network, LOGGER);
new UniqueTopologyChecker(network, topoHisto, uniqueTopos, dict).check();
}
代码示例来源:origin: itesla/ipst
public static void fixVoltageLimits(Network network, HistoDbClient histoDbClient, Interval interval) throws IOException, InterruptedException {
for (VoltageLevel vl : network.getVoltageLevels()) {
attributeIds.add(createVoltageAttributeId(vl));
for (VoltageLevel vl : network.getVoltageLevels()) {
HistoDbNetworkAttributeId attributeId = createVoltageAttributeId(vl);
代码示例来源:origin: itesla/ipst
for (VoltageLevel vl : Lists.newArrayList(network.getVoltageLevels())) {
if (!uniqueTopos.containsKey(vl.getId())) {
substationsRemoved.add(vl.getId());
代码示例来源:origin: itesla/ipst
for (VoltageLevel vl : network.getVoltageLevels()) {
for (Switch s : EchUtil.getSwitches(vl, config)) {
Bus bus1 = EchUtil.getBus1(vl, s.getId(), config);
代码示例来源:origin: itesla/ipst
for (VoltageLevel station : network.getVoltageLevels()) {
if (station.getName().equals(pilotStation)) {
代码示例来源:origin: itesla/ipst
for (VoltageLevel station : network.getVoltageLevels()) {
if (station.getName().equals(pilotPoint)) {
代码示例来源:origin: itesla/ipst
try (HistoDbClient histoDbClient = config.getHistoDbClientFactoryClass().newInstance().create()) {
Set<HistoDbAttributeId> attrIds = new LinkedHashSet<>();
for (VoltageLevel vl : network.getVoltageLevels()) {
attrIds.add(new HistoDbNetworkAttributeId(vl.getId(), HistoDbAttr.V));
for (VoltageLevel vl : network.getVoltageLevels()) {
HistoDbNetworkAttributeId attrId = new HistoDbNetworkAttributeId(vl.getId(), HistoDbAttr.V);
double min = stats.getValue(HistoDbStatsType.MIN, attrId, Float.NaN) / vl.getNominalV();
代码示例来源:origin: itesla/ipst
for (VoltageLevel vl : latestNetwork.getVoltageLevels()) {
if (equipIds != null && !equipIds.contains(vl.getId())) {
continue;
代码示例来源:origin: itesla/ipst
for (VoltageLevel vl : Identifiables.sort(network.getVoltageLevels())) {
for (Switch sw : Identifiables.sort(EchUtil.getSwitches(vl, config))) {
Bus bus1 = EchUtil.getBus1(vl, sw.getId(), config);
代码示例来源:origin: itesla/ipst
private void createCouplingDevices(EsgNetwork esgNetwork) {
for (VoltageLevel vl : Identifiables.sort(network.getVoltageLevels())) {
for (Switch sw : Identifiables.sort(EchUtil.getSwitches(vl, config))) {
Bus bus1 = EchUtil.getBus1(vl, sw.getId(), config);
Bus bus2 = EchUtil.getBus2(vl, sw.getId(), config);
//do not export the Switch if bus1==bus2
if (EchUtil.isSameBus(bus1, bus2)) {
LOGGER.warn("skipping Switch: {}; bus1 is equal to bus2: {}", sw.getId(), bus1 != null ? bus1.getId() : bus1);
continue;
}
// skip switches not in the main connected component
if (config.isExportMainCCOnly() && (!EchUtil.isInMainCc(bus1) || !EchUtil.isInMainCc(bus2))) {
LOGGER.warn("not in main component, skipping Switch: {} {} {}", bus1.getId(), bus2.getId(), sw.getId());
continue;
}
esgNetwork.addCouplingDevice(new EsgCouplingDevice(new EsgBranchName(new Esg8charName(dictionary.getEsgId(bus1.getId())),
new Esg8charName(dictionary.getEsgId(bus2.getId())),
parallelIndexes.getParallelIndex(sw.getId())),
sw.isOpen() ? EsgCouplingDevice.ConnectionStatus.OPEN : EsgCouplingDevice.ConnectionStatus.CLOSED));
}
}
}
代码示例来源:origin: itesla/ipst
connectCouplingList = Identifiables.sort(_network.getVoltageLevels());
exportConnectCouplingDevices(writerMo, modContext, modelicaModelsList, modelicaSim);
代码示例来源:origin: com.powsybl/powsybl-ampl-converter
new Column("id"),
new Column(DESCRIPTION))) {
for (VoltageLevel vl : network.getVoltageLevels()) {
int num = mapper.getInt(AmplSubset.VOLTAGE_LEVEL, vl.getId());
double nomV = vl.getNominalV();
内容来源于网络,如有侵权,请联系作者删除!