-
Couldn't load subscription status.
- Fork 0
Edge and Bi Edge
Matthew Stern edited this page Mar 29, 2021
·
11 revisions
Edge
edge(vertex from, vertex to, edge_function, glbl = NULL)
Edge Function (vertex_to_shared_var is NULL in modes SWITCH and NONE)
>>> def edge_function(id, result_edge, edge_glbl, vertex_from_shared_var, vertex_to_shared_var)
#Do something
#Modify edge_glbl
return boolean, edge_glblCreate edge
>>> e = topylogic.edge(vertex1, vertex2, edge_function, vars)Change the function
>>> e.set_callback(another_edge_function)Change the glbl vars
>>> e.set_glbl(new_vars)Destroy (Shouldn't be needed)
>>> e.destroy()Bi Edge (Like edge but creates a direction that points to and from both vertices. Thus has the same function)
bi_edge(vertex from, vertex to, edge_function, glbl = NULL)
Create a bi edge
>>> bi_e = topylogic.bi_edge(vertex1, vertex2, edge_function, vars)
>>> edge_a = bi_e.edge_a_to_b
>>> edge_b = bi_e.edge_b_to_aModify bi edge
>>> bi_e.modify_bi_edge(another_edge_function, new_vars)Change the function
>>> bi_e.set_f(another_edge_function)Change the glbl vars
>>> bi_e.set_glbl(new_vars)Destroy (shouldn't be needed)
>>> bi_e.destroy()