4.1.10.4. hyperflow/Printer

class hyperflow.Printer

An object of this class holds information on how derivation graphs with flow are visualised.

dgPrinter

(Read-only) Retrieve the DGPrinter used when printing solutions.

Type:

DGPrinter

withFlowLabels

Control whether a flow label is appended to each hyperedge label (see also DGPrinter.pushEdgeLabel()).

Type:

bool

pushInEdgeLabel(f)

Add another function for in-edge labelling. The result of this function is appended to each label using the edge label separator of the underlying DGPrinter.

Parameters:

f (Callable[DG.Vertex], str] or str) – the function to push for labelling in-edges.

popInEdgeLabel()

Remove the last pushed in-edge labelling function.

Raises:

LogicError if no callback is left to pop.

pushOutEdgeLabel(f)

Add another function for out-edge labelling. The result of this function is appended to each label using the edge label separator of the underlying DGPrinter.

Parameters:

f (Callable[DG.Vertex], str] or str) – the function to push for labelling out-edges.

popOutEdgeLabel()

Remove the last pushed out-edge labelling function.

Raises:

LogicError if no callback is left to pop.

printUnfiltered

Control whether the unfiltered version of a solution is printed.

Type:

bool

printFiltered

Control whether the filtered version of a solution is printed.

Type:

bool

unfilteredFlowColour

When printing the unfiltered version, use this colour on vertices and edges with non-zero flow. Use an empty string to not colour them.

Type:

str