Skip to content

Commit

Permalink
Call new Security::checkLimits method
Browse files Browse the repository at this point in the history
  • Loading branch information
quinarygio committed May 16, 2017
1 parent 58db877 commit cd4ad96
Showing 1 changed file with 2 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,8 @@ public Void call() throws Exception {
// stores violations only if loadflow converges
logger.info("{}: storing violations after {} in online db", stateId, OnlineStep.LOAD_FLOW);
List<LimitViolation> violations = Security.checkLimits(context.getNetwork(),
CurrentLimitType.PATL,
parameters.getLimitReduction());
List<LimitViolation> temp_violations = Security.checkLimits(context.getNetwork(),
CurrentLimitType.TATL,
parameters.getLimitReduction());
if(violations == null)
violations = temp_violations;
else
if (temp_violations != null)
violations.addAll(temp_violations);


if (violations != null && !violations.isEmpty()) {
onlineDb.storeViolations(context.getWorkflowId(), stateId, OnlineStep.LOAD_FLOW, violations);
if (parameters.isHandleViolationsInN()) {
Expand Down Expand Up @@ -391,13 +382,7 @@ public Void call() throws Exception {
boolean loadflowConverge = computePostContingencyState(network, stateId, contingency, postContingencyStateId);
if (loadflowConverge) {
logger.info("{}: computing post contingency violations for contingency {}", stateId, contingency.getId());
violations = Security.checkLimits(network, CurrentLimitType.PATL, parameters.getLimitReduction());
List<LimitViolation> temp_violations = Security.checkLimits(network, CurrentLimitType.TATL, parameters.getLimitReduction());
if(violations == null)
violations = temp_violations;
else
if (temp_violations != null)
violations.addAll(temp_violations);
violations = Security.checkLimits(network, parameters.getLimitReduction());

if (violations == null || violations.isEmpty()) {
logger.info("{}: no post contingency violations for contingency {}", stateId, contingency.getId());
Expand Down

0 comments on commit cd4ad96

Please sign in to comment.