public class ALDProcessingDAG extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ALDProcessingDAG.HistoryType
Type of the processing history to be generated.
|
Modifier and Type | Field and Description |
---|---|
private Vector<ALDDataPort> |
allDataports |
private Vector<ALDEdge> |
allEdges |
private Vector<ALDOpNode> |
allOpNodes |
private static boolean |
debug
debug flag for debugging output.
|
private int |
graphIndex
This index is the index used to build the prefix for all Ids for elements
for the next history to add to the current graphml.
|
private ALDProcessingDAG.HistoryType |
historyType
Type of the history to be generated.
|
static char |
idSeparator
Character separating graphId prefix from rest
|
private boolean |
ignoreHiding
Ignore hidden flag of opnodes when creating a processing history.
|
private Vector<ALDOpNodePort> |
opNodePortsTraced |
private Vector<ALDOpNode> |
opNodesClone |
private Vector<ALDOpNode> |
opNodesInGraph |
private Vector<ALDDataPort> |
writtenDataports |
Constructor and Description |
---|
ALDProcessingDAG() |
Modifier and Type | Method and Description |
---|---|
private void |
addAttrToEdge(org.graphdrawing.graphml.xmlns.EdgeType edge,
String key,
String value)
Add an attribute to a graphml edge
|
private void |
addAttrToGraph(org.graphdrawing.graphml.xmlns.GraphType graph,
String key,
String value)
Add an attribute to a graphml graph
|
private void |
addAttrToGraphml(org.graphdrawing.graphml.xmlns.GraphmlType graphml,
String key,
String value)
Add an attribute to a graphml element
|
private void |
addAttrToNode(org.graphdrawing.graphml.xmlns.NodeType node,
String key,
String value)
Add an attribute to a graphml node
|
private void |
addAttrToPort(org.graphdrawing.graphml.xmlns.PortType port,
String key,
String value)
Add an attribute to a graphml port
|
private org.graphdrawing.graphml.xmlns.NodeType |
addDataPortToGraphml(org.graphdrawing.graphml.xmlns.GraphType graph,
ALDDataPort dataport)
Add a data port to the graphML graph
|
private void |
addEdge(org.graphdrawing.graphml.xmlns.GraphType graph,
ALDPort sourcePort,
ALDPort targetPort,
int idx)
Add an graphml edge to
graph with index idx |
private void |
addGraphmlHistory(org.graphdrawing.graphml.xmlns.GraphType graph,
ALDDataPort dataport)
Add the complete history of an object represented by a data port,
which was read from a graphml file, to a graph object.
|
private void |
addKey(org.graphdrawing.graphml.xmlns.GraphmlType graphml,
String id,
org.graphdrawing.graphml.xmlns.KeyForType.Enum domain,
String name,
org.graphdrawing.graphml.xmlns.KeyTypeType.Enum keyType)
add a key definition to graphml
|
private org.graphdrawing.graphml.xmlns.NodeType |
addOpNodePortToGraphml(org.graphdrawing.graphml.xmlns.GraphType graph,
ALDOpNodePort port)
Add a opNode port object to the graphML graph
|
private org.graphdrawing.graphml.xmlns.NodeType |
addOpNodeToGraph(org.graphdrawing.graphml.xmlns.GraphType graph,
ALDOpNode opNode)
Add an opNode to the graph of the enclosing opNode.
|
private void |
addParameterHash(org.graphdrawing.graphml.xmlns.NodeType node,
ALDOpNode opNode)
Add the parameter hash to to a graphml node.
|
private void |
addXmlHistory(org.graphdrawing.graphml.xmlns.NodeType node,
org.apache.xmlbeans.XmlObject xmlHistory)
Add the complete history of a ALDData from a generic XML file to a graphml node.
|
org.graphdrawing.graphml.xmlns.GraphmlDocument |
createGraphmlDocument(Object sourceObjOfHistory)
Create the processing history for
sourceObjOfHistory and convert to graphml object. |
org.graphdrawing.graphml.xmlns.GraphmlDocument |
createGraphmlDocument(Object sourceObjOfHistory,
ALDProcessingDAG.HistoryType historyType)
Create the processing history for
sourceObjOfHistory and convert to graphml object. |
org.graphdrawing.graphml.xmlns.GraphmlDocument |
createGraphmlDocument(Object sourceObjOfHistory,
ALDProcessingDAG.HistoryType historyType,
boolean ignoreHiding)
Create the processing history for
sourceObjOfHistory and convert to graphml object. |
private void |
fatal(String msg)
Output fatal error to stderr and throw an exception
|
private void |
findSibblingsAndParent(ALDOpNode opNode,
Vector<ALDInputPort> inputPorts,
int depth)
Find all sibblings and the parent of opNode.
|
private String |
getDataPortId(ALDDataPort dataport)
Return an ID used in graphml for a data port
|
static boolean |
getDebug()
Return the debug state
|
(package private) static String |
getGraphId(String id)
Get the graphIP at the beginning of an id up (exculing) idSeparator
|
(package private) static String |
getGraphName(int idx)
Return an ID used in graphml for graph
|
private String |
getOpNodeId(ALDOpNode opNode)
Return an ID used in graphml an opNode
|
private String |
getPortId(ALDPort p)
Return an ID used in graphml for a port
|
private void |
handleInputPorts(ALDOpNode parentOpNode,
Vector<ALDInputPort> inputPorts,
Vector<ALDInputPort> parentsInputports,
LinkedList<ALDOutputPort> outputPortToTraceback)
Trace back each port of inputPorts which are input ports of a child of parentOpNode.
|
private void |
handlePort(ALDOpNode opNode,
ALDPort port)
Handle a port to register the incoming edge and to potentially register dataport to opNode.
|
private void |
inconsistent(String msg)
Output error to stderr
|
private boolean |
isCompleteOpnode(ALDOpNode opNode)
Is a complete history to be created for this opNode?
|
private boolean |
isHiddenOpnode(ALDOpNode opNode)
Should we hide this opnode.
|
private boolean |
isToplevelOpnode(ALDOpNode opNode)
Is this an opNode of the toplevel operator.
|
private void |
outputOpNode(ALDOpNode opNode,
org.graphdrawing.graphml.xmlns.GraphType graph)
Output
opNode and it ports, and recursively its children to the graph . |
private void |
register(ALDOpNode opNode,
ALDDataPort dataport)
Register the dataport as directly included in opNode.
|
private void |
register(ALDOpNode parentOpNode,
ALDOpNode opNode)
Register an opNode as child to its parents if not already found directly or
indirectly before.
|
(package private) static String |
removeGraphId(String id)
Remove the graphIP including idSeparator at the beginning of an id
|
static void |
setDebug(boolean value)
Set the debug state
|
private void |
tracebackDAG(Object sourceObjOfHistory)
Trace back the implicit DAG created during processing for sourceObjOfHistory.
|
private Vector<ALDInputPort> |
visitOpNode(ALDOpNode opNode,
ALDOutputPort portOfInterest,
int depth)
Visit the opNode either completely or according to data dependency as define by the opNode
and the globale state of the processing DAG.
|
private Vector<ALDInputPort> |
visitOpNodeComplete(ALDOpNode opNode,
int depth)
Completely visits this opNode.
|
private Vector<ALDInputPort> |
visitOpNodeDatadependency(ALDOpNode opNode,
ALDOutputPort portOfInterest,
int depth)
Visit the opNode detecting all inner children and data ports on which
the output port of interest portOfInterest depends on.
|
private ALDProcessingDAG.HistoryType historyType
private static boolean debug
private boolean ignoreHiding
public static final char idSeparator
private int graphIndex
private Vector<ALDDataPort> allDataports
private Vector<ALDOpNodePort> opNodePortsTraced
private Vector<ALDDataPort> writtenDataports
public static void setDebug(boolean value)
value
- New debug statepublic static boolean getDebug()
private void tracebackDAG(Object sourceObjOfHistory) throws ALDProcessingDAGException
sourceObjOfHistory
- Object for which the processing history is to be createdALDProcessingDAGException
private void findSibblingsAndParent(ALDOpNode opNode, Vector<ALDInputPort> inputPorts, int depth) throws ALDProcessingDAGException
findSibblingsAndParent invokes itself recursively using the input ports of the parent on which the history of the parent depends on. These are all input ports if we visit the parent completely, otherwise the data dependencies of the inputPorts. The recursion terminates at the toplevel operator.
ALDProcessingDAGException
private void handleInputPorts(ALDOpNode parentOpNode, Vector<ALDInputPort> inputPorts, Vector<ALDInputPort> parentsInputports, LinkedList<ALDOutputPort> outputPortToTraceback) throws ALDProcessingDAGException
ALDProcessingDAGException
private Vector<ALDInputPort> visitOpNode(ALDOpNode opNode, ALDOutputPort portOfInterest, int depth) throws ALDProcessingDAGException
ALDProcessingDAGException
private Vector<ALDInputPort> visitOpNodeDatadependency(ALDOpNode opNode, ALDOutputPort portOfInterest, int depth) throws ALDProcessingDAGException
ALDProcessingDAGException
private Vector<ALDInputPort> visitOpNodeComplete(ALDOpNode opNode, int depth) throws ALDProcessingDAGException
ALDProcessingDAGException
private void handlePort(ALDOpNode opNode, ALDPort port) throws ALDProcessingDAGException
ALDProcessingDAGException
private boolean isToplevelOpnode(ALDOpNode opNode)
private boolean isCompleteOpnode(ALDOpNode opNode)
private boolean isHiddenOpnode(ALDOpNode opNode)
private void register(ALDOpNode parentOpNode, ALDOpNode opNode)
private void register(ALDOpNode opNode, ALDDataPort dataport)
public org.graphdrawing.graphml.xmlns.GraphmlDocument createGraphmlDocument(Object sourceObjOfHistory) throws ALDProcessingDAGException
sourceObjOfHistory
and convert to graphml object.
The complete history according is created. This method is
equivalent to createGraphmlDocument( sourceObjOfHistory, HistoryType.COMPLETE, false)
.sourceObjOfHistory
- for which the processing history to be created.ALDProcessingDAGException
public org.graphdrawing.graphml.xmlns.GraphmlDocument createGraphmlDocument(Object sourceObjOfHistory, ALDProcessingDAG.HistoryType historyType) throws ALDProcessingDAGException
sourceObjOfHistory
and convert to graphml object.
This method is equivalent to createGraphmlDocument( sourceObjOfHistory, historyType, false)
.sourceObjOfHistory
- for which the processing history to be written.historyType
- type/moude of history to be created.ALDProcessingDAGException
public org.graphdrawing.graphml.xmlns.GraphmlDocument createGraphmlDocument(Object sourceObjOfHistory, ALDProcessingDAG.HistoryType historyType, boolean ignoreHiding) throws ALDProcessingDAGException
sourceObjOfHistory
and convert to graphml object.sourceObjOfHistory
- for which the processing history to be written.historyType
- type/mode of history to be created.ignoreHiding
- if true hiding of opnodes is ignores, i.e. all opnodes
added to the history.ALDProcessingDAGException
private void outputOpNode(ALDOpNode opNode, org.graphdrawing.graphml.xmlns.GraphType graph) throws ALDProcessingDAGException
opNode
and it ports, and recursively its children to the graph
.
An opNode is represented by an node and contains a (graphml) graph as
is containts nested ports and further opNodes.ALDProcessingDAGException
private void addEdge(org.graphdrawing.graphml.xmlns.GraphType graph, ALDPort sourcePort, ALDPort targetPort, int idx) throws ALDProcessingDAGException
graph
with index idx
ALDProcessingDAGException
private void addGraphmlHistory(org.graphdrawing.graphml.xmlns.GraphType graph, ALDDataPort dataport) throws ALDProcessingDAGException
graph
- Graph to add the history read from filedataport
- ALDProcessingDAGException
private void addXmlHistory(org.graphdrawing.graphml.xmlns.NodeType node, org.apache.xmlbeans.XmlObject xmlHistory)
private void addParameterHash(org.graphdrawing.graphml.xmlns.NodeType node, ALDOpNode opNode)
private void addKey(org.graphdrawing.graphml.xmlns.GraphmlType graphml, String id, org.graphdrawing.graphml.xmlns.KeyForType.Enum domain, String name, org.graphdrawing.graphml.xmlns.KeyTypeType.Enum keyType)
private org.graphdrawing.graphml.xmlns.NodeType addOpNodeToGraph(org.graphdrawing.graphml.xmlns.GraphType graph, ALDOpNode opNode)
private org.graphdrawing.graphml.xmlns.NodeType addDataPortToGraphml(org.graphdrawing.graphml.xmlns.GraphType graph, ALDDataPort dataport) throws ALDProcessingDAGException
ALDProcessingDAGException
private org.graphdrawing.graphml.xmlns.NodeType addOpNodePortToGraphml(org.graphdrawing.graphml.xmlns.GraphType graph, ALDOpNodePort port) throws ALDProcessingDAGException
ALDProcessingDAGException
private void addAttrToGraphml(org.graphdrawing.graphml.xmlns.GraphmlType graphml, String key, String value)
private void addAttrToGraph(org.graphdrawing.graphml.xmlns.GraphType graph, String key, String value)
private void addAttrToNode(org.graphdrawing.graphml.xmlns.NodeType node, String key, String value)
private void addAttrToEdge(org.graphdrawing.graphml.xmlns.EdgeType edge, String key, String value)
private void addAttrToPort(org.graphdrawing.graphml.xmlns.PortType port, String key, String value)
static String removeGraphId(String id)
static String getGraphId(String id)
static String getGraphName(int idx)
private String getDataPortId(ALDDataPort dataport)
private String getPortId(ALDPort p) throws ALDProcessingDAGException
ALDProcessingDAGException
private void fatal(String msg) throws ALDProcessingDAGException
ALDProcessingDAGException
private void inconsistent(String msg)
Copyright © 2010–2021 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.