Install the latest stable release with pip install bottle
or download bottle.py (unstable) into your project directory. There are no hard dependencies other than the Python standard library.
- the state embedded in the node
- path cost (from the root node to the current one)
- the value of the node (used for ordering within PriorityFringe)
- parent node as FringeNode instance (None if we are building the root)
- cause the action that generated this state (None or not specified if we are building the root)
- problem the problem instance
- gen_label function
- shape of node (if not specified the default circle shape is gonna be used)
- limit if is limited search (if not specified not limited)
- closed if exist
- fringe if exist
node = FringeNode(start, 0, 0, None,
cause=None, problem=env, shape='box', gen_label=gen_label, fringe=fringe)
fringe.add(node)
child = FringeNode(env.sample(start, 0), 1, 0, node,
cause=0, problem=env, gen_label=gen_label, fringe=fringe) # Child node
if child.state not in fringe:
fringe.add(child)
child = FringeNode(env.sample(start, 1), 1, 0, node,
cause=1, problem=env, gen_label=gen_label) # Other child node
if child.state in fringe and child.value < fringe[child.state].value: # Replace node of the same
fringe.replace(child)
print("\n" + close_dot(2))
the
close_dot(n_expasions)
is the actual "extractor" method of the generated dot code
You can either compile the dot generated by the previous section to png with the call to this method:
compile_dot_files(path)
or just run: python viz.py
from inside the viz directory and open the "Web Visualizer" on localhost:8080