Package jmt.common.exception

Examples of jmt.common.exception.IncorrectDistributionParameterException


        return expDistr.nextRand(((HyperExpPar) p).getExpParam1());
      } else {
        return expDistr.nextRand(((HyperExpPar) 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


    super("@@JSIM:RESERVED@@ Burst Distribution " + count++);

    //TODO also check if the length distributions parameter are correct?
    if (!check(probability)) {
      throw new IncorrectDistributionParameterException("The probability must be comprised between 0 and 1.");
    }

    engine = RandomEngine.makeDefault();
    this.probability = probability;
    this.lenghtDistrA = distrContA.getDistribution();
View Full Code Here

      if (x < 0.0) {
        return 0.0;
      }
      return lambda * Math.exp(-x * lambda);
    } else {
      throw new IncorrectDistributionParameterException("Remember: parameter lambda must be gtz");
    }
  }
View Full Code Here

      //OLD
      //return 1.0 - Math.exp(-x * p.getLambda());
      double lambda = ((ExponentialPar) p).getLambda();
      return 1.0 - Math.exp(-x * lambda);
    } else {
      throw new IncorrectDistributionParameterException("Remember: parameter lambda must be gtz");
    }
  }
View Full Code Here

    if (p.check()) {
      //OLD
      //return 1 / p.getLambda();
      return 1 / ((ExponentialPar) p).getLambda();
    } else {
      throw new IncorrectDistributionParameterException("Remember: parameter lambda must be gtz");
    }
  }
View Full Code Here

      //OLD
      //double lambda = p.getLambda();
      double lambda = ((ExponentialPar) p).getLambda();
      return 1 / (lambda * lambda);
    } else {
      throw new IncorrectDistributionParameterException("Remember: parameter lambda must be gtz");
    }
  }
View Full Code Here

  public double nextRand(Parameter p) throws IncorrectDistributionParameterException {
    if (p.check()) {
      return -Math.log(engine.raw()) / ((ExponentialPar) p).getLambda();
    } else {
      throw new IncorrectDistributionParameterException("Remember: parameter lambda must be gtz");
    }
  }
View Full Code Here

  public UniformPar(double min, double max) throws IncorrectDistributionParameterException {
    this.max = max;
    this.min = min;
    if (!check()) {
      throw new IncorrectDistributionParameterException("Error: the *max* parameter must be > of the *min* one");
    }
  }
 
View Full Code Here

  public void setMin(double min) throws IncorrectDistributionParameterException {
    if (check(max, min)) {
      this.min = min;
    } else {
      throw new IncorrectDistributionParameterException("Error: the *max* parameter must be > of the *min* one");
    }
  }
 
View Full Code Here

  public void setMax(double max) throws IncorrectDistributionParameterException {
    if (check(max, min)) {
      this.max = max;
    } else {
      throw new IncorrectDistributionParameterException("Error: the *max* parameter must be > of the *min* one");
    }
  }
 
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.