Class DexpiTopologyResolver.ResolvedTopology
java.lang.Object
neqsim.process.processmodel.dexpi.DexpiTopologyResolver.ResolvedTopology
- All Implemented Interfaces:
Serializable
- Enclosing class:
DexpiTopologyResolver
The resolved topology of a DEXPI document, containing equipment IDs in topological order and
the edges (connections) between them.
- Version:
- 1.0
- Author:
- NeqSim
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<DexpiTopologyResolver.TopologyEdge> private static final long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetEdges()Gets all directed edges.Gets the map from equipment ID to its XML element.getIncomingEdges(String equipmentId) Gets edges whose target is the given equipment ID.Gets the map from nozzle ID to owning equipment ID.Gets equipment IDs in topological (upstream to downstream) order.getOutgoingEdges(String equipmentId) Gets edges whose source is the given equipment ID.booleanhasCycle()Checks whether the topology contains a cycle.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
orderedEquipmentIds
-
edges
-
nozzleToEquipment
-
equipmentElements
-
-
Constructor Details
-
ResolvedTopology
public ResolvedTopology(List<String> orderedEquipmentIds, List<DexpiTopologyResolver.TopologyEdge> edges, Map<String, String> nozzleToEquipment, Map<String, Element> equipmentElements) Creates a new resolved topology.- Parameters:
orderedEquipmentIds- equipment IDs in topological orderedges- the directed edges between equipmentnozzleToEquipment- map from nozzle ID to owning equipment IDequipmentElements- map from equipment ID to its XML element
-
-
Method Details
-
getOrderedEquipmentIds
-
getEdges
Gets all directed edges.- Returns:
- list of topology edges
-
getNozzleToEquipment
-
getEquipmentElements
-
getOutgoingEdges
Gets edges whose source is the given equipment ID.- Parameters:
equipmentId- the source equipment ID- Returns:
- list of outgoing edges (may be empty)
-
getIncomingEdges
Gets edges whose target is the given equipment ID.- Parameters:
equipmentId- the target equipment ID- Returns:
- list of incoming edges (may be empty)
-
hasCycle
public boolean hasCycle()Checks whether the topology contains a cycle. A cycle exists when the number of topologically sorted nodes is less than the total number of equipment nodes, meaning Kahn's algorithm could not resolve all dependencies.- Returns:
- true if a cycle was detected
-