Class ProcessTopologyAnalyzer
java.lang.Object
neqsim.process.util.topology.ProcessTopologyAnalyzer
- All Implemented Interfaces:
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classNode in the process graph representing an equipment unit.static classEdge in the process graph representing a stream connection. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List<ProcessTopologyAnalyzer.ProcessEdge> private Map<String, FunctionalLocation> private static final org.apache.logging.log4j.Loggerprivate Map<String, ProcessTopologyAnalyzer.EquipmentNode> private ProcessSystemprivate static final long -
Constructor Summary
ConstructorsConstructorDescriptionProcessTopologyAnalyzer(ProcessSystem processSystem) Creates a new topology analyzer for a process system. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidvoidBuilds the process topology graph.private voidprivate voidprivate intcountAllDownstream(String equipmentName) getAffectedByFailure(String equipmentName) Gets all equipment affected by failure of a specific unit.getDownstreamEquipment(String equipmentName) Gets equipment downstream of a specific unit.getEdges()Gets all process edges.getIncreasedCriticalityOn(String failedEquipment) Gets equipment that becomes more critical when another fails.private StreamInterfacegetInletStream(ProcessEquipmentInterface equipment) private List<StreamInterface> getInletStreams(ProcessEquipmentInterface equipment) Gets an equipment node by name.getNodes()Gets all equipment nodes.private StreamInterfacegetOutletStream(ProcessEquipmentInterface equipment) private List<StreamInterface> getOutletStreams(ProcessEquipmentInterface equipment) getParallelEquipment(String equipmentName) Gets parallel equipment for a specific unit.Gets all parallel equipment groups.Gets the topological order of equipment.getUpstreamEquipment(String equipmentName) Gets equipment upstream of a specific unit.private booleanhasSameDownstream(ProcessTopologyAnalyzer.EquipmentNode node1, ProcessTopologyAnalyzer.EquipmentNode node2) private booleanhasSameUpstream(ProcessTopologyAnalyzer.EquipmentNode node1, ProcessTopologyAnalyzer.EquipmentNode node2) private voidvoidsetFunctionalLocation(String equipmentName, String stidTag) Assigns a functional location to an equipment unit.voidsetFunctionalLocation(String equipmentName, FunctionalLocation location) Assigns a functional location to an equipment unit.Exports topology in DOT format for Graphviz visualization.toJson()Exports topology as JSON.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
logger
private static final org.apache.logging.log4j.Logger logger -
processSystem
-
nodes
-
edges
-
functionalLocations
-
parallelGroups
-
criticalPath
-
topologicalOrder
-
-
Constructor Details
-
ProcessTopologyAnalyzer
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
-
getOutletStreams
-
getInletStream
-
getInletStreams
-
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
-
setFunctionalLocation
-
setFunctionalLocation
Assigns a functional location to an equipment unit.- Parameters:
equipmentName- the equipment namelocation- the functional location object
-
getAffectedByFailure
-
getIncreasedCriticalityOn
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
-
getDownstreamEquipment
-
getParallelEquipment
-
getParallelGroups
-
getTopologicalOrder
-
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
-
toDotGraph
Exports topology in DOT format for Graphviz visualization.- Returns:
- DOT graph string
-