-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Guillaume Verger <guillaume.verger@artelys.com>
- Loading branch information
Showing
4 changed files
with
39 additions
and
24 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
flow-decomposition/src/main/java/com/powsybl/flow_decomposition/AcReferenceFlowComputer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright (c) 2024, Coreso SA (https://www.coreso.eu/) and TSCNET Services GmbH (https://www.tscnet.eu/) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
* SPDX-License-Identifier: MPL-2.0 | ||
*/ | ||
package com.powsybl.flow_decomposition; | ||
|
||
import com.powsybl.iidm.network.Branch; | ||
import com.powsybl.iidm.network.Identifiable; | ||
|
||
import java.util.Collection; | ||
import java.util.Map; | ||
import java.util.stream.Collectors; | ||
|
||
/** | ||
* @author Guillaume Verger {@literal <guillaume.verger at artelys.com>} | ||
*/ | ||
class AcReferenceFlowComputer { | ||
private static ReferenceFlowComputer flowComputer = new ReferenceFlowComputer(); | ||
|
||
Map<String, Double> run(Collection<Branch> xnecList, LoadFlowRunningService.Result loadFlowServiceAcResult) { | ||
if (loadFlowServiceAcResult.fallbackHasBeenActivated()) { | ||
return xnecList.stream().collect(Collectors.toMap(Identifiable::getId, branch -> Double.NaN)); | ||
} | ||
|
||
return flowComputer.run(xnecList); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters