Class ProcessTopologyAnalyzer

java.lang.Object
neqsim.process.util.topology.ProcessTopologyAnalyzer
All Implemented Interfaces:
Serializable

public class ProcessTopologyAnalyzer extends Object implements Serializable
Analyzes the topology (graph structure) of a process system.

Extracts:

  • Functional sequence (what comes before/after)
  • Parallel equipment (redundant units)
  • Dependencies between equipment
  • Critical paths through the process

This enables answering questions like:

  • "If pump A fails, what equipment is affected?"
  • "Which equipment can run in parallel?"
  • "What is the critical path through the process?"
Version:
1.0
Author:
NeqSim Development Team
See Also:
  • Field Details

  • Constructor Details

    • ProcessTopologyAnalyzer

      public ProcessTopologyAnalyzer(ProcessSystem processSystem)
      Creates a new topology analyzer for a process system.
      Parameters:
      processSystem - the process system to analyze
  • Method Details

    • buildTopology

      public void buildTopology()
      Builds the process topology graph.
    • buildEdgesFromStreams

      private void buildEdgesFromStreams()
    • getOutletStream

      private StreamInterface getOutletStream(ProcessEquipmentInterface equipment)
    • getOutletStreams

      private List<StreamInterface> getOutletStreams(ProcessEquipmentInterface equipment)
    • getInletStream

      private StreamInterface getInletStream(ProcessEquipmentInterface equipment)
    • getInletStreams

      private List<StreamInterface> getInletStreams(ProcessEquipmentInterface equipment)
    • calculateTopologicalOrder

      private void calculateTopologicalOrder()
    • identifyParallelEquipment

      private void identifyParallelEquipment()
    • hasSameUpstream

      private boolean hasSameUpstream(ProcessTopologyAnalyzer.EquipmentNode node1, ProcessTopologyAnalyzer.EquipmentNode node2)
    • hasSameDownstream

      private boolean hasSameDownstream(ProcessTopologyAnalyzer.EquipmentNode node1, ProcessTopologyAnalyzer.EquipmentNode node2)
    • calculateCriticality

      private void calculateCriticality()
    • countAllDownstream

      private int countAllDownstream(String equipmentName)
    • setFunctionalLocation

      public void setFunctionalLocation(String equipmentName, String stidTag)
      Assigns a functional location to an equipment unit.
      Parameters:
      equipmentName - the equipment name in the process
      stidTag - the STID tag (e.g., "1775-KA-23011A")
    • setFunctionalLocation

      public void setFunctionalLocation(String equipmentName, FunctionalLocation location)
      Assigns a functional location to an equipment unit.
      Parameters:
      equipmentName - the equipment name
      location - the functional location object
    • getAffectedByFailure

      public List<String> getAffectedByFailure(String equipmentName)
      Gets all equipment affected by failure of a specific unit.
      Parameters:
      equipmentName - the failed equipment
      Returns:
      list of affected equipment names
    • getIncreasedCriticalityOn

      public Map<String,Double> getIncreasedCriticalityOn(String failedEquipment)
      Gets equipment that becomes more critical when another fails.

      This answers: "If X fails, what must we watch more carefully?"

      Parameters:
      failedEquipment - the equipment that failed
      Returns:
      map of equipment name to increased criticality
    • getUpstreamEquipment

      public List<String> getUpstreamEquipment(String equipmentName)
      Gets equipment upstream of a specific unit.
      Parameters:
      equipmentName - the equipment name
      Returns:
      list of upstream equipment
    • getDownstreamEquipment

      public List<String> getDownstreamEquipment(String equipmentName)
      Gets equipment downstream of a specific unit.
      Parameters:
      equipmentName - the equipment name
      Returns:
      list of downstream equipment
    • getParallelEquipment

      public List<String> getParallelEquipment(String equipmentName)
      Gets parallel equipment for a specific unit.
      Parameters:
      equipmentName - the equipment name
      Returns:
      list of parallel equipment
    • getParallelGroups

      public List<List<String>> getParallelGroups()
      Gets all parallel equipment groups.
      Returns:
      list of parallel groups (each group is a list of equipment names)
    • getTopologicalOrder

      public Map<String,Integer> getTopologicalOrder()
      Gets the topological order of equipment.
      Returns:
      map of equipment name to order (0 = first in process)
    • getNodes

      Gets all equipment nodes.
      Returns:
      map of name to node
    • getEdges

      Gets all process edges.
      Returns:
      list of edges
    • getNode

      Gets an equipment node by name.
      Parameters:
      name - equipment name
      Returns:
      the node or null
    • toJson

      public String toJson()
      Exports topology as JSON.
      Returns:
      JSON string
    • toDotGraph

      public String toDotGraph()
      Exports topology in DOT format for Graphviz visualization.
      Returns:
      DOT graph string