当前位置: 首页>>代码示例>>Java>>正文


Java LocalizedFormats.OUT_OF_RANGE_SIMPLE属性代码示例

本文整理汇总了Java中org.apache.commons.math3.exception.util.LocalizedFormats.OUT_OF_RANGE_SIMPLE属性的典型用法代码示例。如果您正苦于以下问题:Java LocalizedFormats.OUT_OF_RANGE_SIMPLE属性的具体用法?Java LocalizedFormats.OUT_OF_RANGE_SIMPLE怎么用?Java LocalizedFormats.OUT_OF_RANGE_SIMPLE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.commons.math3.exception.util.LocalizedFormats的用法示例。


在下文中一共展示了LocalizedFormats.OUT_OF_RANGE_SIMPLE属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkValidity

/**
 * {@inheritDoc}
 */
@Override
protected void checkValidity(final List<Double> chromosomeRepresentation)
    throws InvalidRepresentationException {

    for (double val : chromosomeRepresentation) {
        if (val < 0 || val > 1) {
            throw new InvalidRepresentationException(LocalizedFormats.OUT_OF_RANGE_SIMPLE,
                                                     val, 0, 1);
        }
    }
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:14,代码来源:RandomKey.java

示例2: StableRandomGenerator

/**
 * Create a new generator.
 *
 * @param generator underlying random generator to use
 * @param alpha Stability parameter. Must be in range (0, 2]
 * @param beta Skewness parameter. Must be in range [-1, 1]
 * @throws NullArgumentException if generator is null
 * @throws OutOfRangeException if {@code alpha <= 0} or {@code alpha > 2}
 * or {@code beta < -1} or {@code beta > 1}
 */
public StableRandomGenerator(final RandomGenerator generator,
                             final double alpha, final double beta)
    throws NullArgumentException, OutOfRangeException {
    if (generator == null) {
        throw new NullArgumentException();
    }

    if (!(alpha > 0d && alpha <= 2d)) {
        throw new OutOfRangeException(LocalizedFormats.OUT_OF_RANGE_LEFT,
                alpha, 0, 2);
    }

    if (!(beta >= -1d && beta <= 1d)) {
        throw new OutOfRangeException(LocalizedFormats.OUT_OF_RANGE_SIMPLE,
                beta, -1, 1);
    }

    this.generator = generator;
    this.alpha = alpha;
    this.beta = beta;
    if (alpha < 2d && beta != 0d) {
        zeta = beta * FastMath.tan(FastMath.PI * alpha / 2);
    } else {
        zeta = 0d;
    }
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:36,代码来源:StableRandomGenerator.java

示例3: OutOfRangeException

/**
 * Construct an exception from the mismatched dimensions.
 *
 * @param wrong Requested value.
 * @param lo Lower bound.
 * @param hi Higher bound.
 */
public OutOfRangeException(Number wrong,
                           Number lo,
                           Number hi) {
    this(LocalizedFormats.OUT_OF_RANGE_SIMPLE, wrong, lo, hi);
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:12,代码来源:OutOfRangeException.java


注:本文中的org.apache.commons.math3.exception.util.LocalizedFormats.OUT_OF_RANGE_SIMPLE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。