Examples of Distribution


Examples of fork.lib.math.applied.stat.Distribution

            LandscapeScoring ls= new LandscapeScoring(lb, gb){
                protected double[] score(ArrayList<Region> bufs, GenomicRegion gr) throws RegionException{
                    return new double[]{Landscape2DBuffer.getArea(bufs, gr), gr.getRange()+1 };
                }
            };
            Distribution dis= LandscapeScoringResultEntry.toDistribution(ls.getResultEntries(), 0);
            lens.add(LandscapeScoringResultEntry.toDistribution(ls.getResultEntries(), 1).sum());
            double s= dis.sum();
            vs.add(s); sum+=s;
            //LandscapeScoringResultEntry.writeToFile(ls.getResultEntries(), new File(out.getParentFile()+"/file_"+f.getName()) );
        }
    }
    BufferedWriter bw= new BufferedWriter(new FileWriter(out));
View Full Code Here

Examples of fork.lib.math.applied.stat.Distribution




public void init(LandscapeBuilder lb) throws Exception{
    Distribution d= lb.getDistributionNonZero();
    ArrayList<Double> qs= d.quantileBoundaries(100);
    double m=0 ,sd=0;
    for( int i=0; i<50; i++ ){
        Distribution df= d.subset(qs.get(i), qs.get(qs.size()-1-i), true, true);
        m= df.mean();
        sd= df.standartDeviation();
        double z= sd/m;
        //System.out.println(i+"   mean: "+m+"   med: "+med+"   sd: "+ sd+"  z:"+z);
        if(z<0.2){
            break;
        }
View Full Code Here

Examples of fork.lib.math.applied.stat.Distribution

    }


   
public void init(LandscapeBuilder lb) throws Exception{
    Distribution d= lb.getDistributionNonZero();
    ArrayList<Double> qs= d.quantileBoundaries(100);
    double m=0 ,sd=0;
    for( int i=0; i<50; i++ ){
        Distribution df= d.subset(qs.get(i), qs.get(qs.size()-1-i), true, true);
        m= df.mean();
        double med= df.median();
        sd= df.standartDeviation();
        double z= sd/m;
        //System.out.println(i+"   mean: "+m+"   med: "+med+"   sd: "+ sd+"  z:"+z);
        if(z<0.2){
            break;
        }
View Full Code Here

Examples of fork.lib.math.applied.stat.Distribution

        init();
    }
   
   
protected void init() throws Exception{
    Distribution d= new Distribution();
    d.add(lbf.getDistribution());
    d.add(lbr.getDistribution());
    double med= Math.ceil( d.median() *1.7 );
    double sd= d.standartDeviation();
    System.out.println("med:  "+med +"    sd:  "+sd);
    //d.print(); System.exit(1);
    new LandscapeTransformer(lbf).subtract(med);
    new LandscapeTransformer(lbr).subtract(med);
   
View Full Code Here

Examples of fork.lib.math.applied.stat.Distribution

* @param bthr
* @param n
* @return
*/
public static ArrayList<Double> getThresholdLevels(Landscape2D data, double bthr, int n){
    Distribution dis= new Distribution(data.getValues());
    double range= dis.max()-bthr;
    if(range<=0){
        return null;
    }
    double v= bthr;
    double step= range/n;
View Full Code Here

Examples of io.airlift.stats.Distribution

            System.out.println();
            System.out.println("Simulation finished in  " + runtime);
            System.out.println();

            for (Entry<Integer, Collection<SimulationTask>> entry : middleTasks.entrySet()) {
                Distribution durationDistribution = new Distribution();
                Distribution taskParallelismDistribution = new Distribution();

                for (SimulationTask task : entry.getValue()) {
                    long taskStart = Long.MAX_VALUE;
                    long taskEnd = 0;
                    long totalCpuTime = 0;

                    for (SimulationSplit split : task.getSplits()) {
                        taskStart = Math.min(taskStart, split.getStartNanos());
                        taskEnd = Math.max(taskEnd, split.getDoneNanos());
                        totalCpuTime += TimeUnit.MILLISECONDS.toNanos(split.getRequiredProcessMillis());
                    }

                    Duration taskDuration = new Duration(taskEnd - taskStart, NANOSECONDS).convertTo(TimeUnit.MILLISECONDS);
                    durationDistribution.add(taskDuration.toMillis());

                    double taskParallelism = 1.0 * totalCpuTime / (taskEnd - taskStart);
                    taskParallelismDistribution.add((long) (taskParallelism * 100));
                }

                System.out.println("Splits " + entry.getKey() + ": Completed " + entry.getValue().size());

                Map<Double, Long> durationPercentiles = durationDistribution.getPercentiles();
                System.out.printf("   wall time ms :: p01 %4s :: p05 %4s :: p10 %4s :: p97 %4s :: p50 %4s :: p75 %4s :: p90 %4s :: p95 %4s :: p99 %4s\n",
                        durationPercentiles.get(0.01),
                        durationPercentiles.get(0.05),
                        durationPercentiles.get(0.10),
                        durationPercentiles.get(0.25),
                        durationPercentiles.get(0.50),
                        durationPercentiles.get(0.75),
                        durationPercentiles.get(0.90),
                        durationPercentiles.get(0.95),
                        durationPercentiles.get(0.99));

                Map<Double, Long> parallelismPercentiles = taskParallelismDistribution.getPercentiles();
                System.out.printf("    parallelism :: p99 %4.2f :: p95 %4.2f :: p90 %4.2f :: p75 %4.2f :: p50 %4.2f :: p25 %4.2f :: p10 %4.2f :: p05 %4.2f :: p01 %4.2f\n",
                        parallelismPercentiles.get(0.99) / 100.0,
                        parallelismPercentiles.get(0.95) / 100.0,
                        parallelismPercentiles.get(0.90) / 100.0,
                        parallelismPercentiles.get(0.75) / 100.0,
View Full Code Here

Examples of jmt.gui.common.distributions.Distribution

        classTypes[i] = ExactConstants.CLASS_CLOSED;
        classData[i] = input.getClassPopulation(key).doubleValue();
      } else {
        // Open class parameters
        classTypes[i] = ExactConstants.CLASS_OPEN;
        Distribution d = (Distribution) input.getClassDistribution(key);
        if (d.hasMean()) {
          classData[i] = 1.0 / d.getMean();
        } else {
          classData[i] = 1;
          res.add(input.getClassName(key) + " arrival distribution does not have a valid mean value."
              + " Arrival rate for that class was set to default value 1");
        }
      }
    }
    // Sets extracted values to output
    output.setClassNames(classNames);
    output.setClassTypes(classTypes);
    output.setClassData(classData);
    classNames = null;
    classTypes = null;
    classData = null;

    // Exports station data
    double[][][] serviceTimes = new double[stationNum][classNum][];
    int[] stationTypes = new int[stationNum];
    String[] stationNames = new String[stationNum];
    int[] stationServers = new int[stationNum];
    for (int st = 0; st < stationNum; st++) {
      Object key = stationKeys.get(st);
      stationNames[st] = input.getStationName(key);
      Integer serverNum = input.getStationNumberOfServers(key);
      if (serverNum != null && serverNum.intValue() > 0) {
        stationServers[st] = serverNum.intValue();
      } else {
        stationServers[st] = 1;
      }
      if (input.getStationType(key).equals(CommonConstants.STATION_TYPE_DELAY)) {
        stationTypes[st] = ExactConstants.STATION_DELAY;
      } else {
        stationTypes[st] = ExactConstants.STATION_LI;
      }

      // Sets service time for each class
      for (int cl = 0; cl < classNum; cl++) {
        Object serv = input.getServiceTimeDistribution(key, classKeys.get(cl));
        if (serv instanceof Distribution) {
          Distribution d = (Distribution) serv;
          serviceTimes[st][cl] = new double[1]; // This is not load dependent
          if (d.hasMean()) {
            serviceTimes[st][cl][0] = d.getMean();
          } else {
            serviceTimes[st][cl][0] = 1;
            res.add(output.getStationNames()[st] + " service time distribution for " + output.getClassNames()[cl]
                + " does not have a valid mean value." + " Service time is set to default value 1");
          }
View Full Code Here

Examples of jmt.gui.common.distributions.Distribution

        boolean ok = true;
        for (int j = 0; j < classes.size(); j++) {
          Object thisClass = classes.get(j);
          Object service = station_def.getServiceTimeDistribution(thisServer, thisClass);
          if (service instanceof Distribution) {
            Distribution d = (Distribution) service;
            if (!d.getName().equals(CommonConstants.DISTRIBUTION_EXPONENTIAL)) {
              warnings[BCMP_FCFS_EXPONENTIAL_WARNING] = true;
              BCMPserversFCFSWithoutExponential.add(thisServer);
              break;
            }
          } else if (service instanceof LDStrategy) {
            LDStrategy ld = (LDStrategy) service;
            Object[] ranges = ld.getAllRanges();
            for (Object range : ranges) {
              Distribution d = ld.getRangeDistribution(range);
              if (!d.getName().equals(CommonConstants.DISTRIBUTION_EXPONENTIAL)) {
                warnings[BCMP_FCFS_EXPONENTIAL_WARNING] = true;
                BCMPserversFCFSWithoutExponential.add(thisServer);
                ok = false;
                break;
              }
View Full Code Here

Examples of jmt.gui.common.distributions.Distribution

          Object service = station_def.getServiceTimeDistribution(thisServer, classes.get(0));
          if (service instanceof Distribution) {
            double mean = ((Distribution) service).getMean();
            for (int j = 0; j < classes.size(); j++) {
              Object thisClass = classes.get(j);
              Distribution d = (Distribution) station_def.getServiceTimeDistribution(thisServer, thisClass);
              double thisMean = d.getMean();
              if (thisMean != mean) {
                warnings[BCMP_FCFS_DIFFERENT_SERVICE_TIMES_WARNING] = true;
                BCMPFcfsServersWithDifferentServiceTimes.add(thisServer);
                break;
              }
View Full Code Here

Examples of jmt.gui.common.distributions.Distribution

        Object thisDelay = delays.get(i);
        for (int j = 0; j < classes.size(); j++) {
          Object thisClass = classes.get(j);
          Object service = station_def.getServiceTimeDistribution(thisDelay, thisClass);
          if (service instanceof Distribution) {
            Distribution d = (Distribution) service;
            if (d.getName().equals(CommonConstants.DISTRIBUTION_PARETO)) {
              warnings[BCMP_DELAY_WARNING] = true;
              BCMPdelaysWithNonRationalServiceDistribution.add(thisDelay);
              break;
            }
          } else if (service instanceof LDStrategy) {
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.