Simulation Grid¶
- class RegisteredDimension(_property, first_impact=None, last_impact=None, title=None)[source]¶
Bases:
propertyRegister a class property getter as a PyMonte simulation dimension.
Registered properties may specify their simulation stage impacts and therefore significantly increase simulation runtime in cases where computationally demanding section re-calculations can be reduced.
- Parameters:
first_impact (
str|None) – Name of the first simulation stage within the simulation pipeline which is impacted by manipulating this property. If not specified, the initial stage is assumed.last_impact (
str|None) – Name of the last simulation stage within the simulation pipeline which is impacted by manipulating this property. If not specified, the final stage is assumed.title (
str|None) – Displayed title of the dimension. If not specified, the dimension’s name will be assumed.
- deleter(fdel)[source]¶
Descriptor to obtain a copy of the property with a different deleter.
- Return type:
- getter(fget)[source]¶
Descriptor to obtain a copy of the property with a different getter.
- Return type:
- classmethod is_registered(object)[source]¶
Check if any object is a registered PyMonte simulation dimension.
- setter(fset)[source]¶
Descriptor to obtain a copy of the property with a different setter.
- Return type:
- property first_impact: str | None[source]¶
First impact of the dimension within the simulation pipeline.
- class register(*args, **kwargs)[source]¶
Bases:
Shorthand to register a property as a MonteCarlo dimension.
- Parameters:
_property – The property to be registered.
- Return type:
- class SamplePoint(value, title=None)[source]¶
Bases:
objectSample point of a single grid dimension.
A single
GridDimensionholds a sequence of sample points accesible by thesample_pointsproperty. During simulation runtime, the simulation will dynamically reconfigure the scenario selecting a single sample point out of eachGridDimensionper generated simulation sample.- Parameters:
- class GridDimension(considered_objects, dimension, sample_points, title=None, plot_scale=None, tick_format=None)[source]¶
Bases:
GridDimensionInfoSingle axis within the simulation grid.
A grid dimension represents a single simulation parameter that is to be varied during simulation runtime to observe its effects on the evaluated performance indicators. The values the represented parameter is configured to are
SamplePoints.- Parameters:
considered_objects (
object|tuple[object,...]) – The considered objects of this grid section.dimension (
str) – Path to the attribute.sample_points (
Sequence[SamplePoint|object]) – Sections the grid is sampled at.title (
str|None) – Title of this dimension. If not specified, the attribute string is assumed.tick_format (
ValueType|None) – Format of the tick labels. Linear by default.
- Raises:
ValueError – If the selected dimension does not exist within the considered_object.
- configure_point(point_index)[source]¶
Configure a specific sample point.
- Parameters:
point_index (
int) – Index of the sample point to configure.- Raises:
ValueError – For invalid indexes.
- Return type:
- class GridDimensionInfo(sample_points, title, plot_scale, tick_format)[source]¶
Bases:
objectBasic information about a grid dimension.
- property num_sample_points: int[source]¶
Number of dimension sample points.
Returns: Number of sample points.
- property plot_scale: str[source]¶
Scale of the scalar evaluation plot.
Refer to the Matplotlib documentation for a list of a accepted values.
- property sample_points: list[SamplePoint][source]¶
Sample points of this grid dimension.
- class ScalarDimension[source]¶
Bases:
ABCBase class for objects that can be configured by scalar values.
When a property of type
ScalarDimensionis defined as a simulation parameterGridDimension, the simulation will automatically configure the object with the scalar value of the sample point during simulation runtime.The configuration operation is represented by the lshift operator <<.