Commit f1193f1b authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

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.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))
self.u = g.copy()
self.eweight = self.u.new_ep("int", val=1)
self.eweight = self.u.new_ep("int", val=1)
self.u = bstate.g
if nested:
Supports Markdown
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