Skip to content

Commit

Permalink
Merge loads optimization for network store IIDM impl (#283)
Browse files Browse the repository at this point in the history
Signed-off-by: Geoffroy Jamgotchian <geoffroy.jamgotchian@rte-france.com>
  • Loading branch information
geofjamg authored Sep 26, 2023
1 parent a2cfde7 commit 69389d4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,9 @@ private static void updateLoads(Network targetNetwork, Network sourceNetwork, bo
update(targetNetwork.getLoad(sourceLoad.getId()).getTerminal(), sourceLoad.getTerminal());
}
} else {
Map<String, Bus> sourceBusesById = sourceNetwork.getBusBreakerView().getBusStream().collect(Collectors.toMap(Identifiable::getId, Function.identity()));
for (Bus busTarget : targetNetwork.getBusBreakerView().getBuses()) {
updateLoads(busTarget, sourceNetwork.getBusBreakerView().getBus(busTarget.getId()));
updateLoads(busTarget, sourceBusesById.get(busTarget.getId()));
}
}
}
Expand Down

0 comments on commit 69389d4

Please sign in to comment.