/** * 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 CurveData * the reference to the class to copy * @return the class constructed */ private CurveData(final CurveData otherCurveData) { // TODO : check exception safe this.copyBase(otherCurveData); }
newy1value = otherCurveData.getY1value(); this.setY1value(newy1value); newxvalue = otherCurveData.getXvalue(); this.setXvalue(newxvalue); newy2value = otherCurveData.getY2value(); this.setY2value(newy2value); Curve curveScheduleAssociation = otherCurveData.getCurveSchedule();
xmlsw.writeCharacters(String.valueOf(getY1value())); xmlsw.writeEndElement(); errorMessage.append("CurveData "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); xmlsw.writeCharacters(String.valueOf(getXvalue())); xmlsw.writeEndElement(); errorMessage.append("CurveData "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); xmlsw.writeCharacters(String.valueOf(getY2value())); xmlsw.writeEndElement(); errorMessage.append("CurveData "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); errorMessage.append("CurveData "); errorMessage.append("which ID has been initialized to : ");
Map<Float, cim1.model.CurveData> cdMap = new HashMap<>(); for (cim1.model.CurveData cd : sm.initialReactiveCapabilityCurve.getCurveScheduleDatas()) { if (cdMap.containsKey(cd.getXvalue())) { LOGGER.warn("Duplicated data for x value {} of {} reactive capability curve", cd.getXvalue(), generator.getId()); continue; if (cd.getXvalue() == -9999f) { // CVG bug synchronousMachinesWithReactiveRangeForMinus9999MW.add(sm.getId()); } else { cdMap.put(cd.getXvalue(), cd); .setMinQ(cd.getY1value()) .setMaxQ(cd.getY2value()) .add(); } else { for (cim1.model.CurveData cd : cdMap.values()) { rcca.beginPoint() .setP(cd.getXvalue()) .setMinQ(cd.getY1value()) .setMaxQ(cd.getY2value()) .endPoint();
this.setCurveSchedule(attributeToSet, setInverse); } catch(LinkageException e) { LOGGER.error(e.toString(), e); boolean setInverse = true; try { this.setCurveSchedule(attributeToSetFromBoundary, setInverse); } catch(LinkageException e) { LOGGER.error(e.toString(), e); errorMessage.append(idCurveSchedule); errorMessage.append("\" in \"CurveData\" of id \""); errorMessage.append(this.getId()); errorMessage.append("\" !"); throw new LinkageException(errorMessage.toString()); errorMessage.append(idCurveSchedule); errorMessage.append("\" in \"CurveData\" of id \""); errorMessage.append(this.getId()); errorMessage.append("\" !"); throw new LinkageException(errorMessage.toString()); removeFromUnresolved();
xmlsw.writeAttribute(CIMModel.rdfURI, "ID", getId()); errorMessage.append("CurveData "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); writeClass(xmlsw); errorMessage.append("CurveData "); 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, "CurveData"); xmlsw.writeAttribute(CIMModel.rdfURI, "ID", getId()); errorMessage.append("CurveData "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); errorMessage.append(" in the subset "); errorMessage.append("Equipment"); writeClass(xmlsw); if (writeID) {
CurveData newCurveData = new CurveData(); CurveData value = entry.getValue(); newCurveData = value; this.id_CurveData.put(newCurveData.getId(), newCurveData); this.allInstances.put(newCurveData.getId(), newCurveData); newMap.put(newCurveData.getId(), newCurveData); this.subsetsInstances.put( .put(newCurveData.getId(), newCurveData);
/** * Utility to check whether this class is consistent in a "merged" context * * @return a ConsistencyCheck instance whose boolean attribute (consistent) * indicates if this class is consistent and whose String attribute * (message) * indicates why this class is not consistent if it is not */ @Override public ConsistencyCheck modelConsistency() { BitSet intersection = new BitSet(this.minBitset.length()); intersection.or(this.minBitset); // we create a copy of minBitSet intersection.and(this.currentBitset); boolean consistent = (this.minBitset.equals(intersection)); StringBuilder message = new StringBuilder(""); if (!consistent) { message.append(getMessageForConsistency(this.minBitset)); } return new ConsistencyCheck(consistent, message.toString()); }
/** * Utility to return the content of this class into the CIM XML format * * @param xmlsw * the stream in which are stored the elements to write */ private void writeClass(XMLStreamWriter xmlsw) { if (currentBitset.get(0)) { for (CurveData curveScheduleDatas : this.curveScheduleDatas){ try { xmlsw.writeEmptyElement(CIMURI.CIMURI,"Curve.CurveScheduleDatas"); xmlsw.writeAttribute(CIMModel.rdfURI, "resource", "#" + curveScheduleDatas.getId()); } catch (XMLStreamException e) { StringBuilder errorMessage = new StringBuilder( "Error while trying to write the reference to "); errorMessage.append("Curve "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); errorMessage.append(" in the subset "); errorMessage.append("${subsetModel.getSubset($class).getName()}"); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); } } } return; }
/** * 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 CurveData clone() { CurveData newInstance = new CurveData(this); CurveData newInstanceSP = newInstance; return newInstanceSP; }
/** * Utility to check whether this class is consistent according to a subset * * @param subset * the subset defining the context in which to check whether this class is consistent * @return a ConsistencyCheck instance whose boolean attribute (consistent) * indicates if this class is consistent and whose String attribute * (message) * indicates why this class is not consistent if it is not */ @Override public ConsistencyCheck modelConsistency(final Subset subset) { BitSet intersection = new BitSet(this.minBitsets.get(subset).length()); intersection.or(this.minBitsets.get(subset)); // we create a copy of minBitsets.get(subset) intersection.and(this.currentBitset); boolean consistent = (this.minBitsets.get(subset).equals(intersection)); StringBuilder message = new StringBuilder(""); if (!consistent) { message.append(getMessageForConsistency(this.minBitsets.get(subset))); } return new ConsistencyCheck(consistent, message.toString()); }
message.append(this.getId()); message.append("\" is not consistent in this context:\n");