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

x33g5p2x  于2022-01-30 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(108)

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

Terminal.connect介绍

[英]Try to connect the terminal.

Depends on the working variant.
[中]试着连接终端。
取决于工作变量。

代码示例

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

private void busConnection(Terminal t, int busNum) {
  if (busNum == -1) {
    t.disconnect();
  } else {
    String busId = mapper.getId(AmplSubset.BUS, busNum);
    Bus connectable = AmplUtil.getConnectableBus(t);
    if (connectable != null && connectable.getId().equals(busId)) {
      t.connect();
    }
  }
}

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

@Override
public void modify(Network network, ComputationManager computationManager) {
  Generator g = network.getGenerator(generatorId);
  if (g == null) {
    throw new PowsyblException("Generator '" + generatorId + "' not found");
  }
  g.getTerminal().connect();
}

代码示例来源:origin: com.powsybl/powsybl-action-util

private static void connectGenerator(Generator g) {
    Terminal t = g.getTerminal();
    t.connect();
    if (g.isVoltageRegulatorOn()) {
      Bus bus = t.getBusView().getBus();
      if (bus != null) {
        // set voltage setpoint to the same as other generators connected to the bus
        double targetV = bus.getGeneratorStream().findFirst().map(Generator::getTargetV).orElse(Double.NaN);
        // if no other generator connected to the bus, set voltage setpoint to network voltage
        if (Double.isNaN(targetV) && !Double.isNaN(bus.getV())) {
          g.setTargetV(bus.getV());
        }
      }
    }
    LOGGER.info("Connecting {}", g.getId());
  }
}

代码示例来源: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

private boolean removeSwitchandBus(VoltageLevel vl, Switch s, Bus toRemove, Bus toKeep) {
  List<Terminal> terminals = getTerminals(toRemove);
  if (terminals.size() <= 1) {
    terminals.forEach(t -> {
      boolean reconnect = false;
      if (t.isConnected()) {
        t.disconnect();
        reconnect = true;
      }
      t.getBusBreakerView().setConnectableBus(toKeep.getId());
      if (!s.isOpen() && reconnect) {
        t.connect();
      }
    });
    vl.getBusBreakerView().removeSwitch(s.getId());
    vl.getBusBreakerView().removeBus(toRemove.getId());
    return true;
  }
  return false;
}

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

t.connect();

相关文章