Ufo.Graph¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Ufo.Graph(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Main object for organizing filters. The contents of the
Ufo.Graph
structure are private and should only be accessed via the provided API.- connect_nodes(source, target, label)¶
- Parameters:
Connect source with target in self and annotate the edge with label.
- dump_dot(filename)¶
- Parameters:
filename (
str
) – A string containing a filename
Stores a GraphViz dot representation of self in filename.
- expand(path)¶
- Parameters:
path ([
Ufo.Node
]) – A path of nodes.- Raises:
Duplicate nodes between head and tail of path and insert at the exact the position of where path started and ended.
- find_longest_path(pred, *user_data)¶
- Parameters:
pred (
Ufo.FilterPredicate
) – Predicate function for which elements of the path must evaluate toTrue
.
- Returns:
A list with nodes in subsequent order of the path. User must free it with g_list_free.
- Return type:
[
Ufo.Node
]
Find the longest path in task_graph that fulfills pred.
- get_edge_label(source, target)¶
- Parameters:
- Returns:
Edge label pointer.
- Return type:
Retrieve edge label between source and target.
- get_edges()¶
- Returns:
a list of
Ufo.Edge
elements orNone
on error. Release the list with g_list_free().- Return type:
[
Ufo.Edge
]
Get all edges contained in self.
- get_leaves()¶
- Returns:
A list of all nodes that do not have a predessor node.
- Return type:
[
Ufo.Node
]
Get all leaves of self.
- get_nodes_filtered(func, *user_data)¶
- Parameters:
func (
Ufo.FilterPredicate
) – Predicate function to filter out nodesuser_data (
object
orNone
) – Data to be passed to func on invocation
- Returns:
A list of all nodes that are marked as true by the predicate function func.
- Return type:
[
Ufo.Node
]
Get nodes filtered by the predicate func.
- get_num_nodes()¶
- Returns:
Number of nodes.
- Return type:
Get number of nodes in self. The number is always divisible by two, because nodes are only part of a graph if member of an edge.
- get_predecessors(node)¶
- Parameters:
node (
Ufo.Node
) – AUfo.Node
whose predecessors are returned.- Returns:
A list with preceeding nodes of node. Free the list with g_list_free() but not its elements.
- Return type:
[
Ufo.Node
]
Get the all nodes connected to node.
- get_roots()¶
- Returns:
A list of all nodes that do not have a predessor node.
- Return type:
[
Ufo.Node
]
Get all roots of self.
- get_successors(node)¶
- Parameters:
- Returns:
A list with succeeding nodes of node. Free the list with g_list_free() but not its elements.
- Return type:
[
Ufo.Node
]
Get the successors of node.
- is_connected(from_, to)¶
- Parameters:
- Returns:
- Return type:
Check whether from is connected to to.