4.1.10.4. flow/Solution

class mod.FlowSolutionRange

A range of solutions for a flow model.

flow

(Read-only) The flow model that produced these solutions.

Type

Flow

size

The number of solutions in the flow model.

Type

int

__len__()
Returns

the number of solutions in the flow model.

Return type

int

__iter__()
Returns

an iterator for the contained solutions.

__getitem__(i)
Parameters

i (int) – the index into the range.

Returns

the i th solution in the range.

Return type

FlowSolution

list()

List overall information about each solution.

print(printer=FlowPrinter(), data=None)

Print solutions using the settings in the given printer and the structure information in the data object.

Parameters
  • printer (FlowPrinter) – the printer to use governing the appearance.

  • data (DGPrintData) – the extra data to use encoding the structure of the graph.

class mod.FlowSolution

A solution for a flow model.

flow

(Read-only) The flow model that produced the solution.

Type

Flow

id

(Read-only) An ID for the solution which is unique among all solutions from the parent Flow object.

Type

int

eval(exp)
Parameters

exp (FlowLinExp) – the linear expression to be evaluated on the solution.

Returns

the value of the given linear expression evaluated on the solution.

Return type

int or float

list()

List overall information about the solution.

print(printer=FlowPrinter(), data=None)

Print the solution using the settings in the given printer and the structure information in the data object.

Parameters
  • printer (FlowPrinter) – the printer to use governing the appearance.

  • data (DGPrintData) – the extra data to use encoding the structure of the graph.

Returns

the name of the PDF-files that will be compiled in post-processing for respectively the filtered and unfiltered depictions. If either is not requested by the given printer the corresponding entry is None.

Return type

tuple[str, str]

class mod.FlowSolutionOld
id

(Read-only) An id for the solution which is unique among all solutions from the parent Flow object.

Type

int

flow

(Read-only) The flow model that produced this solution.

Type

Flow

eval(exp)
Parameters

exp (FlowLinExp) – the linear expression to be evaluated on the solution.

Returns

the value of the given linear expression evaluated on the solution.

Return type

float

print(printer=FlowPrinter(), data=None)

Print the solution using the settings in the given printer and the structure information in the data object.

Parameters
  • printer (FlowPrinter) – the printer to use governing the appearance.

  • data (DGPrintData) – the extra data to use encoding the structure of the graph.

Returns

the name of the PDF-file that will be compiled in post-processing for the filtered graph.

Return type

str

haxListDerivations()

List the solution in more human readable form. Don’t expect this function to stay in this form.

class mod.FlowSolutionSet

A class representing the set of solutions from a single model.

dgFlow

(Read-only) The flow model that produced these solutions.

Type

Flow

list()

List overall information about each solution.

size

The number of solutions in the flow model.

Type

int

print(printer=FlowPrinter(), data=None)

Print solutions using the settings in the given printer and the structure information in the data object.

Parameters
  • printer (FlowPrinter) – the printer to use governing the appearance.

  • data (DGPrintData) – the extra data to use encoding the structure of the graph.

4.1.10.4.1. Other

The solution set class additionally supports indexing to retrieve specific solutions and iteration over the range of solutions. E.g., the following iterates through each solution in the flow model flow:

for sol in flow.solutions:
    pass