Skip to content
Snippets Groups Projects
Noise.java 2.63 KiB
Newer Older
/* Copyright 2013-2017 CS Systèmes d'Information
 * Licensed to CS Systèmes d'Information (CS) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * CS licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package RefiningPleiades.generators;
/** Class for adding a noise to measurements.
 * @author Lucie Labat-Allee
 * @since 2.0
 */
public class Noise {

Jonathan Guinet's avatar
Jonathan Guinet committed
    /** Type of distribution. */
    private static final int GAUSSIAN = 0;

    /** Dimension. */
Jonathan Guinet's avatar
Jonathan Guinet committed

    /** Mean. */
    private double[] mean;

Jonathan Guinet's avatar
Jonathan Guinet committed
    /** Standard deviation. */
    private double[] standardDeviation;

Jonathan Guinet's avatar
Jonathan Guinet committed
    /** Distribution. */
    private int distribution = GAUSSIAN;

    /** Build a new instance.
Jonathan Guinet's avatar
Jonathan Guinet committed
     * @param distribution noise type
     * @param dimension noise dimension
     */
    public Noise(final int distribution, final int dimension) {
        this.mean = new double[dimension];
        this.standardDeviation = new double[dimension];
        this.distribution = distribution;
    }

     * @return the mean
     */
    public double[] getMean() {
    /** Set the mean.
     * @param meanValue the mean to set
    public void setMean(final double[] meanValue) {
        this.mean = meanValue.clone();
     */
    public double[] getStandardDeviation() {
    /** Set the standard deviation.
     * @param standardDeviationValue the standard deviation to set
    public void setStandardDeviation(final double[] standardDeviationValue) {
        this.standardDeviation = standardDeviationValue.clone();
     * @return the distribution
     */
    public int getDistribution() {
        return distribution;
    }

     * @return the dimension
     */
        return dimension;
    }
}