Examples of Exponential


Examples of cern.jet.random.Exponential

    ////                         protected methods                 ////

    /** Method that is called after _randomNumberGenerator is changed.
     */
    protected void _createdNewRandomNumberGenerator() {
        _generator = new Exponential(1.0, _randomNumberGenerator);
    }
View Full Code Here

Examples of jmt.engine.random.Exponential

    Parameter[] serverPar2 = new Parameter[1];

    Distribution[] DelayExp = new Distribution[1];
    Parameter[] DelayPar = new Parameter[1];

    DelayExp[0] = new Exponential();
    TerminalExp[0] = new Exponential();
    serverExp1[0] = new Exponential();
    serverExp2[0] = new Exponential();

    try {

      double servTime1 = 1.0; //fixed
      double servRate1 = 1 / servTime1;
View Full Code Here

Examples of jmt.engine.random.Exponential

    Parameter[] serverPar = new Parameter[1];

    Distribution[] DelayExp = new Distribution[1];
    Parameter[] DelayPar = new Parameter[1];

    DelayExp[0] = new Exponential();
    //TerminalExp[0] = new Exponential();
    serverExp[0] = new Exponential();

    try {
      double servTime = 1.0;
      double servRate = 1 / servTime;
View Full Code Here

Examples of jmt.gui.common.distributions.Exponential

      if (type == ExactConstants.CLASS_CLOSED) {
        // Closed class
        key = output.addClass(name, CommonConstants.CLASS_TYPE_CLOSED, 0, new Integer((int) data), null);
      } else {
        // Open class
        Exponential ex = new Exponential();
        ex.setMean(1 / data);
        key = output.addClass(name, CommonConstants.CLASS_TYPE_OPEN, 0, null, ex);
      }
      classKeys[i] = key;
    }

    routerKey = output.addStation("Router", CommonConstants.STATION_TYPE_ROUTER);

    // Creates source, sink and router (if needed)
    if (input.isClosed() || input.isMixed()) {
      refRouterKey = output.addStation("RefStation", CommonConstants.STATION_TYPE_ROUTER);
      // Makes connection between refRouter and router
      output.setConnected(refRouterKey, routerKey, true);
      output.setConnected(routerKey, refRouterKey, true);
      // Gives warning on refStation
      res
          .add("A special node, called \"RefStation\" was added in order to compute correctly the System Response Time and System Throughput of closed classes."
              + " Its presence is fundamental to compute correctly number of visits at each station for closed classes.");
    }

    if (input.isOpen() || input.isMixed()) {
      sourceKey = output.addStation("Source", CommonConstants.STATION_TYPE_SOURCE);
      sinkKey = output.addStation("Sink", CommonConstants.STATION_TYPE_SINK);
      //Makes connections between source, sink and router
      output.setConnected(sourceKey, routerKey, true);
      output.setConnected(routerKey, sinkKey, true);
    }

    // Convert stations
    Object[] stationKeys = new Object[input.getStations()];
    for (int i = 0; i < input.getStations(); i++) {
      String name = input.getStationNames()[i];
      int type = input.getStationTypes()[i];
      int servers = input.getStationServers()[i];
      double[][] serviceTimes = input.getServiceTimes()[i];
      Object key = null;
      switch (type) {
        case ExactConstants.STATION_DELAY:
          // Delay
          key = output.addStation(name, CommonConstants.STATION_TYPE_DELAY);
          // Sets distribution for each class
          for (int j = 0; j < classKeys.length; j++) {
            Exponential ex = new Exponential();
            ex.setMean(serviceTimes[j][0]);
            output.setServiceTimeDistribution(key, classKeys[j], ex);
          }
          break;
        case ExactConstants.STATION_LI:
          // Load independent
          key = output.addStation(name, CommonConstants.STATION_TYPE_SERVER);
          output.setStationNumberOfServers(new Integer(servers), key);
          output.setStationQueueStrategy(key, CommonConstants.QUEUE_STRATEGY_STATION_PS);
          // Sets distribution for each class
          for (int j = 0; j < classKeys.length; j++) {
            Exponential ex = new Exponential();
            ex.setMean(serviceTimes[j][0]);
            output.setServiceTimeDistribution(key, classKeys[j], ex);
          }
          break;
        case ExactConstants.STATION_LD:
          // Load dependent - this is single class only, but here
          // we support multiclass too (future extensions).
          key = output.addStation(name, CommonConstants.STATION_TYPE_SERVER);
          output.setStationNumberOfServers(new Integer(servers), key);
          output.setStationQueueStrategy(key, CommonConstants.QUEUE_STRATEGY_STATION_PS);
          // Sets distribution for each class
          for (int j = 0; j < classKeys.length; j++) {
            LDStrategy lds = new LDStrategy();
            Object rangeKey = lds.getAllRanges()[0];
            for (int range = 0; range < serviceTimes[j].length; range++) {
              // First range is already available
              if (range > 0) {
                rangeKey = lds.addRange();
              }
              Exponential ex = new Exponential();
              ex.setMean(serviceTimes[j][range]);
              lds.setRangeDistribution(rangeKey, ex);
              lds.setRangeDistributionMean(rangeKey, Double.toString(serviceTimes[j][range]));
            }
            output.setServiceTimeDistribution(key, classKeys[j], lds);
          }
View Full Code Here

Examples of jmt.gui.common.distributions.Exponential

    this.initial = initial;
    this.target = initial;
    if (initial != null) {
      this.current = initial.clone();
    } else {
      this.current = new Exponential(); // Default distribution if nothing
                        // is selected
    }

    // If distributions is not already set, sets it!
    if (distributions == null) {
View Full Code Here

Examples of org.apache.mahout.math.jet.random.Exponential

        History recorder = new History(1, 10, 30).logTicks();

        Random gen = RandomUtils.getRandom();
        ChineseRestaurant topicSampler = new ChineseRestaurant(options.alpha);
        Exponential interval = new Exponential(1, gen);
        double t = 0;
        long t0 = System.nanoTime();
        long messageId = 0;
        while (messageId < options.max) {
            double rate = options.peak * Math.exp(-scale * (Math.cos(2 * Math.PI * t / options.period) + 1));
            double dt = interval.nextDouble() / rate;
            t += dt;
            double now = (System.nanoTime() - t0) / 1e9;
            if (t > now + 0.01) {
                double millis = Math.floor((t - now) * 1000);
                double nanos = Math.rint((t - now) * 1e9 - millis * 1e6);
 
View Full Code Here

Examples of org.apache.mahout.math.jet.random.Exponential

  @Test
  public void testTrain() {

    Random gen = RandomUtils.getRandom();
    Exponential exp = new Exponential(0.5, gen);
    Vector beta = new DenseVector(200);
    for (Vector.Element element : beta) {
      int sign = 1;
      if (gen.nextDouble() < 0.5) {
        sign = -1;
      }
      element.set(sign * exp.nextDouble());
    }

    AdaptiveLogisticRegression.Wrapper cl = new AdaptiveLogisticRegression.Wrapper(2, 200, new L1());
    cl.update(new double[]{1.0e-5, 1});

View Full Code Here

Examples of org.apache.mahout.math.jet.random.Exponential

  }

  @Test
  public void copyLearnsAsExpected() {
    Random gen = RandomUtils.getRandom();
    Exponential exp = new Exponential(0.5, gen);
    Vector beta = new DenseVector(200);
    for (Vector.Element element : beta) {
        int sign = 1;
        if (gen.nextDouble() < 0.5) {
          sign = -1;
        }
      element.set(sign * exp.nextDouble());
    }

    // train one copy of a wrapped learner
    AdaptiveLogisticRegression.Wrapper w = new AdaptiveLogisticRegression.Wrapper(2, 200, new L1());
    for (int i = 0; i < 3000; i++) {
View Full Code Here

Examples of org.apache.mahout.math.jet.random.Exponential

  @Test
  public void testTrain() {

    Random gen = RandomUtils.getRandom();
    Exponential exp = new Exponential(0.5, gen);
    Vector beta = new DenseVector(200);
    for (Vector.Element element : beta.all()) {
      int sign = 1;
      if (gen.nextDouble() < 0.5) {
        sign = -1;
      }
      element.set(sign * exp.nextDouble());
    }

    AdaptiveLogisticRegression.Wrapper cl = new AdaptiveLogisticRegression.Wrapper(2, 200, new L1());
    cl.update(new double[]{1.0e-5, 1});

View Full Code Here

Examples of org.apache.mahout.math.jet.random.Exponential

  }

  @Test
  public void copyLearnsAsExpected() {
    Random gen = RandomUtils.getRandom();
    Exponential exp = new Exponential(0.5, gen);
    Vector beta = new DenseVector(200);
    for (Vector.Element element : beta.all()) {
        int sign = 1;
        if (gen.nextDouble() < 0.5) {
          sign = -1;
        }
      element.set(sign * exp.nextDouble());
    }

    // train one copy of a wrapped learner
    AdaptiveLogisticRegression.Wrapper w = new AdaptiveLogisticRegression.Wrapper(2, 200, new L1());
    for (int i = 0; i < 3000; i++) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.