/** * Factory of the class * * @param id * id of the class ACLineSegment to create * @return the class created */ public static ACLineSegment create(final String id) { ACLineSegment newACLineSegment = new ACLineSegment(); newACLineSegment.setId(id); return newACLineSegment; }
/** * Utility to "clear" the content of a class when a subset is invalidated * * @param subset subset to clean */ @Override public void clearContent(Subset subset) { // First of all, we clear the associations: this.clearAssociations(subset); switch (subset) { default: // nothing to clear } }
/** * Copy constructor * The associations with other objects are not copied * * @param ACLineSegment * the reference to the class to copy * @return the class constructed */ private ACLineSegment(final ACLineSegment otherACLineSegment) { // TODO : check exception safe this.copyBase(otherACLineSegment); }
if (l2.getTerminals().get(0).getTopologicalNode() == xn) { t2 = l2.getTerminals().get(1); tn2 = t2.getTopologicalNode(); } else if (l2.getTerminals().get(1).getTopologicalNode() == xn) { t2 = l2.getTerminals().get(0); tn2 = t2.getTopologicalNode(); } else { .line1().setId(namingStrategy.getId(l1)) .setName(namingStrategy.getName(l1)) .setR(l1.getR()) .setX(l1.getX()) .setG1(l1.getGch() / 2) .setG2(l1.getGch() / 2) .setB1(l1.getBch() / 2) .setB2(l1.getBch() / 2) .setXnodeP(0) .setXnodeQ(0) .line2().setId(namingStrategy.getId(l2)) .setName(namingStrategy.getName(l2)) .setR(l2.getR()) .setX(l2.getX()) .setG1(l2.getGch() / 2) .setG2(l2.getGch() / 2) .setB1(l2.getBch() / 2) .setB2(l2.getBch() / 2) .setXnodeP(0) .setXnodeQ(0)
xmlsw.writeAttribute(CIMModel.rdfURI, "ID", getId()); errorMessage.append("ACLineSegment "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); writeClass(xmlsw); super.write(xmlsw, false); errorMessage.append("ACLineSegment "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); try { xmlsw.writeStartElement(CIMURI.CIMURI, "ACLineSegment"); xmlsw.writeAttribute(CIMModel.rdfURI, "ID", getId()); errorMessage.append("ACLineSegment "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); errorMessage.append(" in the subset "); errorMessage.append("Equipment"); writeClass(xmlsw); super.write(xmlsw, subset, false);
ACLineSegment newACLineSegment = new ACLineSegment(); ACLineSegment value = entry.getValue(); newACLineSegment = value; this.id_ACLineSegment.put(newACLineSegment.getId(), newACLineSegment); this.allInstances.put(newACLineSegment.getId(), newACLineSegment); newMap.put(newACLineSegment.getId(), newACLineSegment); this.subsetsInstances.put( .put(newACLineSegment.getId(), newACLineSegment);
message.append(getMessageForConsistency(this.minBitsets.get(subset)));
/** * Utility returning a copy of the "base" of this instance * This utility does not copy the associations with other instances * * @return a clone of this instance */ public ACLineSegment clone() { ACLineSegment newInstance = new ACLineSegment(this); ACLineSegment newInstanceSP = newInstance; return newInstanceSP; }
/** * Utility in charge of creating the message when the class is not * consistent within a specific context * * @param minBitset * bitset describing which CIM attributes of this class have * to be set so that it is consistent within a * specific subset context * @return the message explaining what is not consistent */ private String getMessageForConsistency(final BitSet minBitset) { StringBuilder message = new StringBuilder( "Instance of \"ACLineSegment\" of id \""); message.append(this.getId()); message.append("\" is not consistent in this context:\n"); /* * XOR and then AND * The result is : * "1" : has not been set and need to be * "0" : has been set or is not mandatory */ BitSet isNotSet = new BitSet(minBitset.length()); isNotSet.or(minBitset); // we create a copy of minBitset isNotSet.xor(this.currentBitset); isNotSet.and(minBitset); return message.toString(); }
private void createLines(Network network, Set<String> noOperationalLimitInOperationalLimitSet) { for (cim1.model.ACLineSegment l : cimModel.getId_ACLineSegment().values()) { cim1.model.Terminal t1 = l.getTerminals().get(0); cim1.model.Terminal t2 = l.getTerminals().get(1); cim1.model.TopologicalNode tn1 = t1.getTopologicalNode(); cim1.model.TopologicalNode tn2 = t2.getTopologicalNode();
private void createLine(Network network, cim1.model.ACLineSegment l, Set<String> noOperationalLimitInOperationalLimitSet) { cim1.model.Terminal t1 = l.getTerminals().get(0); cim1.model.Terminal t2 = l.getTerminals().get(1); cim1.model.SvPowerFlow svpf1 = t1.getSvPowerFlow(); cim1.model.SvPowerFlow svpf2 = t2.getSvPowerFlow(); float r = l.getR(); float x = l.getX(); float b = l.getBch(); float g = l.getGch(); if (LOGGER.isTraceEnabled()) { LOGGER.trace("Create line {} between bus {} and bus {}",
message.append(getMessageForConsistency(this.minBitset));