Skip to content

Commit

Permalink
csa profiles groups and dependencies (#889)
Browse files Browse the repository at this point in the history
* first version of csa groups and dependencies -> goal is to discuss design

Signed-off-by: benrejebmoh <[email protected]>

* merge with master and fix cast issue

Signed-off-by: benrejebmoh <[email protected]>

* csa-groups and dependencies + first 2 unit tests of us

Signed-off-by: benrejebmoh <[email protected]>

* csa-groups and dependencies with ssi impl and test

Signed-off-by: benrejebmoh <[email protected]>

* csa-profiles: use propertybag.getId instead of substring to get id

Signed-off-by: benrejebmoh <[email protected]>

* csa-profiles: fix case when several TapPositionActions are linked to the same GridStateAlterationRemedialAction

Signed-off-by: benrejebmoh <[email protected]>

* enhancements after review

Signed-off-by: benrejebmoh <[email protected]>

---------

Signed-off-by: benrejebmoh <[email protected]>
  • Loading branch information
benrejebmoh authored Feb 23, 2024
1 parent 64bbecd commit e2d918d
Show file tree
Hide file tree
Showing 16 changed files with 469 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,16 @@ public PropertyBags getSchemeRemedialActions() {
return getPropertyBags(CsaProfileConstants.REQUEST_SCHEME_REMEDIAL_ACTION, CsaProfileConstants.CsaProfileKeywords.REMEDIAL_ACTION.toString());
}

public PropertyBags getRemedialActionGroups() {
return getPropertyBags(CsaProfileConstants.REQUEST_REMEDIAL_ACTION_GROUP, CsaProfileConstants.CsaProfileKeywords.REMEDIAL_ACTION.toString());

}

public PropertyBags getRemedialActionDependencies() {
return getPropertyBags(CsaProfileConstants.REQUEST_REMEDIAL_ACTION_DEPENDENCY, CsaProfileConstants.CsaProfileKeywords.REMEDIAL_ACTION.toString());

}

public Map<String, String> getOverridingCracData(OffsetDateTime importTimestamp) {
Map<String, String> overridingData = new HashMap<>();
for (CsaProfileConstants.OverridingObjectsFields overridingObject : CsaProfileConstants.OverridingObjectsFields.values()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ public String toString() {
public static final String SIPS = "http://entsoe.eu/ns/nc#RemedialActionSchemeKind.sips";
public static final String NORMAL_ARMED = "normalArmed";
public static final String OVERRIDE_ARMED = "armed";
public static final String DEPENDING_REMEDIAL_ACTION_GROUP = "dependingRemedialActionGroup";
public static final String GRID_STATE_ALTERATION_COLLECTION = "gridStateAlterationCollection";
public static final String GRID_STATE_ALTERATION_REMEDIAL_ACTION = "gridStateAlterationRemedialAction";
public static final String TOPOLOGY_ACTION = "topologyAction";
Expand All @@ -119,7 +120,7 @@ public String toString() {
public static final String TSO = "tso";
public static final String NORMAL_AVAILABLE = "normalAvailable";
public static final String OVERRIDE_AVAILABLE = "available";
public static final String RA_KIND = "kind";
public static final String KIND = "kind";
public static final String COMBINATION_CONSTRAINT_KIND = "combinationConstraintKind";
public static final String SWITCH = "switchId";
public static final String NORMAL_ENABLED = "normalEnabled";
Expand All @@ -128,6 +129,8 @@ public String toString() {
public static final String SHUNT_COMPENSATOR_MODIFICATION = "shuntCompensatorModification";
public static final String SHUNT_COMPENSATOR_ID = "shuntCompensatorId";
public static final String REQUEST_SCHEME_REMEDIAL_ACTION = "schemeRemedialAction";
public static final String REQUEST_REMEDIAL_ACTION_GROUP = "remedialActionGroup";
public static final String REQUEST_REMEDIAL_ACTION_DEPENDENCY = "remedialActionDependency";

public enum PropertyReference {
SWITCH("Switch.open"),
Expand Down Expand Up @@ -346,7 +349,8 @@ public enum OverridingObjectsFields {
ROTATING_MACHINE_ACTION("rotatingMachineActionOverriding", REQUEST_ROTATING_MACHINE_ACTION, NORMAL_ENABLED, OVERRIDE_ENABLED, HeaderType.START_END_DATE),
SHUNT_COMPENSATOR_MODIFICATION("shuntCompensatorModificationOverriding", REQUEST_SHUNT_COMPENSATOR_MODIFICATION, NORMAL_ENABLED, OVERRIDE_ENABLED, HeaderType.START_END_DATE),
TAP_POSITION_ACTION("tapPositionActionOverriding", REQUEST_TAP_POSITION_ACTION, NORMAL_ENABLED, OVERRIDE_ENABLED, HeaderType.START_END_DATE),
SCHEME_REMEDIAL_ACTION("schemeRemedialActionOverriding", REQUEST_SCHEME_REMEDIAL_ACTION, NORMAL_AVAILABLE, OVERRIDE_AVAILABLE, HeaderType.START_END_DATE);
SCHEME_REMEDIAL_ACTION("schemeRemedialActionOverriding", REQUEST_SCHEME_REMEDIAL_ACTION, NORMAL_AVAILABLE, OVERRIDE_AVAILABLE, HeaderType.START_END_DATE),
SCHEME_REMEDIAL_ACTION_DEPENDENCY("remedialActionDependencyOverriding", REQUEST_REMEDIAL_ACTION_DEPENDENCY, NORMAL_ENABLED, OVERRIDE_ENABLED, HeaderType.START_END_DATE);

final String requestName;
final String objectName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ public CsaProfileCracCreationContext createCrac(CsaProfileCrac nativeCrac, Netwo
PropertyBags shuntCompensatorModifications = CsaProfileCracUtils.overrideData(nativeCrac.getShuntCompensatorModifications(), overridingData, CsaProfileConstants.OverridingObjectsFields.SHUNT_COMPENSATOR_MODIFICATION);
PropertyBags tapPositionActions = CsaProfileCracUtils.overrideData(nativeCrac.getTapPositionAction(), overridingData, CsaProfileConstants.OverridingObjectsFields.TAP_POSITION_ACTION);
PropertyBags schemeRemedialActions = CsaProfileCracUtils.overrideData(nativeCrac.getSchemeRemedialActions(), overridingData, CsaProfileConstants.OverridingObjectsFields.SCHEME_REMEDIAL_ACTION);
PropertyBags remedialActionDependencies = CsaProfileCracUtils.overrideData(nativeCrac.getRemedialActionDependencies(), overridingData, CsaProfileConstants.OverridingObjectsFields.SCHEME_REMEDIAL_ACTION_DEPENDENCY);

createContingencies(contingencies, nativeCrac.getContingencyEquipments());
createCnecs(assessedElements, assessedElementsWithContingencies, currentLimits, voltageLimits, angleLimits, cracCreationParameters.getDefaultMonitoredSides());

OnConstraintUsageRuleHelper onConstraintUsageRuleAdder = new OnConstraintUsageRuleHelper(creationContext.getCnecCreationContexts(), assessedElements, assessedElementsWithRemedialAction);

ElementaryActionsHelper elementaryActionsHelper = new ElementaryActionsHelper(gridStateAlterationRemedialAction, schemeRemedialActions, remedialActionSchemes, nativeCrac.getStage(), gridStateAlterationsCollection, assessedElementsWithRemedialAction, contingenciesWithRemedialAction, staticPropertyRanges, topologyActions, rotatingMachineActions, shuntCompensatorModifications, tapPositionActions);
ElementaryActionsHelper elementaryActionsHelper = new ElementaryActionsHelper(gridStateAlterationRemedialAction, schemeRemedialActions, remedialActionSchemes, nativeCrac.getStage(), gridStateAlterationsCollection, assessedElementsWithRemedialAction, contingenciesWithRemedialAction, staticPropertyRanges, topologyActions, rotatingMachineActions, shuntCompensatorModifications, tapPositionActions, nativeCrac.getRemedialActionGroups(), remedialActionDependencies);
createRemedialActions(onConstraintUsageRuleAdder, elementaryActionsHelper);
creationContext.buildCreationReport();
return creationContext.creationSuccess(crac);
Expand Down
Loading

0 comments on commit e2d918d

Please sign in to comment.