Package umontreal.iro.lecuyer.util

Examples of umontreal.iro.lecuyer.util.PrintfFormat


    *
    *    @return a confidence interval formatted as a string
    *
    */
   public String formatCINormal (double level, int d)  {
      PrintfFormat str = new PrintfFormat();
      double ci[] = new double[2];
      confidenceIntervalNormal (level, ci);
      str.append ("  " + (100*level) + "%");
      str.append (" confidence interval for mean (normal): (");
      str.append (7 + d, d-1, d, ci[0] - ci[1]).append (',');
      str.append (7 + d, d-1, d, ci[0] + ci[1]).append (" )" + PrintfFormat.NEWLINE);
      return str.toString();
}
View Full Code Here


    *
    *    @return a confidence interval formatted as a string
    *
    */
   public String formatCIStudent (double level, int d)  {
      PrintfFormat str = new PrintfFormat();
      double ci[] = new double[2];
      confidenceIntervalStudent (level, ci);
      str.append ("  " + (100*level) + "%");
      str.append (" confidence interval for mean (student): (");
      str.append (7 + d, d, d-1, ci[0] - ci[1]).append (',');
      str.append (7 + d, d, d-1, ci[0] + ci[1]).append (" )" + PrintfFormat.NEWLINE);
      return str.toString();
   }
View Full Code Here

    *
    *    @return a confidence interval formatted as a string
    *
    */
   public String formatCIVarianceChi2 (double level, int d)  {
      PrintfFormat str = new PrintfFormat();
      double ci[] = new double[2];
      confidenceIntervalVarianceChi2 (level, ci);
      str.append ("  " + (100*level) + "%");
      str.append (" confidence interval for variance (chi2): (");
      str.append (7 + d, d, d-1, ci[0]).append (',');
      str.append (7 + d, d, d-1, ci[1]).append (" )" + PrintfFormat.NEWLINE);
      return str.toString();
}
View Full Code Here

    *
    *    @return a statistical report formatted as a string
    *
    */
   public String report (double level, int d)  {
      PrintfFormat str = new PrintfFormat();
      str.append ("REPORT on Tally stat. collector ==> " + name);
      str.append (PrintfFormat.NEWLINE + "    num. obs.      min          max        average     standard dev." + PrintfFormat.NEWLINE);
      str.append (7 + d, (int)numObs);   str.append (" ");
      str.append (9 + d, d, d-1, (double)minValue);   str.append (" ");
      str.append (9 + d, d, d-1, (double)maxValue);   str.append (" ");
      str.append (9 + d, d, d-1, (double)average());  str.append (" ");
      str.append (9 + d, d, d-1, standardDeviation());
      str.append (PrintfFormat.NEWLINE);

      switch (confidenceInterval) {
         case CI_NORMAL:
            str.append (formatCINormal (level, d));
            break;
         case CI_STUDENT:
            str.append (formatCIStudent (level, d));
            break;
      }

      return str.toString();
   }
View Full Code Here

      return str.toString();
   }


   public String shortReportHeader() {
      PrintfFormat pf = new PrintfFormat();
      if (showNobs)
         pf.append (-8, "num obs.").append ("  ");
      pf.append (-8, "   min").append ("   ");
      pf.append (-8, "   max").append ("   ");
      pf.append (-8, "   average").append ("   ");
      pf.append (-8, "   std. dev.");
      if (confidenceInterval != CIType.CI_NONE)
         pf.append ("   ").append (-12, "conf. int.");

      return pf.toString();
   }
View Full Code Here

    *
    * @return the string containing the report.
    *
    */
   public String shortReport() {
      PrintfFormat pf = new PrintfFormat();
      if (showNobs)
         pf.append (-8, numberObs());
      pf.append (9, 3, 2, min()).append ("   ");
      pf.append (9, 3, 2, max()).append ("   ");
      pf.append (10, 3, 2, average()).append ("   ");
      if (numberObs() >= 2)
         pf.append (11, 3, 2, standardDeviation());
      else
         pf.append (11, "---");

      if (confidenceInterval != CIType.CI_NONE) {
         double[] ci = new double[2];
         switch (confidenceInterval) {
         case CI_NORMAL:
            confidenceIntervalNormal (level, ci);
            break;
         case CI_STUDENT:
            confidenceIntervalStudent (level, ci);
            break;
         }
         pf.append ("   ").append ((100*level) + "% (");
         pf.append (9, 3, 2, ci[0] - ci[1]).append (',');
         pf.append (9, 3, 2, ci[0] + ci[1]).append (")");
      }

      return pf.toString();
   }
View Full Code Here

 
    Accumulate sizeWait = waitingList.statSize();
    Tally sojWait = waitingList.statSojourn();
    Tally sojServ = serviceList.statSojourn();
  
    PrintfFormat str = new PrintfFormat();

    str.append ("REPORT ON RESOURCE : ").append (name).append (PrintfFormat.NEWLINE);
    str.append ("   From time : ").append (7, 2, 2, initStatTime);
    str.append ("   to time : ");
    str.append (10,2, 2, sim.time());
    str.append (PrintfFormat.NEWLINE + "                    min        max     average  ");
    str.append ("standard dev.  nb. obs.");

    str.append (PrintfFormat.NEWLINE + "   Capacity    ");
    str.append (8, (int)(statCapacity.min()+0.5));
    str.append (11, (int)(statCapacity.max()+0.5));
    str.append (12, 3, 2, statCapacity.average());
    str.append (PrintfFormat.NEWLINE + "   Utilization ");
    str.append (8, (int)(statUtil.min()+0.5));
    str.append (11, (int)(statUtil.max()+0.5));
    str.append (12, 3, 2, statUtil.average());
    str.append (PrintfFormat.NEWLINE + "   Queue Size  ");
    str.append (8, (int)(sizeWait.min()+0.5));
    str.append (11, (int)(sizeWait.max()+0.5));
    str.append (12, 3, 2, sizeWait.average());

    str.append (PrintfFormat.NEWLINE + "   Wait    ");
    str.append (12, 3, 2, sojWait.min()).append (' ');
    str.append (10, 3, 2, sojWait.max()).append (' ');
    str.append (11, 3, 2, sojWait.average()).append (' ');
    str.append (10, 3, 2, sojWait.standardDeviation());
    str.append (10, sojWait.numberObs());
  
    str.append (PrintfFormat.NEWLINE + "   Service ");
    str.append (12, 3, 2, sojServ.min()).append (' ')
    str.append (10, 3, 2, sojServ.max()).append (' ');
    str.append (11, 3, 2, sojServ.average()).append (' ');
    str.append (10, 3, 2, sojServ.standardDeviation());
    str.append (10, sojServ.numberObs());
   
    str.append (PrintfFormat.NEWLINE + "   Sojourn ");
    str.append (12, 3, 2, statSojourn.min()).append (' ');
    str.append (10, 3, 2, statSojourn.max()).append (' ');
    str.append (11, 3, 2, statSojourn.average()).append (' ');
    str.append (10, 3, 2, statSojourn.standardDeviation());
    str.append (10, statSojourn.numberObs()).append (PrintfFormat.NEWLINE);
   
    return str.toString();
   }
View Full Code Here

   /**
    * @return the state of the generator, formated as a string
    *
    */
   public String toString()  {
      PrintfFormat str = new PrintfFormat();

      str.append ("The current state of the MRG32k3aL");
      if (name != null && name.length() > 0)
         str.append (" " + name);
      str.append (":" + PrintfFormat.NEWLINE + "   Cg = { ");
      str.append ( Cg0 + ", ");
      str.append ( Cg1 + ", ");
      str.append ( Cg2 + ", ");
      str.append ( Cg3 + ", ");
      str.append ( Cg4 + ", ");
      str.append ( Cg5 + " }" + PrintfFormat.NEWLINE +
           PrintfFormat.NEWLINE);

      return str.toString();
   }
View Full Code Here

   /**
    * @return the detailed state of the generator, formatted as a string
    *
    */
   public String toStringFull()  {
      PrintfFormat str = new PrintfFormat();
      str.append ("The MRG32k3aL stream");
      if (name != null && name.length() > 0)
         str.append (" " + name);
      str.append (":" + PrintfFormat.NEWLINE + "   anti = " +
         (anti ? "true" : "false")).append(PrintfFormat.NEWLINE);
      str.append ("   prec53 = " + (prec53 ? "true" : "false")).append(PrintfFormat.NEWLINE);

      str.append ("   Ig = { ");
      for (int i = 0; i < 5; i++)
         str.append ( Ig[i] + ", ");
      str.append ( Ig[5] + " }" + PrintfFormat.NEWLINE);

      str.append ("   Bg = { ");
      for (int i = 0; i < 5; i++)
         str.append ( Bg[i] + ", ");
      str.append ( Bg[5] + " }" + PrintfFormat.NEWLINE);

      str.append ("   Cg = { ");
      str.append ( Cg0 + ", ");
      str.append ( Cg1 + ", ");
      str.append ( Cg2 + ", ");
      str.append ( Cg3 + ", ");
      str.append ( Cg4 + ", ");
      str.append ( Cg5 + " }" + PrintfFormat.NEWLINE +
          PrintfFormat.NEWLINE);

      return str.toString();
   }
View Full Code Here

      if (periode > 0.0return sumValue/periode;
      else  return 0.0;
   }

   public String shortReportHeader() {
      PrintfFormat pf = new PrintfFormat();
      pf.append (-9, "from time").append ("   ");
      pf.append (-9, "to time").append ("   ");
      pf.append (-8, "   min").append ("   ");
      pf.append (-8, "   max").append ("   ");
      pf.append (-10, " average");
      return pf.toString();
   }
View Full Code Here

TOP

Related Classes of umontreal.iro.lecuyer.util.PrintfFormat

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.