/** * Factory of the class * * @param id * id of the class GeneratingUnit to create * @return the class created */ public static GeneratingUnit create(final String id) { GeneratingUnit newGeneratingUnit = new GeneratingUnit(); newGeneratingUnit.setId(id); return newGeneratingUnit; }
/** * Utility to set the "generatingUnitValue" * * @param generatingUnitValue * instance to set * @param setInverse * boolean to specify whether to set the inverse association * or not * @throws LinkageException */ public void setGeneratingUnit( GeneratingUnit generatingUnitValue, boolean setInverse) throws LinkageException { this.generatingUnit = generatingUnitValue; this.currentBitset.set(0); if (setInverse) { if (generatingUnitValue != null) { generatingUnitValue.addControlAreaGeneratingUnit(this, false); } } }
/** * 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 } }
newvariableCost = otherGeneratingUnit.getVariableCost(); this.setVariableCost(newvariableCost); newnormalPF = otherGeneratingUnit.getNormalPF(); this.setNormalPF(newnormalPF); newgovernorSCD = otherGeneratingUnit.getGovernorSCD(); this.setGovernorSCD(newgovernorSCD); newnominalP = otherGeneratingUnit.getNominalP(); this.setNominalP(newnominalP); newstartupCost = otherGeneratingUnit.getStartupCost(); this.setStartupCost(newstartupCost); newmaximumAllowableSpinningReserve = otherGeneratingUnit.getMaximumAllowableSpinningReserve(); this.setMaximumAllowableSpinningReserve(newmaximumAllowableSpinningReserve); newminOperatingP = otherGeneratingUnit.getMinOperatingP(); this.setMinOperatingP(newminOperatingP); newmaxOperatingP = otherGeneratingUnit.getMaxOperatingP(); this.setMaxOperatingP(newmaxOperatingP);
errorMessage.append("GeneratingUnit "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); errorMessage.append(" in the subset "); errorMessage.append("Equipment"); xmlsw.writeCharacters(String.valueOf(getVariableCost())); xmlsw.writeEndElement(); errorMessage.append("GeneratingUnit "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); xmlsw.writeCharacters(String.valueOf(getNormalPF())); xmlsw.writeEndElement(); errorMessage.append("GeneratingUnit "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); xmlsw.writeCharacters(String.valueOf(getGovernorSCD())); xmlsw.writeEndElement(); errorMessage.append("GeneratingUnit "); errorMessage.append("which ID has been initialized to : ");
float minP = gu.getMinOperatingP(); float maxP = gu.getMaxOperatingP();
|| (model.getCurrentSubset() == Subset.Equipment)) { idFossilFuels = id.substring(1); if (!super.isAddedToUnresolved()) { model.addUnresolved(); super.addToUnresolved(); throw new InterpretationException(errorMessage.toString()); } else { super.readResource(class_name, resource_name, id, model);
/** * Copy constructor * The associations with other objects are not copied * * @param GeneratingUnit * the reference to the class to copy * @return the class constructed */ private GeneratingUnit(final GeneratingUnit otherGeneratingUnit) { // TODO : check exception safe this.copyBase(otherGeneratingUnit); }
GeneratingUnit newGeneratingUnit = new GeneratingUnit(); GeneratingUnit value = entry.getValue(); newGeneratingUnit = value; this.id_GeneratingUnit.put(newGeneratingUnit.getId(), newGeneratingUnit); this.allInstances.put(newGeneratingUnit.getId(), newGeneratingUnit); newMap.put(newGeneratingUnit.getId(), newGeneratingUnit); this.subsetsInstances.put( .put(newGeneratingUnit.getId(), newGeneratingUnit);
/** * 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 GeneratingUnit clone() { GeneratingUnit newInstance = new GeneratingUnit(this); GeneratingUnit newInstanceSP = newInstance; return newInstanceSP; }
/** * Utility to set the "memberOf_GeneratingUnitValue" * * @param memberOf_GeneratingUnitValue * instance to set * @param setInverse * boolean to specify whether to set the inverse association * or not * @throws LinkageException */ public void setMemberOf_GeneratingUnit( GeneratingUnit memberOf_GeneratingUnitValue, boolean setInverse) throws LinkageException { this.memberOf_GeneratingUnit = memberOf_GeneratingUnitValue; this.currentBitset.set(8); if (setInverse) { if (memberOf_GeneratingUnitValue != null) { memberOf_GeneratingUnitValue.addContains_SynchronousMachines(this, false); } } }
/** * Utility to copy the "base" of an other instance of the same class * This utility does not copy the associations with other instances from * the instance to copy * * @param otherNuclearGeneratingUnit * the instance to copy */ public void copyBase(final NuclearGeneratingUnit otherNuclearGeneratingUnit) { // Memory allocation has done successfully ! // Dropping "old" objects... // This part may change : we do nothing to allow the user to access // object by their id from the global model. // TODO : Call the parent copy constructor instead ? super.copyBase(otherNuclearGeneratingUnit); }
/** * Utility to copy the "base" of an other instance of the same class * This utility does not copy the associations with other instances from * the instance to copy * * @param otherWindGeneratingUnit * the instance to copy */ public void copyBase(final WindGeneratingUnit otherWindGeneratingUnit) { // Memory allocation has done successfully ! // Dropping "old" objects... // This part may change : we do nothing to allow the user to access // object by their id from the global model. // TODO : Call the parent copy constructor instead ? super.copyBase(otherWindGeneratingUnit); }
/** * Utility to clear the associations of this class belonging to a * specific subset * * @param subset * the subset from which to clear the associations of this class */ @Override protected void clearAssociations(final Subset subset) { switch (subset) { case StateVariables: { super.clearAssociations(subset); break; } case Topology: { super.clearAssociations(subset); break; } case Equipment: { super.clearAssociations(subset); break; } default: // nothing to clear } }
/** * Utility to copy the "base" of an other instance of the same class * This utility does not copy the associations with other instances from * the instance to copy * * @param otherHydroGeneratingUnit * the instance to copy */ public void copyBase(final HydroGeneratingUnit otherHydroGeneratingUnit) { // Memory allocation has done successfully ! // Dropping "old" objects... // This part may change : we do nothing to allow the user to access // object by their id from the global model. // TODO : Call the parent copy constructor instead ? super.copyBase(otherHydroGeneratingUnit); }
/** * Utility to clear the associations of this class belonging to a * specific subset * * @param subset * the subset from which to clear the associations of this class */ @Override protected void clearAssociations(final Subset subset) { switch (subset) { case StateVariables: { super.clearAssociations(subset); break; } case Topology: { super.clearAssociations(subset); break; } case Equipment: { super.clearAssociations(subset); break; } default: // nothing to clear } }
/** * Utility to copy the "base" of an other instance of the same class * This utility does not copy the associations with other instances from * the instance to copy * * @param otherThermalGeneratingUnit * the instance to copy */ public void copyBase(final ThermalGeneratingUnit otherThermalGeneratingUnit) { // Memory allocation has done successfully ! // Dropping "old" objects... // This part may change : we do nothing to allow the user to access // object by their id from the global model. if (otherThermalGeneratingUnit.currentBitset.get(0)) { FossilFuel fossilFuelsAssociation = otherThermalGeneratingUnit.getFossilFuels(); //this.idFossilFuels = (fossilFuelsAssociation != null) ? fossilFuelsAssociation.getId() : ""; if (fossilFuelsAssociation != null) { this.idFossilFuels = fossilFuelsAssociation.getId(); // the proper bit will be set when the setter is called } else { this.idFossilFuels = ""; } } // TODO : Call the parent copy constructor instead ? super.copyBase(otherThermalGeneratingUnit); }
/** * Utility to clear the associations of this class belonging to a * specific subset * * @param subset * the subset from which to clear the associations of this class */ @Override protected void clearAssociations(final Subset subset) { switch (subset) { case StateVariables: { super.clearAssociations(subset); break; } case Topology: { super.clearAssociations(subset); break; } case Equipment: { super.clearAssociations(subset); break; } default: // nothing to clear } }