本文整理了Java中com.powsybl.iidm.network.Load.getId()
方法的一些代码示例,展示了Load.getId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Load.getId()
方法的具体详情如下:
包路径:com.powsybl.iidm.network.Load
类名称:Load
方法名:getId
暂无
代码示例来源:origin: itesla/ipst
@Override
public String getId() {
return load.getId();
}
代码示例来源: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 ConnectLoadRecord(ConnectBusInfo busInfo, Load load) {
super(busInfo.getBus().getId(), load.getId());
}
代码示例来源:origin: itesla/ipst
/**
* Export IIDM loads to Modelica loads
* @param writerMo
* @param modContext
* @param modelicaModelsList
* @param modelicaSim
* @throws IOException
*/
private void exportLoads(Writer writerMo, ModExportContext modContext, List<String> modelicaModelsList, SimulatorInst modelicaSim) throws IOException {
if ((loadsList.size() != 0) && (!loadsList.isEmpty())) {
LOGGER.info("EXPORTING LOADS");
this.addRecord(writerMo, null);
this.addRecord(writerMo, "// LOADS");
for (Load load : loadsList) {
LOGGER.info("Exporting load " + load.getId());
ConnectBusInfo busInfo = findBus(load.getTerminal(), load.getId());
// If load's disconnected we remove it from list in order to didn't corresponding connects
LoadRecord loadRecord = ModelConverter.getModelicaRecord(load, busInfo, modContext, _ddbManager, modelicaSim, SNREF, this._sourceEngine);
this.addRecord(loadRecord, writerMo, modContext, _ddbManager, modelicaSim);
}
loadsList = null;
}
}
代码示例来源:origin: itesla/ipst
log.trace("Dumping data for: " + l.getId());
String substNodeName1 = iidm2eurostagId.get(l.getId());
String substNodeName2 = iidm2eurostagId.get(l.getTerminal().getBusBreakerView().getConnectableBus().getId());
if ((substNodeName1 != null) && (!"".equals(substNodeName1)) && (substNodeName2 != null) && (!"".equals(substNodeName2))) {
代码示例来源: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
/**
* Export IIDM loads connect to Modelica loads connect
* @param writerMo
* @param modContext
* @param modelicaModelsList
* @param modelicaSim
* @throws IOException
*/
private void exportConnectLoads(Writer writerMo, ModExportContext modContext, List<String> modelicaModelsList, SimulatorInst modelicaSim) throws IOException {
if ((connectLoadsList.size() != 0) && (!connectLoadsList.isEmpty())) {
LOGGER.info("EXPORTING CONNECT LOADS");
this.addRecord(writerMo, null);
this.addRecord(writerMo, "// Connecting LOADS");
for (Load load : connectLoadsList) {
LOGGER.info("\t Exporting load connect " + load.getId());
ConnectBusInfo busInfo = findBus(load.getTerminal(), load.getId());
if (!Double.isNaN(busInfo.getBus().getV())) {
if (busInfo.isConnected()) {
ConnectRecord loadConnect = ModelConverter.getModelicaRecord(busInfo, load, modContext, _ddbManager, modelicaSim);
this.addRecord(loadConnect, writerMo, modContext, _ddbManager, modelicaSim);
}
}
}
}
}
代码示例来源: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
@Override
public void createModelicaName(ModExportContext modContext, DDBManager ddbManager, SimulatorInst modelicaSim) {
String modelicaName = this.load != null ? parseName(this.load.getId()) : parseName(this.loadId);
modelicaName = StaticData.PREF_LOAD + modelicaName;
if (this.load != null) {
modContext.dictionary.add(this.load.getId(), modelicaName);
} else {
modContext.dictionary.add(this.loadId, modelicaName);
代码示例来源:origin: itesla/ipst
loads.add(load.getId());
loadsActivePower.add(load.getTerminal().getP());
loadsReactivePower.add(load.getTerminal().getQ());
代码示例来源: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-ampl-converter
public static void fillMapper(StringToIntMapper<AmplSubset> mapper, Network network) {
// Voltage levels
network.getVoltageLevelStream().forEach(vl -> mapper.newInt(AmplSubset.VOLTAGE_LEVEL, vl.getId()));
// Buses
getBuses(network).forEach(b -> mapper.newInt(AmplSubset.BUS, b.getId()));
// Lines
fillLines(mapper, network);
// Two windings transformers
fillTwoWindingsTransformers(mapper, network);
// Three windings transformers
fillThreeWindingsTransformers(mapper, network);
// Dangling lines
fillDanglingLines(mapper, network);
// loads
network.getLoadStream().forEach(l -> mapper.newInt(AmplSubset.LOAD, l.getId()));
// shunts
network.getShuntCompensatorStream().forEach(sc -> mapper.newInt(AmplSubset.SHUNT, sc.getId()));
// generators
network.getGeneratorStream().forEach(g -> mapper.newInt(AmplSubset.GENERATOR, g.getId()));
// static var compensators
network.getStaticVarCompensatorStream().forEach(svc -> mapper.newInt(AmplSubset.STATIC_VAR_COMPENSATOR, svc.getId()));
// HVDC lines
network.getHvdcLineStream().forEach(hvdc -> mapper.newInt(AmplSubset.HVDC_LINE, hvdc.getId()));
// HvdcConverterStations
network.getHvdcConverterStations().forEach(conv ->
mapper.newInt(conv.getHvdcType().equals(HvdcType.VSC) ? AmplSubset.VSC_CONVERTER_STATION : AmplSubset.LCC_CONVERTER_STATION, conv.getId()));
}
代码示例来源: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
Load load = network.getLoad(loadId);
if (load != null) {
LoadData loadData = new LoadData(load.getId());
Bus loadBus = load.getTerminal().getBusBreakerView().getBus();
if (loadBus == null) {
LOGGER.warn("Skipping load " + load.getId() + ": not connected/connectable to a bus");
continue;
代码示例来源:origin: itesla/ipst
LOGGER.trace(" load {} - P:{}, Q:{} -> P:{}, Q:{} ", l.getId(), oldP0, oldQ0, ls.p, ls.q);
l.setP0(ls.p).setQ0(ls.q);
l.getTerminal().setP(ls.p).setQ(ls.q);
代码示例来源:origin: itesla/ipst
hvAux.getId(), hvAux.getTerminal().getP(), hvAux.getTerminal().getQ());
break;
if (l.getLoadType() != LoadType.FICTITIOUS) {
LOGGER.warn("Load {} connected to high voltage bus, maybe this is an auxiliary and should be move to low level?",
l.getId());
lvAux.getId(), lvAuxPf.p, lvAuxPf.q);
代码示例来源:origin: itesla/ipst
public LoadRecord(Load load, ConnectBusInfo busInfo, double snref, SourceEngine sourceEngine) {
this.load = load;
this.busInfo = busInfo;
this.loadId = load.getId();
this.busConnected = busInfo.isConnected();
this.p0 = this.load.getP0();
this.q0 = this.load.getQ0();
this.busVoltage = Double.NaN;
this.busAngle = Double.NaN;
this.sourceEngine = sourceEngine;
if (this.busConnected) {
if (load.getTerminal().getBusView().getBus() != null) {
if (!Double.isNaN(load.getTerminal().getBusView().getBus().getV())) {
busVoltage = load.getTerminal().getBusView().getBus().getV() / load.getTerminal().getVoltageLevel().getNominalV();
}
if (!Double.isNaN(load.getTerminal().getBusView().getBus().getAngle())) {
busAngle = load.getTerminal().getBusView().getBus().getAngle();
}
}
addLfParameters();
} else {
LOGGER.warn("Load " + this.getModelicaName() + " disconnected.");
this.addValue(StaticData.COMMENT + " Load " + this.getModelicaName() + " disconnected.");
}
if (this.busVoltage == 0) {
LOGGER.info("Voltage 0");
}
}
代码示例来源: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
} else {
if (log.isDebugEnabled()) {
log.trace(l.getId() + " is considered as a generator auxiliary alimentation");
内容来源于网络,如有侵权,请联系作者删除!