4.1.10.3. hyperflow/ModelImplementationView

class hyperflow.ModelImplementationView

This class serves as a view on a locked hyperflow model, to obtain visualisations and statistics from how the model is implemented internally.

__init__(self, model)
Raises:

LogicError if model is None.

Raises:

LogicError if not specificationLocked

printExpandedVertex(v)
printExpandedVertex(g)

Print the expanded flow network for an explicitly given vertex or a vertex indicated by a given graph. The graph version is equivalent to calling self.printExpandedVertex(dg.findVertex(g)), where dg is the derivation graph of the underlying model.

Returns:

the name of the PDF-file which will be created in post-processing.

Raises:

(the vertex version) LogicError if not v.

Raises:

(the graph version) LogicError if it is not represented in the underlying DG.

printExpanded()

Print the complete expanded derivation graph.

Returns:

the name of the PDF-file which will be created in post-processing.

printEnumerationTree()

Print the search tree generated by the solution enumeration.

Returns:

the name of the generated file.

writeMILP(self, format='lp')

Writes the internal (M)ILP implementation of the model to a file, in the given format. Note that different ILP libraries can write different formats.

Parameters:

format (str) – the format to write the model in. Defaults to lp.

Returns:

the name of the written file.

Throws:

LogicError if the solver does not support writing in the given format.

numMILPVariables
numMILPConstraints

(Read-only) Various statistics of the model implementation.

Type:

int