PositionFinder¶
Definitions and goal¶
The positioning of the BusNodes and the determination of the order and direction of the cells connected to a bus (i.e. all
cells except ShuntCell) are performed by implementing the PositionFinder interface:
List<Subsection> buildLayout(VoltageLevelGraph graph, boolean handleShunt);
The goal is to:
set the structural vertical and horizontal position of the
BusNodes, i.e. theirbusbarIndex(which busbar row they belong to) andsectionIndex(their order within that row), throughBusNode.setBusBarIndexSectionIndex. These indices are later used (outsidePositionFinder, inBlockPositionner) to compute the actualh,vPositionof theBusNodes(BusNode.setPosition).set the horizontal order and the direction (
TOP/BOTTOM) of theBusCells(ExternCellorder,Celldirection, …)provide a
List<Subsection>. See Subsection.
The handleShunt parameter, when true, tells the underlying Subsection::createSubsections (see below) to also take
ShuntCell into account when computing the List<Subsection>.
The picture hereafter shows the information that is to be established.
(h,v) positions of
BusNodes and ExternCell cells order
Available implementations¶
Two implementations are available:
PositionPredefinedwhich relies on explicitly given positions (for example, to reflect the on-site real structure and/or the way the SCADA organizes it). See PositionPredefinedPositionByClusteringwhich finds an organization of theVoltageLevelwith no other information than the graph itself. See PositionByClustering
Both rely on the BSCluster (see BSCluster) and extend the same AbstractPositionFinder class, which
implements buildLayout as a template method relying on 3 abstract methods that each implementation has to provide:
indexBusPosition, which builds theMap<BusNode, Integer> busToNbused to order theBusNodesinside aVerticalBusSet(see step 1 below),organizeBusSets, which builds the initialList<BSCluster>(one perVerticalBusSet) and merges them into a singleBSCluster(see steps 2 and 3 below),organizeDirections, which, once theList<Subsection>is built (see step 4 below), finalizes the direction of the cells (for example, aligning theExternCellslinked by aShuntCell).
This results in the following common skeleton:
Step 1: Build of
VerticalBusSetsStep 2: Build of unitary
BSClusterin thebsClusterslistStep 3: Merge of
bsClustersinto a singleBSClusterStep 4: Build of the
List<Subsection>subsectionsStep 5: Organize the direction of the cells
Steps 1 and 4 are common to both implementations (respectively provided by VerticalBusSet::createVerticalBusSets and
Subsection::createSubsections), while steps 2, 3 and 5 are specific to each implementation, as detailed below.
Illustration of algorithms based on BSCluster¶
The illustration will be based on the following graph and shall result in the above layout.
Step 1: Build VerticalBusSets¶
The result of VerticalBusSet.createVerticalBusSets is
VerticalBusSet |
BusNodes |
ExternCells |
InternCellSides |
|---|---|---|---|
vbs-1 |
B3, B1 |
EC1 |
IC2.R, IC3.L |
vbs-2 |
B2 |
IC1.L |
|
vbs-3 |
B1, B4 |
EC2, EC3, EC4 |
IC3.R |
vbs-4 |
B5 |
IC1.R, IC2.L |
Note: At that stage, the
LEFTandRIGHTside of anInternCellis arbitrary. They will be flipped if necessary later on (handled inSubsection.createSubsections).
Step 2: Build unitary BSClusters¶
This consist in creating one BSCluster per VerticalBusSet. This results in:
BSCluster |
VerticalBusSets |
HorizontalBusLists |
|---|---|---|
bsc-1 |
[ ( [B3, B1] , [EC1] , [IC2.R, IC3.L] ) ] |
[ [B3] , [B1] ] |
bsc-2 |
[ ( [B2] , , [IC1.L] ) ] |
[ [B2] ] |
bsc-3 |
[ ( [B1, B4] , [EC2, EC3, EC4] , [IC3.R] ) ] |
[ [B1], [B4] ] |
bsc-4 |
[ ( [B5] , , [IC1.R , IC2.L] ) ] |
[ [B5] ] |
Important - On this result:
It is representative of the general case. But note that for
PositionPredefined, theverticalBusSetsis sorted to end up to a ready-to-mergebsClusters. See PositionPredefined.In this picture, the
NodeBusare on different rows to show that they are not necessarily aligned. Only bothB1will necessarily be on the same row.
Step 3: Merge BSClusters into a single one¶
That’s where the magic happens. This is where the implementations mainly differ. The goal is to merge the BSClusters to one another.
The principle of the merging of a BSCluster is:
simply concatenate the
VerticalBusSetlists (theVerticalBusSetsthemselves are never merged together, they just get appended to one another)merge the
HorizontalBusListusing a proper implementation ofHorizontalBusListsMerger::apply.
The expected result, once all the bsClusters have been merged into a single one, should be similar to the following BSCluster:
VerticalBusSets |
HorizontalBusLists |
|---|---|
|
|
Once the final BSCluster is ready, BSCluster.establishBusNodePosition iterates over its HorizontalBusLists (one per
row) and calls HorizontalBusList.establishBusPosition, which sets, on each BusNode of the row, its busbarIndex
(the row index) and sectionIndex (its order inside that row). Note that PositionPredefined does not need this step,
since it relies on busbarIndex/sectionIndex already set on the BusNodes (see PositionPredefined).
The way this example is handled, step by step, is detailed in each implementation documentation: PositionPredefined, PositionByClustering.
Step 4: Build the List<Subsection>¶
Done by calling Subsection::createSubsections, passing it the handleShunt parameter received by buildLayout. See Subsection.
Step 5: Organize the direction of the cells¶
Once the List<Subsection> is built, each implementation of PositionFinder finalizes, in its own organizeDirections
method, the Direction (TOP/BOTTOM) of the cells that could not be safely decided earlier (typically to keep the
ExternCells linked by a ShuntCell consistent with one another).