-
Notifications
You must be signed in to change notification settings - Fork 0
Graph
mstern98 edited this page Mar 25, 2021
·
23 revisions
- Graph ::
- graph(max_state_change = 1, snapshot_timestamp = topylogic.START_STOP, max_loop = topylogic.MAX_LOOPS, lvl_verbose = topylogic.VERTICES + topylogic.EDGES + topylogic.FUNCTIONS + topylogic.GLOBALS, context = topylogic.SINGLE, mem_option = topylogic.CONTINUE request_flag = topylogic.IGNORE_FAIL_REQUEST);
Create a graph
>>> g = topylogic.graph()Set the starting state set using the id's of the vertices
>>> v1 = topylogic.vertex(g, vertex_function, id1, vertex1_variables)
v2 = topylogic.vertex(g, another_vertex_function, id2, vertex2_variables)
e = edge(v1, v2, edge_function, edge_variables)
g.set_starting_ids([id1])Run the graph. The number of vertex results passed to run must be equal to the number of vertices in the starting set.
>>> vr = topylogic.vertex_result(var1, var2)
g.run([vr])Submit a request
>>> g.submit_request(request_type, request)Submit a generic request (one that simply calls a function)
>>> def f(args):
#Do something
g.submit_generic_request(args, f)Process requests (you shouldn't need to call this)
>>> g.process_requests()Pause the graph
>>> g.pause_graph()Resume the graph
>>> g.resume_graph()Destroy a graph
>>> g.destroy()