Commit f1193f1b authored by Tiago Peixoto's avatar Tiago Peixoto

UncertainBaseState: Add support for direct state initialization

parent 139b5859
......@@ -49,9 +49,14 @@ class UncertainBaseState(object):
if init_empty:
self.u = Graph(directed=g.is_directed())
self.u.add_vertex(g.num_vertices())
self.eweight = self.u.new_ep("int", val=1)
elif "g" in state_args:
self.u = state_args.pop("g")
self.eweight = state_args.pop("eweight",
self.u.new_ep("int", val=1))
else:
self.u = g.copy()
self.eweight = self.u.new_ep("int", val=1)
self.eweight = self.u.new_ep("int", val=1)
else:
self.u = bstate.g
if nested:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment