com.powsybl.iidm.network.Network.getLoads()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(181)

本文整理了Java中com.powsybl.iidm.network.Network.getLoads()方法的一些代码示例,展示了Network.getLoads()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Network.getLoads()方法的具体详情如下:
包路径:com.powsybl.iidm.network.Network
类名称:Network
方法名:getLoads

Network.getLoads介绍

[英]Get all loads.
[中]把所有的东西都装上。

代码示例

代码示例来源:origin: itesla/ipst

public static ArrayList<String> getLoadsIds(Network network) {
  Objects.requireNonNull(network, "network is null");
  ArrayList<String> loadsIds = new ArrayList<String>();
  for (Load load : network.getLoads()) {
    if (load.getLoadType() != LoadType.FICTITIOUS) {
      loadsIds.add(load.getId());
    }
  }
  Collections.sort(loadsIds);
  return loadsIds;
}

代码示例来源:origin: itesla/ipst

public static ArrayList<String> getConnectedLoadsIds(Network network) {
  Objects.requireNonNull(network, "network is null");
  ArrayList<String> loadsIds = new ArrayList<String>();
  for (Load load : network.getLoads()) {
    if (isConnected(load) && load.getLoadType() != LoadType.FICTITIOUS) {
      loadsIds.add(load.getId());
    }
  }
  Collections.sort(loadsIds);
  return loadsIds;
}

代码示例来源:origin: itesla/ipst

public DataMiningFacadeParams(Network network, boolean generationSampled, boolean boundariesSampled, Interval interval) {
  gensIds = new ArrayList<>();
  if (generationSampled) {
    for (Generator gen : network.getGenerators()) {
      if (gen.getEnergySource().isIntermittent()) {
        gensIds.add(gen.getId());
      }
    }
  }
  // it seems that elements order in iidm model is not the same
  // after two subsequent network initialization from file
  Collections.sort(gensIds);
  loadsIds = new ArrayList<>();
  for (Load load : network.getLoads()) {
    loadsIds.add(load.getId());
  }
  Collections.sort(loadsIds);
  danglingLinesIds = new ArrayList<>();
  if (boundariesSampled) {
    for (DanglingLine dl : network.getDanglingLines()) {
      danglingLinesIds.add(dl.getId());
    }
  }
  Collections.sort(danglingLinesIds);
  countries = EnumSet.copyOf(network.getCountries());
  this.interval = interval;
}

代码示例来源:origin: itesla/ipst

System.out.println("Detailed Trafos = " + detailedTranformers.size());
System.out.println("Loads = " + Identifiables.sort(_network.getLoads()).size());

代码示例来源:origin: itesla/ipst

elements.append("LOAD");
elements.append(StaticData.NEW_LINE);
for (Load load : Identifiables.sort(_network.getLoads())) {
  elements.append(load.getId() + ";" + load.getName());
  elements.append(StaticData.NEW_LINE);

代码示例来源:origin: itesla/ipst

injections.add(g);
for (Load l : network.getLoads()) {
  injections.add(l);

代码示例来源:origin: itesla/ipst

public void load(Network network, HistoDbClient histoDbClient) throws IOException, InterruptedException {
  Set<HistoDbAttributeId> attributeIds = new LinkedHashSet<>();
  for (Load l : network.getLoads()) {
    if (l.getLoadType() != LoadType.FICTITIOUS) {
      attributeIds.add(new HistoDbNetworkAttributeId(l.getId(), HistoDbAttr.P));
    }
  }
  for (DanglingLine dl : network.getDanglingLines()) {
    attributeIds.add(new HistoDbNetworkAttributeId(dl.getId(), HistoDbAttr.P0));
  }
  for (Generator g : network.getGenerators()) {
    attributeIds.add(new HistoDbNetworkAttributeId(g.getId(), HistoDbAttr.P));
  }
  HistoDbStats stats = histoDbClient.queryStats(attributeIds, histoInterval, HistoDbHorizon.SN, true);
  for (Load l : network.getLoads()) {
    String id = l.getId();
    loadLimits.put(id, range(id, HistoDbAttr.P, stats));
  }
  for (DanglingLine dl : network.getDanglingLines()) {
    String id = dl.getId();
    danglingLineLimits.put(id, range(id, HistoDbAttr.P0, stats));
  }
  for (Generator g : network.getGenerators()) {
    String id = g.getId();
    generatorLimits.put(id, range(id, HistoDbAttr.P, stats));
  }
}

代码示例来源:origin: com.powsybl/powsybl-iidm-api

private static void addLoads(Network network, ConnectedPower balanceMainCC, ConnectedPower balanceOtherCC) {
  for (Load l : network.getLoads()) {
    Terminal.BusBreakerView view = l.getTerminal().getBusBreakerView();
    if (view.getBus() != null) {
      if (view.getBus().isInMainConnectedComponent()) {
        balanceMainCC.connectedLoads.add(l.getId());
        balanceMainCC.connectedLoadVolume += l.getP0();
      } else {
        balanceOtherCC.connectedLoads.add(l.getId());
        balanceOtherCC.connectedLoadVolume += l.getP0();
      }
    } else {
      if (view.getConnectableBus().isInMainConnectedComponent()) {
        balanceMainCC.disconnectedLoads.add(l.getId());
        balanceMainCC.disconnectedLoadVolume += l.getP0();
      } else {
        balanceOtherCC.disconnectedLoads.add(l.getId());
        balanceOtherCC.disconnectedLoadVolume += l.getP0();
      }
    }
  }
}

代码示例来源:origin: itesla/ipst

for (Load l : latestNetwork.getLoads()) {
  if (equipIds != null && !equipIds.contains(l.getId())) {
    continue;

代码示例来源:origin: itesla/ipst

for (Load l : Identifiables.sort(network.getLoads())) {
  if (l.getLoadType() == LoadType.FICTITIOUS) { // skip fictitious loads
    continue;

代码示例来源:origin: itesla/ipst

loadIds.add(EchUtil.getLoadId(dl));
});
Identifiables.sort(network.getLoads()).forEach(l -> loadIds.add(l.getId()));
Set<String> generatorIds = Identifiables.sort(network.getGenerators()).stream().map(Generator::getId).collect(Collectors.toSet());
Set<String> shuntIds = Identifiables.sort(network.getShunts()).stream().map(ShuntCompensator::getId).collect(Collectors.toSet());

代码示例来源:origin: itesla/ipst

private void createLoads(EsgNetwork esgNetwork) {
  for (Load l : Identifiables.sort(network.getLoads())) {
    // skip loads not in the main connected component
    if (config.isExportMainCCOnly() && !EchUtil.isInMainCc(l, config.isNoSwitch())) {
      LOGGER.warn("not in main component, skipping Load: {}", l.getId());
      continue;
    }
    ConnectionBus bus = ConnectionBus.fromTerminal(l.getTerminal(), config, fakeNodes);
    esgNetwork.addLoad(createLoad(bus, l.getId(), l.getP0(), l.getQ0()));
  }
  for (DanglingLine dl : Identifiables.sort(network.getDanglingLines())) {
    // skip dls not in the main connected component
    if (config.isExportMainCCOnly() && !EchUtil.isInMainCc(dl, config.isNoSwitch())) {
      LOGGER.warn("not in main component, skipping DanglingLine: {}", dl.getId());
      continue;
    }
    ConnectionBus bus = new ConnectionBus(true, EchUtil.getBusId(dl));
    esgNetwork.addLoad(createLoad(bus, EchUtil.getLoadId(dl), dl.getP0(), dl.getQ0()));
  }
}

代码示例来源:origin: itesla/ipst

public static void prepareBaseCase(Network network, OfflineWorkflowCreationParameters creationParameters,
                  HistoDbClient histoDbClient) throws IOException, InterruptedException {
  clearSv(network);
  // connect loads and intermittent generation and boundary lines (so everything that can be sampled)
  for (Load l : network.getLoads()) {
    l.getTerminal().connect();
  }
  if (creationParameters.isGenerationSampled()) {
    for (Generator g : network.getGenerators()) {
      if (g.getEnergySource().isIntermittent()) {
        g.getTerminal().connect();
      }
    }
  }
  if (creationParameters.isBoundariesSampled()) {
    for (DanglingLine dl : network.getDanglingLines()) {
      dl.getTerminal().connect();
    }
  }
  // TODO also override generator regulating status, phase shitfer regulating status and transformer regulating status?
  // resize voltage limits with historical data
  HistoDbUtil.fixVoltageLimits(network, histoDbClient, creationParameters.getHistoInterval());
  // temporary workaround for Elia data, missing pmin, pmax
  HistoDbUtil.fixGeneratorActiveLimits(network, histoDbClient, creationParameters.getHistoInterval());
}

代码示例来源:origin: itesla/ipst

loadsList = Identifiables.sort(_network.getLoads());
exportLoads(writerMo, modContext, modelicaModelsList, modelicaSim);
exportDanglingLoads(writerMo, modContext, modelicaModelsList, modelicaSim);
connectLoadsList = Identifiables.sort(_network.getLoads());
exportConnectLoads(writerMo, modContext, modelicaModelsList, modelicaSim);

代码示例来源:origin: itesla/ipst

private static void extractLoadsData(Network network, NetworkData networkData) {
  for (Load load : network.getLoads()) {
    networkData.addLoadData(new LoadData(load.getId(),
                       (load.getTerminal().getBusBreakerView().getBus() != null)
                           ? load.getTerminal().getBusBreakerView().getBus().getId()
                           : load.getTerminal().getBusBreakerView().getConnectableBus().getId(),
                       load.getTerminal().getBusBreakerView().getBus() != null,
                       load.getTerminal().getVoltageLevel().getNominalV(),
                       load.getTerminal().getP(),
                       load.getTerminal().getQ())
    );
  }
}

代码示例来源:origin: itesla/ipst

double boundariesP = 0.0;
double boundariesQ = 0.0;
for (Load l : network.getLoads()) {
  if (l.getP0() > 0) {
    loadPositiveP += l.getP0();

代码示例来源:origin: com.powsybl/powsybl-ampl-converter

new Column("q (MVar)"))) {
List<String> skipped = new ArrayList<>();
for (Load l : network.getLoads()) {
  Terminal t = l.getTerminal();
  Bus bus = AmplUtil.getBus(t);

代码示例来源:origin: itesla/ipst

for (Load l : network.getLoads()) {
  if (l.getTerminal().getVoltageLevel().getNominalV() <= 100 && l.getTerminal().isConnected()) { // connected HV load
    if (l.getLoadType() != LoadType.AUXILIARY) {

代码示例来源:origin: itesla/ipst

g.getTerminal().setP(Float.NaN).setQ(Float.NaN);
for (Load l : network.getLoads()) {
  l.getTerminal().setP(Float.NaN).setQ(Float.NaN);

代码示例来源:origin: com.powsybl/powsybl-cgmes-conversion

for (Load l : n.getLoads()) {
  powerFlows.add(createPowerFlowProperties(cgmes, l.getTerminal()));

相关文章