Skip to content

simulation.range

Module handling ranges.

Range

Range(sid, name=None)

Bases: BaseObject

Range class.

The Range class is the base class for the different types of ranges, i.e. UniformRange, VectorRange, FunctionalRange, and DataRange.

Construct Range.

values abstractmethod property writable

values

Get values of the range.

VectorRange

VectorRange(sid, values, name=None)

Bases: Range

VectorRange class.

The VectorRange describes an ordered collection of real values, listing them explicitly within child value elements.

Construct VectorRange.

values property

values

Get values of the range.

UniformRangeType

Bases: Enum

UniformRangeType.

Attribute type that can take the values linear or log. Determines whether to draw the values logarithmically (with a base of 10) or linearly.

UniformRange

UniformRange(
    sid, start, end, steps, range_type=linear, name=None
)

Bases: Range

UniformRange class.

The UniformRange on the preceding page) allows the definition of a Range with uniformly spaced values. The range_type determines whether to draw the values logarithmically (with a base of 10) or linearly.

Construct VectorRange.

values property

values

Get values of the range.

DataRange

DataRange(sid, source_ref, name=None)

Bases: Range

DataRange class.

The DataRange constructs a range by reference to external data. The sourceRef must point to a DataDescription with a single dimension, whose values are used as the values of the range.

Construct DataRange.

values property

values

Resolve data from data generator.

FunctionalRange

FunctionalRange(
    sid, variables, parameters, math, range, name=None
)

Bases: Calculation, Range

FunctionalRange class.

The FunctionalRange constructs a range through calculations that determine the next value based on the value(s) of other range(s) or model variables. In this it is similar to the ComputeChange element, and shares some of the same child elements (but is not a subclass of ComputeChange).

Construct FunctionalRange.

values property

values

Resolve data from data generator.

Dimension

Dimension(dimension, index=None, changes=None)

Define dimension for a scan.

The dimension defines how the dimension is called, the index is the corresponding index of the dimension.

Dimension.

If no index is provided the index is calculated from the changes. So in most cases the index can be left empty (e.g., for scanning of parameters).

:param dimension: unique id of dimension, should start with 'dim' :param index: index for values in dimension :param changes: changes to apply.

indices_from_dimensions staticmethod

indices_from_dimensions(dimensions)

Get indices of all combinations of dimensions.