diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/builders/EventBuilderConfig.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/builders/EventBuilderConfig.java index b969a23f4..fdc27c19f 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/builders/EventBuilderConfig.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/builders/EventBuilderConfig.java @@ -22,9 +22,9 @@ public interface EventModelBuilderConstructor { } private final EventModelBuilderConstructor builderConstructor; - private final EventModelInfo eventModelInfo; + private final ModelInfo eventModelInfo; - public EventBuilderConfig(EventModelBuilderConstructor builderConstructor, EventModelInfo eventModelInfo) { + public EventBuilderConfig(EventModelBuilderConstructor builderConstructor, ModelInfo eventModelInfo) { this.builderConstructor = builderConstructor; this.eventModelInfo = eventModelInfo; } @@ -33,7 +33,7 @@ public EventModelBuilderConstructor getBuilderConstructor() { return builderConstructor; } - public EventModelInfo getEventModelInfo() { + public ModelInfo getEventModelInfo() { return eventModelInfo; } } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/builders/EventModelInfo.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/builders/EventModelInfo.java index b00552dac..bdde0f460 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/builders/EventModelInfo.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/builders/EventModelInfo.java @@ -9,20 +9,30 @@ /** * @param name Model name - * @param info Definition of the event model + * @param doc Definition of the event model * @param version Dynawo version range where the model can be used * @author Laurent Issertial {@literal } */ -public record EventModelInfo(String name, String info, VersionInterval version) { +public record EventModelInfo(String name, String doc, VersionInterval version) implements ModelInfo { public EventModelInfo(String name, String info) { this(name, info, VersionInterval.createDefaultVersion()); } + @Override + public String lib() { + return name; + } + + @Override + public String alias() { + return null; + } + /** * Concatenation of name, doc and version bound */ public String formattedInfo() { - return String.format("%s: %s (%s)", name, info, version); + return String.format("%s: %s (%s)", name, doc, version); } } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/builders/ModelConfigLoaderImpl.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/builders/ModelConfigLoaderImpl.java index a1b326259..279e95052 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/builders/ModelConfigLoaderImpl.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/builders/ModelConfigLoaderImpl.java @@ -70,9 +70,9 @@ public final class ModelConfigLoaderImpl implements ModelConfigLoader { new BuilderConfig(SignalNGeneratorBuilder.CATEGORY, SignalNGeneratorBuilder::of, SignalNGeneratorBuilder::getSupportedModelInfos)); private static final Stream EVENT_BUILDER_CONFIGS = Stream.of( - new EventBuilderConfig(EventActivePowerVariationBuilder::of, EventActivePowerVariationBuilder.getEventModelInfo()), - new EventBuilderConfig(EventDisconnectionBuilder::of, EventDisconnectionBuilder.getEventModelInfo()), - new EventBuilderConfig(NodeFaultEventBuilder::of, NodeFaultEventBuilder.getEventModelInfo())); + new EventBuilderConfig(EventActivePowerVariationBuilder::of, EventActivePowerVariationBuilder.getModelInfo()), + new EventBuilderConfig(EventDisconnectionBuilder::of, EventDisconnectionBuilder.getModelInfo()), + new EventBuilderConfig(NodeFaultEventBuilder::of, NodeFaultEventBuilder.getModelInfo())); @Override public String getModelConfigFileName() { diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/TapChangerAutomationSystemBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/TapChangerAutomationSystemBuilder.java index a47ad25d7..4ca13b416 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/TapChangerAutomationSystemBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/TapChangerAutomationSystemBuilder.java @@ -49,6 +49,10 @@ public static TapChangerAutomationSystemBuilder of(Network network, String model return new TapChangerAutomationSystemBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/TapChangerBlockingAutomationSystemBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/TapChangerBlockingAutomationSystemBuilder.java index 82f9e5f2f..f1ce09d1a 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/TapChangerBlockingAutomationSystemBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/TapChangerBlockingAutomationSystemBuilder.java @@ -51,6 +51,10 @@ public static TapChangerBlockingAutomationSystemBuilder of(Network network, Stri return new TapChangerBlockingAutomationSystemBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/UnderVoltageAutomationSystemBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/UnderVoltageAutomationSystemBuilder.java index a39a2d562..8c9fa4494 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/UnderVoltageAutomationSystemBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/UnderVoltageAutomationSystemBuilder.java @@ -47,6 +47,10 @@ public static UnderVoltageAutomationSystemBuilder of(Network network, String mod return new UnderVoltageAutomationSystemBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/overloadmanagments/DynamicOverloadManagementSystemBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/overloadmanagments/DynamicOverloadManagementSystemBuilder.java index 11c276a48..5cec56c5e 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/overloadmanagments/DynamicOverloadManagementSystemBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/overloadmanagments/DynamicOverloadManagementSystemBuilder.java @@ -44,6 +44,10 @@ public static DynamicOverloadManagementSystemBuilder of(Network network, String return new DynamicOverloadManagementSystemBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/overloadmanagments/DynamicTwoLevelsOverloadManagementSystemBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/overloadmanagments/DynamicTwoLevelsOverloadManagementSystemBuilder.java index d79e20bc6..409701e00 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/overloadmanagments/DynamicTwoLevelsOverloadManagementSystemBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/overloadmanagments/DynamicTwoLevelsOverloadManagementSystemBuilder.java @@ -48,6 +48,10 @@ public static DynamicTwoLevelsOverloadManagementSystemBuilder of(Network network return new DynamicTwoLevelsOverloadManagementSystemBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/phaseshifters/PhaseShifterBlockingIAutomationSystemBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/phaseshifters/PhaseShifterBlockingIAutomationSystemBuilder.java index 62b888aa9..84e20e23f 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/phaseshifters/PhaseShifterBlockingIAutomationSystemBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/phaseshifters/PhaseShifterBlockingIAutomationSystemBuilder.java @@ -44,6 +44,10 @@ public static PhaseShifterBlockingIAutomationSystemBuilder of(Network network, S return new PhaseShifterBlockingIAutomationSystemBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/phaseshifters/PhaseShifterIAutomationSystemBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/phaseshifters/PhaseShifterIAutomationSystemBuilder.java index 213b225b9..775ee185a 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/phaseshifters/PhaseShifterIAutomationSystemBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/phaseshifters/PhaseShifterIAutomationSystemBuilder.java @@ -43,6 +43,10 @@ public static PhaseShifterIAutomationSystemBuilder of(Network network, String mo return new PhaseShifterIAutomationSystemBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/phaseshifters/PhaseShifterPAutomationSystemBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/phaseshifters/PhaseShifterPAutomationSystemBuilder.java index f0a2e1ca7..d92236d88 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/phaseshifters/PhaseShifterPAutomationSystemBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/automationsystems/phaseshifters/PhaseShifterPAutomationSystemBuilder.java @@ -43,6 +43,10 @@ public static PhaseShifterPAutomationSystemBuilder of(Network network, String mo return new PhaseShifterPAutomationSystemBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/buses/InfiniteBusBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/buses/InfiniteBusBuilder.java index 25dde2d98..d2b550510 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/buses/InfiniteBusBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/buses/InfiniteBusBuilder.java @@ -43,6 +43,10 @@ public static InfiniteBusBuilder of(Network network, String modelName, ReportNod return new InfiniteBusBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/buses/StandardBusBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/buses/StandardBusBuilder.java index 1c56ce16c..e0a61f0b7 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/buses/StandardBusBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/buses/StandardBusBuilder.java @@ -43,6 +43,10 @@ public static StandardBusBuilder of(Network network, String modelName, ReportNod return new StandardBusBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/events/EventActivePowerVariationBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/events/EventActivePowerVariationBuilder.java index c698f5e32..d199198e0 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/events/EventActivePowerVariationBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/events/EventActivePowerVariationBuilder.java @@ -11,6 +11,7 @@ import com.powsybl.dynawo.builders.BuilderEquipment; import com.powsybl.dynawo.builders.BuilderReports; import com.powsybl.dynawo.builders.EventModelInfo; +import com.powsybl.dynawo.builders.ModelInfo; import com.powsybl.dynawo.commons.DynawoVersion; import com.powsybl.iidm.network.Injection; import com.powsybl.iidm.network.Network; @@ -32,14 +33,14 @@ public static EventActivePowerVariationBuilder of(Network network, ReportNode re return new EventActivePowerVariationBuilder(network, reportNode); } - public static EventModelInfo getEventModelInfo() { + public static ModelInfo getModelInfo() { return MODEL_INFO; } /** * Returns the model info if usable with the given {@link DynawoVersion} */ - public static EventModelInfo getEventModelInfo(DynawoVersion dynawoVersion) { + public static ModelInfo getModelInfo(DynawoVersion dynawoVersion) { return MODEL_INFO.version().includes(dynawoVersion) ? MODEL_INFO : null; } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/events/EventDisconnectionBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/events/EventDisconnectionBuilder.java index 326578cfc..88e88cbbe 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/events/EventDisconnectionBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/events/EventDisconnectionBuilder.java @@ -11,6 +11,7 @@ import com.powsybl.dynawo.builders.BuilderEquipment; import com.powsybl.dynawo.builders.BuilderReports; import com.powsybl.dynawo.builders.EventModelInfo; +import com.powsybl.dynawo.builders.ModelInfo; import com.powsybl.dynawo.commons.DynawoVersion; import com.powsybl.iidm.network.*; @@ -43,14 +44,14 @@ public static EventDisconnectionBuilder of(Network network, ReportNode reportNod return new EventDisconnectionBuilder(network, reportNode); } - public static EventModelInfo getEventModelInfo() { + public static ModelInfo getModelInfo() { return MODEL_INFO; } /** * Returns the model info if usable with the given {@link DynawoVersion} */ - public static EventModelInfo getEventModelInfo(DynawoVersion dynawoVersion) { + public static ModelInfo getModelInfo(DynawoVersion dynawoVersion) { return MODEL_INFO.version().includes(dynawoVersion) ? MODEL_INFO : null; } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/events/NodeFaultEventBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/events/NodeFaultEventBuilder.java index df200fe67..26272f6e2 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/events/NodeFaultEventBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/events/NodeFaultEventBuilder.java @@ -11,6 +11,7 @@ import com.powsybl.dynawo.builders.BuilderEquipment; import com.powsybl.dynawo.builders.BuilderReports; import com.powsybl.dynawo.builders.EventModelInfo; +import com.powsybl.dynawo.builders.ModelInfo; import com.powsybl.dynawo.commons.DynawoVersion; import com.powsybl.iidm.network.Bus; import com.powsybl.iidm.network.IdentifiableType; @@ -35,14 +36,14 @@ public static NodeFaultEventBuilder of(Network network, ReportNode reportNode) { return new NodeFaultEventBuilder(network, reportNode); } - public static EventModelInfo getEventModelInfo() { + public static ModelInfo getModelInfo() { return MODEL_INFO; } /** * Returns the model info if usable with the given {@link DynawoVersion} */ - public static EventModelInfo getEventModelInfo(DynawoVersion dynawoVersion) { + public static ModelInfo getModelInfo(DynawoVersion dynawoVersion) { return MODEL_INFO.version().includes(dynawoVersion) ? MODEL_INFO : null; } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/BaseGeneratorBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/BaseGeneratorBuilder.java index 2d1029f83..43da328e5 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/BaseGeneratorBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/BaseGeneratorBuilder.java @@ -43,6 +43,10 @@ public static BaseGeneratorBuilder of(Network network, String modelName, ReportN return new BaseGeneratorBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/GridFormingConverterBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/GridFormingConverterBuilder.java index 7e33aa3b0..83b0456a5 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/GridFormingConverterBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/GridFormingConverterBuilder.java @@ -43,6 +43,10 @@ public static GridFormingConverterBuilder of(Network network, String modelName, return new GridFormingConverterBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/SignalNGeneratorBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/SignalNGeneratorBuilder.java index c47fe2140..ce0a9efad 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/SignalNGeneratorBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/SignalNGeneratorBuilder.java @@ -43,6 +43,10 @@ public static SignalNGeneratorBuilder of(Network network, String modelName, Repo return new SignalNGeneratorBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/SynchronizedGeneratorBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/SynchronizedGeneratorBuilder.java index 59e3e4abf..8a599bc02 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/SynchronizedGeneratorBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/SynchronizedGeneratorBuilder.java @@ -43,6 +43,10 @@ public static SynchronizedGeneratorBuilder of(Network network, String modelName, return new SynchronizedGeneratorBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/SynchronousGeneratorBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/SynchronousGeneratorBuilder.java index e0f87003a..77ed8507a 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/SynchronousGeneratorBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/SynchronousGeneratorBuilder.java @@ -44,6 +44,10 @@ public static SynchronousGeneratorBuilder of(Network network, String modelName, return new SynchronousGeneratorBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/WeccBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/WeccBuilder.java index 800e9a2bf..77232972d 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/WeccBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/generators/WeccBuilder.java @@ -43,6 +43,10 @@ public static WeccBuilder of(Network network, String modelName, ReportNode repor return new WeccBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/hvdc/HvdcPBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/hvdc/HvdcPBuilder.java index d1896c343..6b8db43c9 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/hvdc/HvdcPBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/hvdc/HvdcPBuilder.java @@ -46,6 +46,10 @@ public static HvdcPBuilder of(Network network, String modelName, ReportNode repo return new HvdcPBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/hvdc/HvdcVscBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/hvdc/HvdcVscBuilder.java index 17450af5c..2b44babde 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/hvdc/HvdcVscBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/hvdc/HvdcVscBuilder.java @@ -46,6 +46,10 @@ public static HvdcVscBuilder of(Network network, String modelName, ReportNode re return new HvdcVscBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/lines/LineBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/lines/LineBuilder.java index d07a3499d..f11e8a6b0 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/lines/LineBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/lines/LineBuilder.java @@ -45,6 +45,10 @@ public static LineBuilder of(Network network, String modelName, ReportNode repor return new LineBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/loads/BaseLoadBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/loads/BaseLoadBuilder.java index b745ac0a5..563592679 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/loads/BaseLoadBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/loads/BaseLoadBuilder.java @@ -43,6 +43,10 @@ public static BaseLoadBuilder of(Network network, String modelName, ReportNode r return new BaseLoadBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/loads/LoadOneTransformerBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/loads/LoadOneTransformerBuilder.java index b82e78174..dddacd76f 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/loads/LoadOneTransformerBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/loads/LoadOneTransformerBuilder.java @@ -43,6 +43,10 @@ public static LoadOneTransformerBuilder of(Network network, String modelName, Re return new LoadOneTransformerBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/loads/LoadOneTransformerTapChangerBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/loads/LoadOneTransformerTapChangerBuilder.java index 3d6d6fdda..92c0b6456 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/loads/LoadOneTransformerTapChangerBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/loads/LoadOneTransformerTapChangerBuilder.java @@ -43,6 +43,10 @@ public static LoadOneTransformerTapChangerBuilder of(Network network, String mod return new LoadOneTransformerTapChangerBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/loads/LoadTwoTransformersBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/loads/LoadTwoTransformersBuilder.java index 11d646e38..a3b7df126 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/loads/LoadTwoTransformersBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/loads/LoadTwoTransformersBuilder.java @@ -43,6 +43,10 @@ public static LoadTwoTransformersBuilder of(Network network, String modelName, R return new LoadTwoTransformersBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/loads/LoadTwoTransformersTapChangersBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/loads/LoadTwoTransformersTapChangersBuilder.java index d04bfdcae..fd69b7f21 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/loads/LoadTwoTransformersTapChangersBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/loads/LoadTwoTransformersTapChangersBuilder.java @@ -43,6 +43,10 @@ public static LoadTwoTransformersTapChangersBuilder of(Network network, String m return new LoadTwoTransformersTapChangersBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/shunts/BaseShuntBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/shunts/BaseShuntBuilder.java index b87237f09..e82d42a55 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/shunts/BaseShuntBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/shunts/BaseShuntBuilder.java @@ -45,6 +45,10 @@ public static BaseShuntBuilder of(Network network, String modelName, ReportNode return new BaseShuntBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/svarcs/BaseStaticVarCompensatorBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/svarcs/BaseStaticVarCompensatorBuilder.java index 6e5ae6b02..993034e5f 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/svarcs/BaseStaticVarCompensatorBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/svarcs/BaseStaticVarCompensatorBuilder.java @@ -45,6 +45,10 @@ public static BaseStaticVarCompensatorBuilder of(Network network, String modelNa return new BaseStaticVarCompensatorBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/transformers/TransformerFixedRatioBuilder.java b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/transformers/TransformerFixedRatioBuilder.java index 3755d78a7..40d87ec93 100644 --- a/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/transformers/TransformerFixedRatioBuilder.java +++ b/dynawo-simulation/src/main/java/com/powsybl/dynawo/models/transformers/TransformerFixedRatioBuilder.java @@ -45,6 +45,10 @@ public static TransformerFixedRatioBuilder of(Network network, String modelName, return new TransformerFixedRatioBuilder(network, modelConfig, reportNode); } + public static ModelInfo getDefaultModelInfo() { + return MODEL_CONFIGS.getDefaultModelConfig(); + } + public static Collection getSupportedModelInfos() { return MODEL_CONFIGS.getModelInfos(); } diff --git a/dynawo-simulation/src/test/java/com/powsybl/dynawo/builders/BuildersTest.java b/dynawo-simulation/src/test/java/com/powsybl/dynawo/builders/BuildersTest.java index 15c718128..c5bcdbac8 100644 --- a/dynawo-simulation/src/test/java/com/powsybl/dynawo/builders/BuildersTest.java +++ b/dynawo-simulation/src/test/java/com/powsybl/dynawo/builders/BuildersTest.java @@ -17,6 +17,9 @@ import com.powsybl.dynawo.models.automationsystems.phaseshifters.PhaseShifterPAutomationSystemBuilder; import com.powsybl.dynawo.models.buses.InfiniteBusBuilder; import com.powsybl.dynawo.models.buses.StandardBusBuilder; +import com.powsybl.dynawo.models.events.EventActivePowerVariationBuilder; +import com.powsybl.dynawo.models.events.EventDisconnectionBuilder; +import com.powsybl.dynawo.models.events.NodeFaultEventBuilder; import com.powsybl.dynawo.models.generators.*; import com.powsybl.dynawo.models.hvdc.HvdcPBuilder; import com.powsybl.dynawo.models.hvdc.HvdcVscBuilder; @@ -84,14 +87,46 @@ void testDefaultLibEquipments() { } @Test - void testWrongLibAutomationSystem() { - assertNull(UnderVoltageAutomationSystemBuilder.of(NETWORK).build()); - assertNull(TapChangerBlockingAutomationSystemBuilder.of(NETWORK).build()); - assertNull(TapChangerAutomationSystemBuilder.of(NETWORK).build()); - assertNull(DynamicOverloadManagementSystemBuilder.of(NETWORK).build()); - assertNull(DynamicTwoLevelsOverloadManagementSystemBuilder.of(NETWORK).build()); - assertNull(PhaseShifterIAutomationSystemBuilder.of(NETWORK).build()); - assertNull(PhaseShifterPAutomationSystemBuilder.of(NETWORK).build()); + void testDefaultModelGetterAutomationSystems() { + assertNotNull(UnderVoltageAutomationSystemBuilder.getDefaultModelInfo()); + assertNotNull(TapChangerBlockingAutomationSystemBuilder.getDefaultModelInfo()); + assertNotNull(TapChangerAutomationSystemBuilder.getDefaultModelInfo()); + assertNotNull(DynamicOverloadManagementSystemBuilder.getDefaultModelInfo()); + assertNotNull(DynamicTwoLevelsOverloadManagementSystemBuilder.getDefaultModelInfo()); + assertNotNull(PhaseShifterIAutomationSystemBuilder.getDefaultModelInfo()); + assertNotNull(PhaseShifterBlockingIAutomationSystemBuilder.getDefaultModelInfo()); + assertNotNull(PhaseShifterPAutomationSystemBuilder.getDefaultModelInfo()); + } + + @Test + void testDefaultModelGetterEquipments() { + // Load + assertNotNull(BaseLoadBuilder.getDefaultModelInfo()); + assertNotNull(LoadOneTransformerBuilder.getDefaultModelInfo()); + assertNotNull(LoadOneTransformerTapChangerBuilder.getDefaultModelInfo()); + assertNotNull(LoadTwoTransformersBuilder.getDefaultModelInfo()); + assertNotNull(LoadTwoTransformersTapChangersBuilder.getDefaultModelInfo()); + // Bus + assertNotNull(StandardBusBuilder.getDefaultModelInfo()); + assertNotNull(InfiniteBusBuilder.getDefaultModelInfo()); + // Transformer + assertNotNull(TransformerFixedRatioBuilder.getDefaultModelInfo()); + // Line + assertNotNull(LineBuilder.getDefaultModelInfo()); + // Generator + assertNotNull(BaseGeneratorBuilder.getDefaultModelInfo()); + assertNotNull(SynchronizedGeneratorBuilder.getDefaultModelInfo()); + assertNotNull(SynchronousGeneratorBuilder.getDefaultModelInfo()); + assertNotNull(WeccBuilder.getDefaultModelInfo()); + assertNotNull(GridFormingConverterBuilder.getDefaultModelInfo()); + assertNotNull(SignalNGeneratorBuilder.getDefaultModelInfo()); + // HVDC + assertNotNull(HvdcPBuilder.getDefaultModelInfo()); + assertNotNull(HvdcVscBuilder.getDefaultModelInfo()); + // Shunt + assertNotNull(BaseShuntBuilder.getDefaultModelInfo()); + // Static var comp + assertNotNull(BaseStaticVarCompensatorBuilder.getDefaultModelInfo()); } @Test @@ -126,7 +161,7 @@ void testWrongLibEquipments() { } @Test - void testNotInstantiableAutomationSystem() { + void testWrongLibAutomationSystem() { assertNull(UnderVoltageAutomationSystemBuilder.of(NETWORK, WRONG_LIB)); assertNull(TapChangerBlockingAutomationSystemBuilder.of(NETWORK, WRONG_LIB)); assertNull(TapChangerAutomationSystemBuilder.of(NETWORK, WRONG_LIB)); @@ -166,4 +201,22 @@ void testNotInstantiableEquipment() { // Static var comp assertNull(BaseStaticVarCompensatorBuilder.of(NETWORK).build()); } + + @Test + void testNotInstantiableAutomationSystem() { + assertNull(UnderVoltageAutomationSystemBuilder.of(NETWORK).build()); + assertNull(TapChangerBlockingAutomationSystemBuilder.of(NETWORK).build()); + assertNull(TapChangerAutomationSystemBuilder.of(NETWORK).build()); + assertNull(DynamicOverloadManagementSystemBuilder.of(NETWORK).build()); + assertNull(DynamicTwoLevelsOverloadManagementSystemBuilder.of(NETWORK).build()); + assertNull(PhaseShifterIAutomationSystemBuilder.of(NETWORK).build()); + assertNull(PhaseShifterPAutomationSystemBuilder.of(NETWORK).build()); + } + + @Test + void testNotInstantiableEvent() { + assertNull(EventActivePowerVariationBuilder.of(NETWORK).build()); + assertNull(NodeFaultEventBuilder.of(NETWORK).build()); + assertNull(EventDisconnectionBuilder.of(NETWORK).build()); + } }