Class AbstractValidationFormatterWriter
- java.lang.Object
-
- com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter
-
- All Implemented Interfaces:
ValidationWriter
,AutoCloseable
- Direct Known Subclasses:
ValidationFormatterCsvMultilineWriter
,ValidationFormatterCsvWriter
public abstract class AbstractValidationFormatterWriter extends Object implements ValidationWriter
- Author:
- Massimo Ferraro
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.BusData>
busesData
protected boolean
compareResults
protected static String
CONNECTED
protected static String
EXPECTED_P1
protected static String
EXPECTED_P2
protected static String
EXPECTED_P3
protected static String
EXPECTED_Q1
protected static String
EXPECTED_Q2
protected static String
EXPECTED_Q3
protected static String
FAIL
protected Map<String,com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.FlowData>
flowsData
protected TableFormatter
formatter
protected Map<String,com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.GeneratorData>
generatorsData
protected String
invalidString
protected static String
MAIN_COMPONENT
protected static String
NETWORK_P1
protected static String
NETWORK_P2
protected static String
NETWORK_P3
protected static String
NETWORK_Q1
protected static String
NETWORK_Q2
protected static String
NETWORK_Q3
protected static String
NOMINAL_V
protected static String
POST_COMPUTATION_SUFFIX
protected boolean
preLoadflowValidationCompleted
protected Map<String,com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.ShuntData>
shuntsData
protected static String
SUCCESS
protected Map<String,com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.SvcData>
svcsData
protected static String
THETA1
protected static String
THETA2
protected static String
THETA3
protected Map<String,com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.Transformer3WData>
twts3wData
protected Map<String,com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.TransformerData>
twtsData
protected static String
VALIDATION
protected ValidationType
validationType
-
Constructor Summary
Constructors Constructor Description AbstractValidationFormatterWriter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
close()
protected TableFormatter
createTableFormatter(String id, Class<? extends TableFormatterFactory> formatterFactoryClass, TableFormatterConfig formatterConfig, Writer writer, ValidationType validationType)
protected abstract Column[]
getColumns()
protected String
getValidated(boolean validated)
void
setValidationCompleted()
void
write(String generatorId, double p, double q, double v, double targetP, double targetQ, double targetV, double expectedP, boolean connected, boolean voltageRegulatorOn, double minP, double maxP, double minQ, double maxQ, boolean mainComponent, boolean validated)
protected abstract void
write(String generatorId, double p, double q, double v, double targetP, double targetQ, double targetV, double expectedP, boolean connected, boolean voltageRegulatorOn, double minP, double maxP, double minQ, double maxQ, boolean mainComponent, boolean validated, com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.GeneratorData generatorData, boolean found, boolean writeValues)
void
write(String svcId, double p, double q, double vControlled, double vController, double nominalVcontroller, double reactivePowerSetpoint, double voltageSetpoint, boolean connected, StaticVarCompensator.RegulationMode regulationMode, double bMin, double bMax, boolean mainComponent, boolean validated)
protected abstract void
write(String svcId, double p, double q, double vControlled, double vController, double nominalVcontroller, double reactivePowerSetpoint, double voltageSetpoint, boolean connected, StaticVarCompensator.RegulationMode regulationMode, double bMin, double bMax, boolean mainComponent, boolean validated, com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.SvcData svcData, boolean found, boolean writeValues)
void
write(String busId, double incomingP, double incomingQ, double loadP, double loadQ, double genP, double genQ, double batP, double batQ, double shuntP, double shuntQ, double svcP, double svcQ, double vscCSP, double vscCSQ, double lineP, double lineQ, double danglingLineP, double danglingLineQ, double twtP, double twtQ, double tltP, double tltQ, boolean mainComponent, boolean validated)
protected abstract void
write(String busId, double incomingP, double incomingQ, double loadP, double loadQ, double genP, double genQ, double batP, double batQ, double shuntP, double shuntQ, double svcP, double svcQ, double vscCSP, double vscCSQ, double lineP, double lineQ, double danglingLineP, double danglingLineQ, double twtP, double twtQ, double tltP, double tltQ, boolean mainComponent, boolean validated, com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.BusData busData, boolean found, boolean writeValues)
void
write(String branchId, double p1, double p1Calc, double q1, double q1Calc, double p2, double p2Calc, double q2, double q2Calc, double r, double x, double g1, double g2, double b1, double b2, double rho1, double rho2, double alpha1, double alpha2, double u1, double u2, double theta1, double theta2, double z, double y, double ksi, int phaseAngleClock, boolean connected1, boolean connected2, boolean mainComponent1, boolean mainComponent2, boolean validated)
protected abstract void
write(String branchId, double p1, double p1Calc, double q1, double q1Calc, double p2, double p2Calc, double q2, double q2Calc, double r, double x, double g1, double g2, double b1, double b2, double rho1, double rho2, double alpha1, double alpha2, double u1, double u2, double theta1, double theta2, double z, double y, double ksi, int phaseAngleClock, boolean connected1, boolean connected2, boolean mainComponent1, boolean mainComponent2, boolean validated, com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.FlowData flowData, boolean found, boolean writeValues)
void
write(String twtId, double error, double upIncrement, double downIncrement, double rho, double rhoPreviousStep, double rhoNextStep, int tapPosition, int lowTapPosition, int highTapPosition, double targetV, Branch.Side regulatedSide, double v, boolean connected, boolean mainComponent, boolean validated)
protected abstract void
write(String twtId, double error, double upIncrement, double downIncrement, double rho, double rhoPreviousStep, double rhoNextStep, int tapPosition, int lowTapPosition, int highTapPosition, double targetV, Branch.Side regulatedSide, double v, boolean connected, boolean mainComponent, boolean validated, com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.TransformerData twtData, boolean found, boolean writeValues)
void
write(String shuntId, double q, double expectedQ, double p, int currentSectionCount, int maximumSectionCount, double bPerSection, double v, boolean connected, double qMax, double nominalV, boolean mainComponent, boolean validated)
protected abstract void
write(String shuntId, double q, double expectedQ, double p, int currentSectionCount, int maximumSectionCount, double bPerSection, double v, boolean connected, double qMax, double nominalV, boolean mainComponent, boolean validated, com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.ShuntData shuntData, boolean found, boolean writeValues)
void
write(String twtId, TwtData twtData, boolean validated)
protected abstract void
write(String twtId, com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.Transformer3WData transformer3wData1, com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.Transformer3WData transformer3wData2, boolean found, boolean writeValues)
-
-
-
Field Detail
-
SUCCESS
protected static final String SUCCESS
- See Also:
- Constant Field Values
-
FAIL
protected static final String FAIL
- See Also:
- Constant Field Values
-
VALIDATION
protected static final String VALIDATION
- See Also:
- Constant Field Values
-
CONNECTED
protected static final String CONNECTED
- See Also:
- Constant Field Values
-
MAIN_COMPONENT
protected static final String MAIN_COMPONENT
- See Also:
- Constant Field Values
-
POST_COMPUTATION_SUFFIX
protected static final String POST_COMPUTATION_SUFFIX
- See Also:
- Constant Field Values
-
NOMINAL_V
protected static final String NOMINAL_V
- See Also:
- Constant Field Values
-
NETWORK_P1
protected static final String NETWORK_P1
- See Also:
- Constant Field Values
-
EXPECTED_P1
protected static final String EXPECTED_P1
- See Also:
- Constant Field Values
-
NETWORK_Q1
protected static final String NETWORK_Q1
- See Also:
- Constant Field Values
-
EXPECTED_Q1
protected static final String EXPECTED_Q1
- See Also:
- Constant Field Values
-
NETWORK_P2
protected static final String NETWORK_P2
- See Also:
- Constant Field Values
-
EXPECTED_P2
protected static final String EXPECTED_P2
- See Also:
- Constant Field Values
-
NETWORK_Q2
protected static final String NETWORK_Q2
- See Also:
- Constant Field Values
-
EXPECTED_Q2
protected static final String EXPECTED_Q2
- See Also:
- Constant Field Values
-
NETWORK_P3
protected static final String NETWORK_P3
- See Also:
- Constant Field Values
-
EXPECTED_P3
protected static final String EXPECTED_P3
- See Also:
- Constant Field Values
-
NETWORK_Q3
protected static final String NETWORK_Q3
- See Also:
- Constant Field Values
-
EXPECTED_Q3
protected static final String EXPECTED_Q3
- See Also:
- Constant Field Values
-
THETA1
protected static final String THETA1
- See Also:
- Constant Field Values
-
THETA2
protected static final String THETA2
- See Also:
- Constant Field Values
-
THETA3
protected static final String THETA3
- See Also:
- Constant Field Values
-
validationType
protected ValidationType validationType
-
compareResults
protected boolean compareResults
-
formatter
protected TableFormatter formatter
-
invalidString
protected String invalidString
-
preLoadflowValidationCompleted
protected boolean preLoadflowValidationCompleted
-
busesData
protected Map<String,com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.BusData> busesData
-
generatorsData
protected Map<String,com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.GeneratorData> generatorsData
-
svcsData
protected Map<String,com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.SvcData> svcsData
-
shuntsData
protected Map<String,com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.ShuntData> shuntsData
-
flowsData
protected Map<String,com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.FlowData> flowsData
-
twtsData
protected Map<String,com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.TransformerData> twtsData
-
-
Method Detail
-
createTableFormatter
protected TableFormatter createTableFormatter(String id, Class<? extends TableFormatterFactory> formatterFactoryClass, TableFormatterConfig formatterConfig, Writer writer, ValidationType validationType)
-
getColumns
protected abstract Column[] getColumns()
-
getValidated
protected String getValidated(boolean validated)
-
write
public void write(String branchId, double p1, double p1Calc, double q1, double q1Calc, double p2, double p2Calc, double q2, double q2Calc, double r, double x, double g1, double g2, double b1, double b2, double rho1, double rho2, double alpha1, double alpha2, double u1, double u2, double theta1, double theta2, double z, double y, double ksi, int phaseAngleClock, boolean connected1, boolean connected2, boolean mainComponent1, boolean mainComponent2, boolean validated) throws IOException
- Specified by:
write
in interfaceValidationWriter
- Throws:
IOException
-
write
protected abstract void write(String branchId, double p1, double p1Calc, double q1, double q1Calc, double p2, double p2Calc, double q2, double q2Calc, double r, double x, double g1, double g2, double b1, double b2, double rho1, double rho2, double alpha1, double alpha2, double u1, double u2, double theta1, double theta2, double z, double y, double ksi, int phaseAngleClock, boolean connected1, boolean connected2, boolean mainComponent1, boolean mainComponent2, boolean validated, com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.FlowData flowData, boolean found, boolean writeValues) throws IOException
- Throws:
IOException
-
write
public void write(String generatorId, double p, double q, double v, double targetP, double targetQ, double targetV, double expectedP, boolean connected, boolean voltageRegulatorOn, double minP, double maxP, double minQ, double maxQ, boolean mainComponent, boolean validated) throws IOException
- Specified by:
write
in interfaceValidationWriter
- Throws:
IOException
-
write
protected abstract void write(String generatorId, double p, double q, double v, double targetP, double targetQ, double targetV, double expectedP, boolean connected, boolean voltageRegulatorOn, double minP, double maxP, double minQ, double maxQ, boolean mainComponent, boolean validated, com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.GeneratorData generatorData, boolean found, boolean writeValues) throws IOException
- Throws:
IOException
-
write
public void write(String busId, double incomingP, double incomingQ, double loadP, double loadQ, double genP, double genQ, double batP, double batQ, double shuntP, double shuntQ, double svcP, double svcQ, double vscCSP, double vscCSQ, double lineP, double lineQ, double danglingLineP, double danglingLineQ, double twtP, double twtQ, double tltP, double tltQ, boolean mainComponent, boolean validated) throws IOException
- Specified by:
write
in interfaceValidationWriter
- Throws:
IOException
-
write
protected abstract void write(String busId, double incomingP, double incomingQ, double loadP, double loadQ, double genP, double genQ, double batP, double batQ, double shuntP, double shuntQ, double svcP, double svcQ, double vscCSP, double vscCSQ, double lineP, double lineQ, double danglingLineP, double danglingLineQ, double twtP, double twtQ, double tltP, double tltQ, boolean mainComponent, boolean validated, com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.BusData busData, boolean found, boolean writeValues) throws IOException
- Throws:
IOException
-
write
public void write(String svcId, double p, double q, double vControlled, double vController, double nominalVcontroller, double reactivePowerSetpoint, double voltageSetpoint, boolean connected, StaticVarCompensator.RegulationMode regulationMode, double bMin, double bMax, boolean mainComponent, boolean validated) throws IOException
- Specified by:
write
in interfaceValidationWriter
- Throws:
IOException
-
write
protected abstract void write(String svcId, double p, double q, double vControlled, double vController, double nominalVcontroller, double reactivePowerSetpoint, double voltageSetpoint, boolean connected, StaticVarCompensator.RegulationMode regulationMode, double bMin, double bMax, boolean mainComponent, boolean validated, com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.SvcData svcData, boolean found, boolean writeValues) throws IOException
- Throws:
IOException
-
write
public void write(String shuntId, double q, double expectedQ, double p, int currentSectionCount, int maximumSectionCount, double bPerSection, double v, boolean connected, double qMax, double nominalV, boolean mainComponent, boolean validated) throws IOException
- Specified by:
write
in interfaceValidationWriter
- Throws:
IOException
-
write
protected abstract void write(String shuntId, double q, double expectedQ, double p, int currentSectionCount, int maximumSectionCount, double bPerSection, double v, boolean connected, double qMax, double nominalV, boolean mainComponent, boolean validated, com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.ShuntData shuntData, boolean found, boolean writeValues) throws IOException
- Throws:
IOException
-
write
public void write(String twtId, double error, double upIncrement, double downIncrement, double rho, double rhoPreviousStep, double rhoNextStep, int tapPosition, int lowTapPosition, int highTapPosition, double targetV, Branch.Side regulatedSide, double v, boolean connected, boolean mainComponent, boolean validated) throws IOException
- Specified by:
write
in interfaceValidationWriter
- Throws:
IOException
-
write
protected abstract void write(String twtId, double error, double upIncrement, double downIncrement, double rho, double rhoPreviousStep, double rhoNextStep, int tapPosition, int lowTapPosition, int highTapPosition, double targetV, Branch.Side regulatedSide, double v, boolean connected, boolean mainComponent, boolean validated, com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.TransformerData twtData, boolean found, boolean writeValues) throws IOException
- Throws:
IOException
-
write
public void write(String twtId, TwtData twtData, boolean validated) throws IOException
- Specified by:
write
in interfaceValidationWriter
- Throws:
IOException
-
write
protected abstract void write(String twtId, com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.Transformer3WData transformer3wData1, com.powsybl.loadflow.validation.io.AbstractValidationFormatterWriter.Transformer3WData transformer3wData2, boolean found, boolean writeValues) throws IOException
- Throws:
IOException
-
setValidationCompleted
public void setValidationCompleted()
- Specified by:
setValidationCompleted
in interfaceValidationWriter
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceValidationWriter
- Throws:
IOException
-
-