Class ProcessEdge
java.lang.Object
neqsim.process.processmodel.graph.ProcessEdge
- All Implemented Interfaces:
Serializable
Represents a directed edge in the process flowsheet graph. Each edge corresponds to a stream
connection between two equipment units.
This class provides:
- Source and target node references
- Optional reference to the underlying StreamInterface
- Edge type classification (material, energy, signal)
- Graph-neural-network compatible edge features
- Version:
- 1.0
- Author:
- NeqSim
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEdge types representing different connection types in process flowsheets. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ProcessEdge.EdgeTypeType of this edge.private final intUnique index of this edge in the graph.private booleanWhether this edge is part of a cycle (back edge in DFS).private final StringName of this edge/stream.private static final longprivate final ProcessNodeThe source node (upstream equipment).private final StreamInterfaceThe stream this edge represents (may be null for control signals).private final ProcessNodeThe target node (downstream equipment). -
Constructor Summary
ConstructorsConstructorDescriptionProcessEdge(int index, ProcessNode source, ProcessNode target, String name, ProcessEdge.EdgeType edgeType) Creates an edge without a stream (e.g., control signal).ProcessEdge(int index, ProcessNode source, ProcessNode target, StreamInterface stream) Creates a material edge with automatic type detection.ProcessEdge(int index, ProcessNode source, ProcessNode target, StreamInterface stream, String name, ProcessEdge.EdgeType edgeType) Creates a new process edge. -
Method Summary
Modifier and TypeMethodDescriptionprivate static ProcessEdge.EdgeTypedetectEdgeType(StreamInterface stream, ProcessNode source, ProcessNode target) booleanprivate StringGets the edge type.double[]Generates edge feature vector for GNN compatibility.intgetIndex()Gets the unique index of this edge.int[]Gets edge as index pair [source, target] for sparse graph representation.getName()Gets the edge name.Gets the source node.intGets the source node index.Gets the stream this edge represents.Gets the target node.intGets the target node index.inthashCode()booleanChecks if this edge is a back edge (creates a cycle in the graph).booleanChecks if this edge is a recycle edge.(package private) voidsetBackEdge(boolean isBackEdge) Sets whether this edge is a back edge.toString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
source
The source node (upstream equipment). -
target
The target node (downstream equipment). -
stream
The stream this edge represents (may be null for control signals). -
name
Name of this edge/stream. -
edgeType
Type of this edge. -
index
private final int indexUnique index of this edge in the graph. -
isBackEdge
private transient boolean isBackEdgeWhether this edge is part of a cycle (back edge in DFS).
-
-
Constructor Details
-
ProcessEdge
public ProcessEdge(int index, ProcessNode source, ProcessNode target, StreamInterface stream, String name, ProcessEdge.EdgeType edgeType) Creates a new process edge.- Parameters:
index- unique index of this edgesource- source nodetarget- target nodestream- the stream this edge represents (may be null)name- edge nameedgeType- type of edge
-
ProcessEdge
Creates a material edge with automatic type detection.- Parameters:
index- unique indexsource- source nodetarget- target nodestream- the stream
-
ProcessEdge
public ProcessEdge(int index, ProcessNode source, ProcessNode target, String name, ProcessEdge.EdgeType edgeType) Creates an edge without a stream (e.g., control signal).- Parameters:
index- unique indexsource- source nodetarget- target nodename- edge nameedgeType- type of edge
-
-
Method Details
-
generateName
-
detectEdgeType
private static ProcessEdge.EdgeType detectEdgeType(StreamInterface stream, ProcessNode source, ProcessNode target) -
getIndex
public int getIndex()Gets the unique index of this edge.- Returns:
- the edge index
-
getSource
-
getTarget
-
getStream
Gets the stream this edge represents.- Returns:
- the stream, or null if this is not a stream connection
-
getName
-
getEdgeType
-
isRecycle
public boolean isRecycle()Checks if this edge is a recycle edge.- Returns:
- true if this is a recycle edge
-
isBackEdge
public boolean isBackEdge()Checks if this edge is a back edge (creates a cycle in the graph).- Returns:
- true if this is a back edge
-
setBackEdge
void setBackEdge(boolean isBackEdge) Sets whether this edge is a back edge.- Parameters:
isBackEdge- true if this is a back edge
-
getSourceIndex
public int getSourceIndex()Gets the source node index.- Returns:
- source node index
-
getTargetIndex
public int getTargetIndex()Gets the target node index.- Returns:
- target node index
-
getFeatureVector
public double[] getFeatureVector()Generates edge feature vector for GNN compatibility.Features include:
- One-hot encoded edge type
- Stream properties (temperature, pressure, flow rate)
- Back edge indicator
- Returns:
- feature vector
-
getIndexPair
public int[] getIndexPair()Gets edge as index pair [source, target] for sparse graph representation.- Returns:
- array with [sourceIndex, targetIndex]
-
toString
-
equals
-
hashCode
-