Package com.powsybl.openloadflow.graph
Class AbstractGraphConnectivity<V,E>
java.lang.Object
com.powsybl.openloadflow.graph.AbstractGraphConnectivity<V,E>
- All Implemented Interfaces:
GraphConnectivity<V,
E>
- Direct Known Subclasses:
EvenShiloachGraphDecrementalConnectivity
,MinimumSpanningTreeGraphConnectivity
,NaiveGraphConnectivity
public abstract class AbstractGraphConnectivity<V,E>
extends Object
implements GraphConnectivity<V,E>
- Author:
- Florian Dupuy <florian.dupuy at rte-france.com>
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
protected ModificationsContext<V,
E> protected void
checkVertex
(V vertex) int
getComponentNumber
(V vertex) Return the number of the connected component containing the given vertex, knowing that the number represents the size ranking of the related connected component in the graph, 0 being the main connected component.getConnectedComponent
(V vertex) Return the connected component set of given vertexReturn the edges which were added to main component by last temporary changes.Return the edges which were removed from main component by last temporary changes.getGraph()
protected Deque<ModificationsContext<V,
E>> int
Return the number of connected componentsgetNonConnectedVertices
(V vertex) protected abstract int
getQuickComponentNumber
(V vertex) protected Collection<Set<V>>
Return the vertices which were added to main component by last temporary changes.Return the vertices which were removed from main component by last temporary changes.void
removeEdge
(E edge) protected abstract void
void
setMainComponentVertex
(V mainComponentVertex) Set the main component with given vertex.void
Start recording topological changes to undo them later by aGraphConnectivity.undoTemporaryChanges()
call.void
Undo all the connectivity changes (possibly none) since last call toGraphConnectivity.startTemporaryChanges()
.protected abstract void
protected abstract void
updateConnectivity
(EdgeAdd<V, E> edgeAdd) protected abstract void
updateConnectivity
(EdgeRemove<V, E> edgeRemove) protected abstract void
updateConnectivity
(VertexAdd<V, E> vertexAdd) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.powsybl.openloadflow.graph.GraphConnectivity
supportTemporaryChangesNesting
-
Field Details
-
componentSets
-
-
Constructor Details
-
AbstractGraphConnectivity
public AbstractGraphConnectivity()
-
-
Method Details
-
updateConnectivity
-
updateConnectivity
-
updateConnectivity
-
resetConnectivity
-
updateComponents
protected abstract void updateComponents() -
addVertex
- Specified by:
addVertex
in interfaceGraphConnectivity<V,
E>
-
addEdge
- Specified by:
addEdge
in interfaceGraphConnectivity<V,
E>
-
removeEdge
- Specified by:
removeEdge
in interfaceGraphConnectivity<V,
E>
-
startTemporaryChanges
public void startTemporaryChanges()Description copied from interface:GraphConnectivity
Start recording topological changes to undo them later by aGraphConnectivity.undoTemporaryChanges()
call.- Specified by:
startTemporaryChanges
in interfaceGraphConnectivity<V,
E>
-
undoTemporaryChanges
public void undoTemporaryChanges()Description copied from interface:GraphConnectivity
Undo all the connectivity changes (possibly none) since last call toGraphConnectivity.startTemporaryChanges()
.- Specified by:
undoTemporaryChanges
in interfaceGraphConnectivity<V,
E>
-
getComponentNumber
Description copied from interface:GraphConnectivity
Return the number of the connected component containing the given vertex, knowing that the number represents the size ranking of the related connected component in the graph, 0 being the main connected component. Hence, the greater the component number is, the smaller the number of vertices in that component.- Specified by:
getComponentNumber
in interfaceGraphConnectivity<V,
E> - Parameters:
vertex
- the vertex whose connected component number is looked for- Returns:
- the number of the related connected component
-
getQuickComponentNumber
-
getNbConnectedComponents
public int getNbConnectedComponents()Description copied from interface:GraphConnectivity
Return the number of connected components- Specified by:
getNbConnectedComponents
in interfaceGraphConnectivity<V,
E>
-
getSmallComponents
-
getConnectedComponent
Description copied from interface:GraphConnectivity
Return the connected component set of given vertex- Specified by:
getConnectedComponent
in interfaceGraphConnectivity<V,
E>
-
getNonConnectedVertices
-
getGraph
-
getModificationsContexts
-
checkSavedContext
-
checkVertex
-
getVerticesAddedToMainComponent
Description copied from interface:GraphConnectivity
Return the vertices which were added to main component by last temporary changes. The main component is set by calling setMainComponentVertex, or if not set it is the biggest connected component.- Specified by:
getVerticesAddedToMainComponent
in interfaceGraphConnectivity<V,
E>
-
getEdgesAddedToMainComponent
Description copied from interface:GraphConnectivity
Return the edges which were added to main component by last temporary changes. The main component is set by calling setMainComponentVertex, or if not set it is the biggest connected component.- Specified by:
getEdgesAddedToMainComponent
in interfaceGraphConnectivity<V,
E>
-
getVerticesRemovedFromMainComponent
Description copied from interface:GraphConnectivity
Return the vertices which were removed from main component by last temporary changes. The main component is set by calling setMainComponentVertex, or if not set it is the biggest connected component.- Specified by:
getVerticesRemovedFromMainComponent
in interfaceGraphConnectivity<V,
E>
-
getEdgesRemovedFromMainComponent
Description copied from interface:GraphConnectivity
Return the edges which were removed from main component by last temporary changes. The main component is set by calling setMainComponentVertex, or if not set it is the biggest connected component.- Specified by:
getEdgesRemovedFromMainComponent
in interfaceGraphConnectivity<V,
E>
-
setMainComponentVertex
Description copied from interface:GraphConnectivity
Set the main component with given vertex. The connected component relative to this vertex is considered as being the main component. If not set, the main component is considered to be the biggest component. This main component cannot be changed if any temporary changes are ongoing.- Specified by:
setMainComponentVertex
in interfaceGraphConnectivity<V,
E> - Parameters:
mainComponentVertex
- vertex defining main component
-