Class ContainerNodeUpdateUtil

java.lang.Object
edu.ie3.datamodel.utils.ContainerNodeUpdateUtil

public class ContainerNodeUpdateUtil extends Object
  • Method Details

    • updateGridWithNodes

      public static GridContainer updateGridWithNodes(GridContainer grid, Map<NodeInput,NodeInput> oldToNewNodes)
      Updates the provided GridContainer with the provided mapping of old to new NodeInput entities. When used, one carefully has to check that the mapping is valid. No further sanity checks are provided and if an invalid mapping is passed in, unexpected behavior might occur. All entities holding reference to the old nodes are updates with this method.

      If the geoPosition of one transformer node is altered, all other transformer nodes geoPositions are updated as well based on the update definition defined in updateTransformers(Set, Set, Map) as by convention transformer nodes always needs to have the same geoPosition. If a chain of transformers is present e.g. nodeA - trafoAtoD - nodeD - trafoDtoG - nodeG all affected transformer nodes geoPosition is set to the same location as defined by the update rule defined in updateTransformers(Set, Set, Map)

      Parameters:
      grid - the grid that should be updated
      oldToNewNodes - a mapping of old nodes to their corresponding new or updated nodes
      Returns:
      a copy of the provided grid with updated nodes as provided
    • updateGridWithNodes

      public static JointGridContainer updateGridWithNodes(JointGridContainer grid, Map<NodeInput,NodeInput> oldToNewNodes)
      Updates the provided JointGridContainer with the provided mapping of old to new NodeInput entities. When used, one carefully has to check that the mapping is valid. No further sanity checks are provided and if an invalid mapping is passed in, unexpected behavior might occur. All entities holding reference to the old nodes are updates with this method.

      If the geoPosition of one transformer node is altered, all other transformer nodes geoPositions are updated as well based on the update definition defined in updateTransformers(Set, Set, Map) as by convention transformer nodes always needs to have the same geoPosition. If a chain of transformers is present e.g. nodeA - trafoAtoD - nodeD - trafoDtoG - nodeG all affected transformer nodes geoPosition is set to the same location as defined by the update rule defined in updateTransformers(Set, Set, Map)

      Parameters:
      grid - the grid that should be updated
      oldToNewNodes - a mapping of old nodes to their corresponding new or updated nodes
      Returns:
      a copy of the provided grid with updated nodes as provided
    • updateGridWithNodes

      public static SubGridContainer updateGridWithNodes(SubGridContainer grid, Map<NodeInput,NodeInput> oldToNewNodes)
      Updates the provided SubGridContainer with the provided mapping of old to new NodeInput entities. When used, one carefully has to check that the mapping is valid. No further sanity checks are provided and if an invalid mapping is passed in, unexpected behavior might occur. Furthermore, if the subgrid to be updated is part of a JointGridContainer it is highly advised NOT to update a single subgrid, but the whole joint grid, because in case of transformer node updates on a single subgrid, inconsistency of the overall joint grid might occur. To update the whole joint grid use updateGridWithNodes(JointGridContainer, Map)

      If the geoPosition of one transformer node is altered, all other transformer nodes geoPositions are updated as well based on the update definition defined in updateTransformers(Set, Set, Map) as by convention transformer nodes always needs to have the same geoPosition. If a chain of transformers is present e.g. nodeA - trafoAtoD - nodeD - trafoDtoG - nodeG all affected transformer nodes geoPosition is set to the same location as defined by the update rule defined in updateTransformers(Set, Set, Map)

      Parameters:
      grid - the grid that should be updated
      oldToNewNodes - a mapping of old nodes to their corresponding new or updated nodes
      Returns:
      a copy of the provided grid with updated nodes as provided