Source code for gemseo.problems.uncertainty.ishigami.ishigami_space
# Copyright 2021 IRT Saint Exupéry, https://www.irt-saintexupery.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 3 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
"""The uncertain space used in the Ishigami use case."""
from __future__ import annotations
from numpy import pi
from gemseo.algos.parameter_space import ParameterSpace
from gemseo.problems.uncertainty.utils import UniformDistribution
from gemseo.uncertainty.distributions.factory import DistributionFactory
[docs]
class IshigamiSpace(ParameterSpace):
r"""The uncertain space used in the Ishigami use case."""
UniformDistribution = UniformDistribution
"""The name of the class implementing the uniform distribution."""
def __init__(
self, uniform_distribution_name: UniformDistribution = UniformDistribution.SCIPY
) -> None:
"""
Args:
uniform_distribution_name: The name of the class
implementing the uniform distribution.
""" # noqa: D205, D212
super().__init__()
settings = (
DistributionFactory()
.get_class(uniform_distribution_name)
.Settings(minimum=-pi, maximum=pi)
)
for index in range(3):
self.add_random_vector(f"x{index + 1}", (settings,))