Package jmt.common.exception

Examples of jmt.common.exception.IncorrectDistributionParameterException


      if (pdf[i] >= 0) {
        this.pdf[i] = pdf[i];
        sumProb += this.pdf[i];
      } else {
        //negative probability not allowed
        throw new IncorrectDistributionParameterException("Found a probability less than zero. Only value gtz allowed.");
      }
    }

    if (Math.abs(sumProb - 1.0) > 1E-14) {
      //total probability must be near 1 (10exp(-14) error allowed)
      throw new IncorrectDistributionParameterException("The sum of all the given probability must be 1.0");
    }

    //sets the cdf with the new probabilities
    setCDF();
  }
View Full Code Here


          r = r + nextRand(p);
        }
        return r;
      }
    } else {
      throw new IncorrectDistributionParameterException("Expection in generation of MMPP2 random numbers");
    }
  }
View Full Code Here

          this.setCurState(0);
        }
        return expDistr.nextRand(((MAPPar) p).getExpParam2());
      }
    } else {
      throw new IncorrectDistributionParameterException(
          "Remember: parameter mean, variance, lambda1 and lambda 2 must be gtz; p must be a number betwen 0 and 1");
    }
  }
View Full Code Here

   * @throws IncorrectDistributionParameterException if the provided parameter is not greater than zero.
   */
  public ConstantDistrPar(double t) throws IncorrectDistributionParameterException {
    this.t = t;
    if (!check()) {
      throw new IncorrectDistributionParameterException("t < 0");
    }
  }
View Full Code Here

   */
  public void setParameterValue(double t) throws IncorrectDistributionParameterException {
    if (!(t < 0)) {
      this.t = t;
    } else {
      throw new IncorrectDistributionParameterException("t < 0");
    }
  }
View Full Code Here

   * @throws IncorrectDistributionParameterException if mean value is invalid for this distribution
   */
  @Override
  public void setMean(double meanValue) throws IncorrectDistributionParameterException {
    if (meanValue < 0 || Double.isInfinite(meanValue)) {
      throw new IncorrectDistributionParameterException("Mean value must be finite and greater than zero");
    }
    t = meanValue;
  }
View Full Code Here

      if (x <= min || x >= max) {
        return 0.0; //if x is out of bound return 0
      }
      return 1.0 / (max - min);
    } else {
      throw new IncorrectDistributionParameterException(
          "Remember: the *max* parameter must be > of the *min* one because min and max reppresent the boud of the distribution");
    }
  }
View Full Code Here

      if (x >= max) {
        return 1.0; //if x is greater than the max bound return 1
      }
      return (x - min) / (max - min);
    } else {
      throw new IncorrectDistributionParameterException(
          "Remember: the *max* parameter must be > of the *min* one because min and max reppresent the boud of the distribution");
    }
  }
View Full Code Here

      //double min = p.getMin();
      double max = ((UniformPar) p).getMax();
      double min = ((UniformPar) p).getMin();
      return (max + min) / 2;
    } else {
      throw new IncorrectDistributionParameterException(
          "Remember: the *max* parameter must be > of the *min* one because min and max reppresent the boud of the distribution");
    }
  }
View Full Code Here

      //double min = p.getMin();
      double max = ((UniformPar) p).getMax();
      double min = ((UniformPar) p).getMin();
      return Math.pow((max - min), 2) / 12;
    } else {
      throw new IncorrectDistributionParameterException(
          "Remember: the *max* parameter must be > of the *min* one because min and max reppresent the boud of the distribution");
    }
  }
View Full Code Here

TOP

Related Classes of jmt.common.exception.IncorrectDistributionParameterException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.