Skip to content

Commit

Permalink
Fix typo and javadoc
Browse files Browse the repository at this point in the history
Check if BBS is in main connected component

Signed-off-by: lisrte <[email protected]>
  • Loading branch information
Lisrte committed May 15, 2024
1 parent 7d3572b commit 368bd36
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,27 @@ private BuildersUtil() {
}

/**
* Returns the ActionConnectionPoint (bus or bus bar section) identified by the staticId parameter
* Verifies the point is properly energized, if not returns null
* Returns the ActionConnectionPoint (bus or busbar section) identified by the staticId parameter
* Verifies the point is energized and in main connected component, if not returns null
* @param network the network containing the ActionConnectionPoint
* @param staticId the identifiable id
* @return the energized action connection point if found, <code>null</code> instead
*/
public static Identifiable<?> getActionConnectionPoint(Network network, String staticId) {
BusbarSection busbarSection = network.getBusbarSection(staticId);
return busbarSection != null && !Double.isNaN(busbarSection.getV())
? busbarSection
: getEnergizedBus(network.getBusBreakerView().getBus(staticId));
if(busbarSection != null && isEnergizedBus(busbarSection.getTerminal().getBusBreakerView().getBus())) {
return busbarSection;
}
Bus bus = network.getBusBreakerView().getBus(staticId);
return isEnergizedBus(bus) ? bus : null;
}

/**
* Verifies and returns the bus if it is properly energized, if not returns null
* Verifies a bus is energized and in main connected component
* @param bus the reviewed bus
* @return the energized bus if found, <code>null</code> instead
* @return <code>true</code> if energized, <code>false</code> if not
*/
private static Bus getEnergizedBus(Bus bus) {
return bus != null && bus.isInMainConnectedComponent() && !Double.isNaN(bus.getV()) ? bus : null;
private static boolean isEnergizedBus(Bus bus) {
return bus != null && !Double.isNaN(bus.getV()) && bus.isInMainConnectedComponent();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.util.Optional;

/**
* Interface for buses and bsu bar sections used by automatons for measure or event for various actions
* Interface for buses and busbar sections used by automatons for measure or event for various actions
* @author Laurent Issertial {@literal <laurent.issertial at rte-france.com>}
*/
public interface ActionConnectionPoint extends Model {
Expand Down

0 comments on commit 368bd36

Please sign in to comment.