Packages

c

ch.ninecode.cim

CIMNetworkTopologyProcessor

case class CIMNetworkTopologyProcessor(spark: SparkSession) extends CIMRDD with Product with Serializable

Create a topology.

Create TopologicalNode and optionally TopologicalIsland RDD that encode the connections between electrical elements and updates the Terminal and ConnectivityNode RDD to reference them.

This creates a "bus-branch" model, but retains the "node-breaker" model.

Based on ConnectivityNode elements and connecting edges, find the topology that has:

  • each substation has a single bus (TopologicalNode) at each nominal voltage level for each set of BusbarSection that are connected by closed switches
  • eliminates switches based on their open/closed state
  • assigns each ConnectivityNode to exactly one TopologicalNode
  • assigns each TopologicalNode to exactly one TopologicalIsland (islands are un-connected groups of internally-connected TopologicalNode)
  • assigns to each TopologicalNode only one ConnectivityNodeContainer (a new unique generated container or one of the possibly many different existing ConnectivityNodeContainer (Bay, Line, Substation, VoltageLevel) of all the ConnectivityNode with the same TopologicalNode)

There are flags that affect whether a Switch (force_retain_switches) or Fuse (force_retain_fuses) is included in the topology:

force_retain_switches Switch.retain Switch.open/
Switch.normalOpen
in Topology
ForceTrue don’t care don’t care yes
ForceFalse don’t care true yes
false no
Unforced true don’t care yes
false true yes
false no
To be done eventually: - create EquivalentEquipment (branch, injection, shunt) for an EquivalentNetwork

spark

The session with CIM RDD defined, for which the topology should be calculated

Linear Supertypes
Serializable, Serializable, Product, Equals, CIMRDD, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CIMNetworkTopologyProcessor
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. CIMRDD
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new CIMNetworkTopologyProcessor(spark: SparkSession)

    spark

    The session with CIM RDD defined, for which the topology should be calculated

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def asDataSet[T <: Product](implicit arg0: ClassTag[T], arg1: scala.reflect.api.JavaUniverse.TypeTag[T], spark: SparkSession): Dataset[T]

    Get a typed DataSet for the given class.

    Get a typed DataSet for the given class.

    T

    The type of RDD.

    spark

    The Spark session.

    returns

    A typed dataset of the RDD.

    Definition Classes
    CIMRDD
  5. def asEdge(e: CIMEdgeData): Edge[CIMEdgeData]

    Create a GraphX Edge.

    Create a GraphX Edge.

    e

    the data to pack in the edge

    returns

    an Edge[T] object

  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def asVertexId(string: String): VertexId

    Compute the hash code for the string to be used as a VertextId (Long).

    Compute the hash code for the string to be used as a VertextId (Long).

    string

    the mRID to convert into a VertexId

    returns

    the VertexId for the mRID

  8. def biggest(name: String): (Int, (Int, RDD[_])) ⇒ Int

    Find the largest integer after the name| pattern in a foldLeft operation.

    Find the largest integer after the name| pattern in a foldLeft operation.

    name

    the name to check

    Definition Classes
    CIMRDD
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  10. def conductingEquipment(element: Element): Option[ConductingEquipment]

    Get the underlying ConductingEquipment superclass.

    Get the underlying ConductingEquipment superclass.

    element

    the element to traverse

    returns

    Some(ConductingEquipment) or None if the Element is not a ConductingEquipment subclass

  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def get[T](implicit arg0: ClassTag[T], spark: SparkSession, log: Logger): RDD[T]

    Get the typed RDD.

    Get the typed RDD.

    Convenience method where the name of the RDD is the same as the contained class type (the usual case).

    T

    The type of the RDD, e.g. RDD[T].

    spark

    The Spark session which persisted the typed RDD.

    log

    A logger for error messages.

    returns

    The RDD with the given type of objects, e.g. RDD[ACLineSegment].

    Definition Classes
    CIMRDD
  13. def get[T](name: String)(implicit arg0: ClassTag[T], spark: SparkSession, log: Logger): RDD[T]

    Get the named RDD.

    Get the named RDD.

    T

    The type of objects contained in the named RDD.

    name

    The name of the RDD, usually the same as the CIM class.

    spark

    The Spark session which persisted the named RDD.

    log

    A logger for error messages.

    returns

    The typed RDD, e.g. RDD[T].

    Definition Classes
    CIMRDD
    Example:
    1. The RDD of all elements is somewhat special, currently it is named Elements (plural), so this method must be used:

      val elements: RDD[Element] = get[Element]("Elements")
  14. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  15. def getOrElse[T](implicit arg0: ClassTag[T], spark: SparkSession): RDD[T]

    Get the typed RDD or an empty RDD if none was registered.

    Get the typed RDD or an empty RDD if none was registered.

    Convenience method where the name of the RDD is the same as the contained class type (the usual case).

    T

    The type of the RDD, e.g. RDD[T].

    spark

    The Spark session which persisted the typed RDD.

    returns

    The RDD with the given type of objects, e.g. RDD[ACLineSegment], or an empty RDD of the requested type.

    Definition Classes
    CIMRDD
  16. def getOrElse[T](name: String)(implicit arg0: ClassTag[T], spark: SparkSession): RDD[T]

    Get the named RDD or else an empty RDD of the requested type.

    Get the named RDD or else an empty RDD of the requested type.

    T

    The type of objects contained in the named RDD.

    name

    The name of the RDD, usually the same as the CIM class.

    spark

    The Spark session which persisted the named RDD.

    returns

    The typed RDD, e.g. RDD[T], as either the persisted RDD or an empty one if none was found.

    Definition Classes
    CIMRDD
  17. def identifyIslands(graph: Graph[CIMVertexData, CIMEdgeData]): Graph[CIMVertexData, CIMEdgeData]

    Use GraphX to identify nodes that are connected electrically

    Use GraphX to identify nodes that are connected electrically

    graph

    The results from the topological node processing step.

    returns

    A new graph with vertices having island information.

    See also

    isSameIsland(Element)

  18. def identifyNodes(graph: Graph[CIMVD, CIMEdgeData]): Graph[CIMVertexData, CIMEdgeData]
  19. def isFuseOneIsland(switch: Switch): Boolean

    Method to determine if a fuse can be represented as a single topological island.

    Method to determine if a fuse can be represented as a single topological island.

    switch

    The fuse object to test.

    returns

    true if the fuse is effectively one island, false otherwise.

  20. def isFuseOneNode(switch: Switch): Boolean

    Method to determine if a fuse can be represented as a single topological node.

    Method to determine if a fuse can be represented as a single topological node.

    switch

    The fuse object to test.

    returns

    true if the fuse is effectively one node, false otherwise.

  21. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  22. def isSameIsland(element: Element): Boolean

    Method to determine if the nodes for an element are in the same topological island.

    Method to determine if the nodes for an element are in the same topological island.

    element

    The element to test.

    returns

    true if the element is effectively one node, false otherwise.

  23. def isSameNode(element: Element): Boolean

    Method to determine if the nodes for an element are the same topological node.

    Method to determine if the nodes for an element are the same topological node.

    element

    The element to test.

    returns

    true if the element is effectively one node, false otherwise.

  24. def isSwitchOneIsland(switch: Switch): Boolean

    Method to determine if a switch can be represented as a single topological island.

    Method to determine if a switch can be represented as a single topological island.

    switch

    The switch object to test.

    returns

    true if the switch is effectively one island, false otherwise.

  25. def isSwitchOneNode(switch: Switch): Boolean

    Method to determine if a switch can be represented as a single topological node.

    Method to determine if a switch can be represented as a single topological node.

    switch

    The switch object to test.

    returns

    true if the switch is effectively one node, false otherwise.

  26. def islandMergeMessage(a: CIMIslandData, b: CIMIslandData): CIMIslandData
  27. def islandSendMessage(triplet: EdgeTriplet[CIMIslandData, CIMEdgeData]): Iterator[(VertexId, CIMIslandData)]
  28. def islandVertex(id: VertexId, attr: CIMIslandData, msg: CIMIslandData): CIMIslandData
  29. def like(name: String): ((Int, RDD[_])) ⇒ Boolean

    Match names with pattern "name|xxx".

    Match names with pattern "name|xxx".

    name

    the name to match

    returns

    true if the RDD name matches the pattern

    Definition Classes
    CIMRDD
  30. def makeGraph(): Graph[CIMVD, CIMEdgeData]
  31. def nameOf[T](implicit arg0: ClassTag[T]): String

    Get the base name of the CIM class.

    Get the base name of the CIM class.

    T

    The type of the class.

    returns

    The base name of the class.

    Definition Classes
    CIMRDD
  32. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  33. def nodeMergeMessage(a: CIMVD, b: CIMVD): CIMVD
  34. def nodeSendMessage(triplet: EdgeTriplet[CIMVD, CIMEdgeData]): Iterator[(VertexId, CIMVD)]
  35. def nodeVertex(id: VertexId, data: CIMVD, message: CIMVD): CIMVD
  36. val normalOpenMask: Int

    Index of normalOpen field in Switch bitmask.

  37. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  38. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  39. val openMask: Int

    Index of open field in Switch bitmask.

  40. var options: CIMTopologyOptions

    Options in effect for the process operation.

  41. def process(_options: CIMTopologyOptions): RDD[Element]

    Create new TopologicalNode and optionally TopologicalIsland RDD based on connectivity.

    Create new TopologicalNode and optionally TopologicalIsland RDD based on connectivity.

    Any existing RDDs with these names will be unpersisted. Hierarchical nested case class RDDs will also be updated.

    returns

    The new Elements RDD - with TopologicalNode and TopologicalIsland objects included.

  42. def processIfNeeded(_options: CIMTopologyOptions): RDD[Element]

    Conditionally create new TopologicalNode and optionally TopologicalIsland RDD based on connectivity.

    Conditionally create new TopologicalNode and optionally TopologicalIsland RDD based on connectivity.

    Note, if these RDD exist and are already populated, this method does nothing. Otherwise it calls the process method.

    returns

    Either the old Elements RDD or a new Elements RDD - with TopologicalNode and TopologicalIsland objects included.

  43. def put[T <: Product](rdd: RDD[T], keep: Boolean = false)(implicit arg0: ClassTag[T], arg1: scala.reflect.api.JavaUniverse.TypeTag[T], spark: SparkSession, storage: StorageLevel): Unit

    Persist the typed RDD using the class name, checkpoint it if that is enabled, and create the SQL view for it.

    Persist the typed RDD using the class name, checkpoint it if that is enabled, and create the SQL view for it.

    T

    The type of RDD.

    rdd

    The RDD to persist

    keep

    If true then don't unpersist any existing RDD with the given name.

    spark

    The Spark session.

    storage

    The storage level for persistence.

    Definition Classes
    CIMRDD
  44. def put[T <: Product](rdd: RDD[T], name: String, keep: Boolean)(implicit arg0: ClassTag[T], arg1: scala.reflect.api.JavaUniverse.TypeTag[T], spark: SparkSession, storage: StorageLevel): Unit

    Persist the typed RDD using the given name, checkpoint it if that is enabled, and create the SQL view for it.

    Persist the typed RDD using the given name, checkpoint it if that is enabled, and create the SQL view for it.

    Since the use of RDD persistence can be problematic for memory reuse, the keep parameter has special processing. When keep is true any existing RDD of the same name is renamed to name|n where n is sequentially increasing to the next available integer. When keep is false all existing RDD of the above form are unpersisted.

    This facilitates the use-case where the new RDD depends on the existing one. For example, the Elements RDD is rewritten by about, dedup, join, normalize and topological processing, where the new RDD is derived from the original. But when a completely new CIM RDF file is read in, keep=false will unpersist all the derived RDD.

    T

    The type of RDD.

    rdd

    The RDD to persist

    name

    The name under which to persist it.

    keep

    If true then don't unpersist the existing RDD with the given name.

    spark

    The Spark session.

    storage

    The storage level for persistence.

    returns

    The named, viewed and possibly checkpointed original RDD.

    Definition Classes
    CIMRDD
  45. def retainFuse(switch: Switch): Boolean

    Method to determine if a fuse should be retained in the topology.

    Method to determine if a fuse should be retained in the topology.

    switch

    The switch object to test.

    returns

    true if the switch should be retained, false otherwise.

  46. def retainSwitch(switch: Switch): Boolean

    Method to determine if a switch should be retained in the topology.

    Method to determine if a switch should be retained in the topology.

    switch

    The switch object to test.

    returns

    true if the switch should be retained, false otherwise.

  47. val retainedMask: Int

    Index of retained field in Switch bitmask.

  48. val spark: SparkSession
  49. def switchClosed(switch: Switch): Boolean

    Method to determine if a switch is closed (both terminals are the same topological node).

    Method to determine if a switch is closed (both terminals are the same topological node).

    If the switch has the open attribute set, use that. Otherwise if it has the normalOpen attribute set, use that. Otherwise assume it is the default state set by CIMTopologyOptions.default_switch_open_state which means not closed unless explicitly set.

    switch

    The switch object to test.

    returns

    true if the switch is closed, false otherwise.

  50. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  51. def test[T](implicit arg0: ClassTag[T], spark: SparkSession): Boolean

    Check for the typed RDD.

    Check for the typed RDD.

    Convenience method where the name of the RDD is the same as the contained class type (the usual case).

    T

    The type of the RDD, e.g. RDD[T].

    spark

    The Spark session which persisted the typed RDD.

    returns

    true if the named RDD exists, false otherwise.

    Definition Classes
    CIMRDD
  52. def test[T](name: String)(implicit arg0: ClassTag[T], spark: SparkSession): Boolean

    Check for the named RDD.

    Check for the named RDD.

    T

    The type of objects contained in the named RDD.

    name

    The name of the RDD, usually the same as the CIM class.

    spark

    The Spark session which persisted the named RDD.

    returns

    true if the named RDD exists, false otherwise.

    Definition Classes
    CIMRDD
  53. def toEdges(args: (Element, Iterable[Terminal])): List[CIMEdgeData]

    Construct edges for terminal pairs of this equipment.

    Construct edges for terminal pairs of this equipment.

    args

    Element (ConductingEquipment) and the Terminal that reference it

    returns

    edges for each terminal pair

  54. def toInt(s: String): Option[Int]
    Definition Classes
    CIMRDD
  55. def toVertex(a: (ConnectivityNode, String)): CIMVD

    Construct vertex data for the ConnectivityNode and voltage.

    Construct vertex data for the ConnectivityNode and voltage.

    a

    the ConnectivityNode and its voltage

    returns

    the data for the vertex

  56. def to_islands(nodes: Iterable[((CIMVertexData, ConnectivityNode), Option[(Terminal, Element)])]): (VertexId, TopologicalIsland)
  57. def to_nodes(arg: (VertexId, CIMVertexData, Option[TopologicalIsland])): TopologicalNode
  58. def update_cn(arg: (ConnectivityNode, Option[CIMVertexData])): ConnectivityNode
  59. def update_terminals(arg: (Terminal, Option[CIMVertexData])): Terminal
  60. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  61. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  62. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from CIMRDD

Inherited from AnyRef

Inherited from Any

Ungrouped