src/core/examples/main-random-variable.cc
author Vedran Miletić <rivanvx@gmail.com>
Tue, 02 Aug 2011 17:42:33 -0400
changeset 7385 10beb0e53130
parent 7256 b04ba6772f8c
child 8874 f5d7b689eae9
permissions -rw-r--r--
standardize emacs c++ mode comments
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7385
10beb0e53130 standardize emacs c++ mode comments
Vedran Miletić <rivanvx@gmail.com>
parents: 7256
diff changeset
     1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
     2
/*
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
     3
 * Copyright (c) 2008 Timo Bingmann
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
     4
 *
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
     8
 *
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    12
 * GNU General Public License for more details.
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    13
 *
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    17
 *
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    18
 * Author: Timo Bingmann <timo.bingmann@student.kit.edu>
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    19
 */
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    20
#include "ns3/random-variable.h"
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    21
#include "ns3/gnuplot.h"
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    22
#include <map>
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    23
#include <cmath>
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    24
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    25
using namespace ns3;
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    26
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    27
/// Round a double number to the given precision. e.g. dround(0.234, 0.1) = 0.2
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    28
/// and dround(0.257, 0.1) = 0.3
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
    29
double dround (double number, double precision)
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    30
{
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    31
  number /= precision;
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    32
  if (number >= 0)
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
    33
    number = std::floor (number + 0.5);
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    34
  else
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
    35
    number = std::ceil (number - 0.5);
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    36
  number *= precision;
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    37
  return number;
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    38
}
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    39
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    40
static GnuplotDataset
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    41
Histogramm (RandomVariable rndvar, unsigned int probes, double precision, const std::string& title, bool notcontinous = false)
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    42
{
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    43
  typedef std::map<double, unsigned int> histogramm_maptype;
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    44
  histogramm_maptype histogramm;
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    45
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    46
  for(unsigned int i = 0; i < probes; ++i)
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    47
    {
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
    48
      double val = dround ( rndvar.GetValue (), precision );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    49
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    50
      ++histogramm[val];
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    51
    }
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    52
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    53
  Gnuplot2dDataset data;
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
    54
  data.SetTitle (title);
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    55
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    56
  if (notcontinous)
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    57
    {
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
    58
      data.SetStyle (Gnuplot2dDataset::IMPULSES);
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    59
    }
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    60
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
    61
  for(histogramm_maptype::const_iterator hi = histogramm.begin ();
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
    62
      hi != histogramm.end (); ++hi)
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    63
    {
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
    64
      data.Add (hi->first, (double)hi->second / (double)probes / precision);
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    65
    }
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    66
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    67
  return data;
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    68
}
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    69
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    70
int main (int argc, char *argv[])
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    71
{
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    72
  unsigned int probes = 1000000;
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    73
  double precision = 0.01;
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    74
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
    75
  GnuplotCollection gnuplots ("main-random-variables.pdf");
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
    76
  gnuplots.SetTerminal ("pdf enhanced");
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    77
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    78
  {
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    79
    Gnuplot plot;
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
    80
    plot.SetTitle ("UniformVariable");
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
    81
    plot.AppendExtra ("set yrange [0:]");
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    82
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
    83
    plot.AddDataset ( Histogramm (UniformVariable (0.0, 1.0), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
    84
                                  "UniformVariable [0.0 .. 1.0)") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    85
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
    86
    plot.AddDataset ( Gnuplot2dFunction ("0.1",
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
    87
                                         "0 <= x && x <= 1 ? 1.0 : 0") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    88
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
    89
    gnuplots.AddPlot (plot);
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    90
  }
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    91
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    92
  {
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    93
    Gnuplot plot;
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
    94
    plot.SetTitle ("ExponentialVariable");
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
    95
    plot.AppendExtra ("set xrange [0:8]");
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
    96
    plot.AppendExtra ("ExpDist(x,l) = 1/l * exp(-1/l * x)");
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
    97
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
    98
    plot.AddDataset ( Histogramm (ExponentialVariable (0.5), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
    99
                                  "ExponentialVariable m=0.5") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   100
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   101
    plot.AddDataset ( Gnuplot2dFunction ("ExponentialDistribution mean 0.5",
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   102
                                         "ExpDist(x, 0.5)") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   103
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   104
    plot.AddDataset ( Histogramm (ExponentialVariable (1.0), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   105
                                  "ExponentialVariable m=1") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   106
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   107
    plot.AddDataset ( Gnuplot2dFunction ("ExponentialDistribution mean 1.0",
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   108
                                         "ExpDist(x, 1.0)") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   109
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   110
    plot.AddDataset ( Histogramm (ExponentialVariable (1.5), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   111
                                  "ExponentialVariable m=1.5") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   112
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   113
    plot.AddDataset ( Gnuplot2dFunction ("ExponentialDistribution mean 1.5",
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   114
                                         "ExpDist(x, 1.5)") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   115
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   116
    gnuplots.AddPlot (plot);
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   117
  }
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   118
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   119
  {
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   120
    Gnuplot plot;
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   121
    plot.SetTitle ("ParetoVariable");
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   122
    plot.AppendExtra ("set xrange [0:2]");
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   123
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   124
    plot.AddDataset ( Histogramm (ParetoVariable (1.0, 1.5), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   125
                                  "ParetoVariable m=1.0 s=1.5") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   126
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   127
    plot.AddDataset ( Histogramm (ParetoVariable (1.0, 2.0), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   128
                                  "ParetoVariable m=1.0 s=2.0") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   129
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   130
    plot.AddDataset ( Histogramm (ParetoVariable (1.0, 2.5), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   131
                                  "ParetoVariable m=1.0 s=2.5") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   132
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   133
    gnuplots.AddPlot (plot);
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   134
  }
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   135
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   136
  {
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   137
    Gnuplot plot;
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   138
    plot.SetTitle ("WeibullVariable");
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   139
    plot.AppendExtra ("set xrange [0:3]");
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   140
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   141
    plot.AddDataset ( Histogramm (WeibullVariable (1.0, 1.0), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   142
                                  "WeibullVariable m=1.0 s=1.0") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   143
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   144
    plot.AddDataset ( Histogramm (WeibullVariable (1.0, 2.0), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   145
                                  "WeibullVariable m=1.0 s=2.0") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   146
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   147
    plot.AddDataset ( Histogramm (WeibullVariable (1.0, 3.0), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   148
                                  "WeibullVariable m=1.0 s=3.0") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   149
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   150
    gnuplots.AddPlot (plot);
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   151
  }
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   152
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   153
  {
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   154
    Gnuplot plot;
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   155
    plot.SetTitle ("NormalVariable");
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   156
    plot.AppendExtra ("set xrange [-3:3]");
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   157
    plot.AppendExtra ("NormalDist(x,m,s) = 1 / (s * sqrt(2*pi)) * exp(-1.0 / 2.0 * ((x-m) / s)**2)");
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   158
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   159
    plot.AddDataset ( Histogramm (NormalVariable (0.0, 1.0), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   160
                                  "NormalVariable m=0.0 v=1.0") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   161
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   162
    plot.AddDataset ( Gnuplot2dFunction ("NormalDist {/Symbol m}=0.0 {/Symbol s}=1.0",
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   163
                                         "NormalDist(x,0.0,1.0)") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   164
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   165
    plot.AddDataset ( Histogramm (NormalVariable (0.0, 2.0), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   166
                                  "NormalVariable m=0.0 v=2.0") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   167
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   168
    plot.AddDataset ( Gnuplot2dFunction ("NormalDist {/Symbol m}=0.0 {/Symbol s}=sqrt(2.0)",
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   169
                                         "NormalDist(x,0.0,sqrt(2.0))") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   170
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   171
    plot.AddDataset ( Histogramm (NormalVariable (0.0, 3.0), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   172
                                  "NormalVariable m=0.0 v=3.0") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   173
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   174
    plot.AddDataset ( Gnuplot2dFunction ("NormalDist {/Symbol m}=0.0 {/Symbol s}=sqrt(3.0)",
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   175
                                         "NormalDist(x,0.0,sqrt(3.0))") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   176
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   177
    gnuplots.AddPlot (plot);
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   178
  }
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   179
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   180
  {
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   181
    Gnuplot plot;
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   182
    plot.SetTitle ("EmpiricalVariable");
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   183
    plot.AppendExtra ("set xrange [*:*]");
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   184
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   185
    EmpiricalVariable emp1;
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   186
    emp1.CDF (0.0,  0.0 / 15.0);
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   187
    emp1.CDF (0.2,  1.0 / 15.0);
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   188
    emp1.CDF (0.4,  3.0 / 15.0);
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   189
    emp1.CDF (0.6,  6.0 / 15.0);
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   190
    emp1.CDF (0.8, 10.0 / 15.0);
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   191
    emp1.CDF (1.0, 15.0 / 15.0);
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   192
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   193
    plot.AddDataset ( Histogramm (emp1, probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   194
                                  "EmpiricalVariable (Stairs)") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   195
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   196
    gnuplots.AddPlot (plot);
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   197
  }
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   198
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   199
  {
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   200
    Gnuplot plot;
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   201
    plot.SetTitle ("DeterministicVariable");
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   202
    plot.AppendExtra ("set xrange [*:*]");
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   203
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   204
    double values[] = { 0.0, 0.2, 0.2, 0.4, 0.2, 0.6, 0.8, 0.8, 1.0 };
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   205
    DeterministicVariable det1 (values, sizeof(values) / sizeof(values[0]));
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   206
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   207
    plot.AddDataset ( Histogramm (det1, probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   208
                                  "DeterministicVariable", true) );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   209
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   210
    gnuplots.AddPlot (plot);
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   211
  }
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   212
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   213
  {
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   214
    Gnuplot plot;
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   215
    plot.SetTitle ("LogNormalVariable");
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   216
    plot.AppendExtra ("set xrange [0:3]");
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   217
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   218
    plot.AppendExtra ("LogNormalDist(x,m,s) = 1.0/x * NormalDist(log(x), m, s)");
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   219
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   220
    plot.AddDataset ( Histogramm (LogNormalVariable (0.0, 1.0), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   221
                                  "LogNormalVariable m=0.0 s=1.0") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   222
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   223
    plot.AddDataset ( Gnuplot2dFunction ("LogNormalDist(x, 0.0, 1.0)",
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   224
                                         "LogNormalDist(x, 0.0, 1.0)") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   225
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   226
    plot.AddDataset ( Histogramm (LogNormalVariable (0.0, 0.5), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   227
                                  "LogNormalVariable m=0.0 s=0.5") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   228
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   229
    plot.AddDataset ( Histogramm (LogNormalVariable (0.0, 0.25), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   230
                                  "LogNormalVariable m=0.0 s=0.25") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   231
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   232
    plot.AddDataset ( Gnuplot2dFunction ("LogNormalDist(x, 0.0, 0.25)",
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   233
                                         "LogNormalDist(x, 0.0, 0.25)") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   234
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   235
    plot.AddDataset ( Histogramm (LogNormalVariable (0.0, 0.125), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   236
                                  "LogNormalVariable m=0.0 s=0.125") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   237
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   238
    plot.AddDataset ( Histogramm (LogNormalVariable (0.0, 2.0), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   239
                                  "LogNormalVariable m=0.0 s=2.0") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   240
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   241
    plot.AddDataset ( Gnuplot2dFunction ("LogNormalDist(x, 0.0, 2.0)",
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   242
                                         "LogNormalDist(x, 0.0, 2.0)") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   243
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   244
    plot.AddDataset ( Histogramm (LogNormalVariable (0.0, 2.5), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   245
                                  "LogNormalVariable m=0.0 s=2.5") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   246
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   247
    gnuplots.AddPlot (plot);
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   248
  }
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   249
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   250
  {
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   251
    Gnuplot plot;
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   252
    plot.SetTitle ("TriangularVariable");
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   253
    plot.AppendExtra ("set xrange [*:*]");
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   254
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   255
    plot.AddDataset ( Histogramm (TriangularVariable (0.0, 1.0, 0.5), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   256
                                  "TriangularVariable [0.0 .. 1.0) m=0.5") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   257
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   258
    plot.AddDataset ( Histogramm (TriangularVariable (0.0, 1.0, 0.4), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   259
                                  "TriangularVariable [0.0 .. 1.0) m=0.4") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   260
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   261
    plot.AddDataset ( Histogramm (TriangularVariable (0.0, 1.0, 0.65), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   262
                                  "TriangularVariable [0.0 .. 1.0) m=0.65") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   263
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   264
    gnuplots.AddPlot (plot);
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   265
  }
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   266
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   267
  {
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   268
    Gnuplot plot;
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   269
    plot.SetTitle ("GammaVariable");
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   270
    plot.AppendExtra ("set xrange [0:10]");
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   271
    plot.AppendExtra ("set yrange [0:1]");
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   272
    plot.AppendExtra ("GammaDist(x,a,b) = x**(a-1) * 1/b**a * exp(-x/b) / gamma(a)");
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   273
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   274
    plot.AppendExtra ("set label 1 '{/Symbol g}(x,{/Symbol a},{/Symbol b}) = x^{/Symbol a-1} e^{-x {/Symbol b}^{-1}} ( {/Symbol b}^{/Symbol a} {/Symbol G}({/Symbol a}) )^{-1}' at 0.7, 0.9");
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   275
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   276
    plot.AddDataset ( Histogramm (GammaVariable (1.0, 1.0), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   277
                                  "GammaVariable a=1.0 b=1.0") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   278
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   279
    plot.AddDataset ( Gnuplot2dFunction ("{/Symbol g}(x, 1.0, 1.0)",
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   280
                                         "GammaDist(x, 1.0, 1.0)") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   281
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   282
    plot.AddDataset ( Histogramm (GammaVariable (1.5, 1.0), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   283
                                  "GammaVariable a=1.5 b=1.0") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   284
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   285
    plot.AddDataset ( Gnuplot2dFunction ("{/Symbol g}(x, 1.5, 1.0)",
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   286
                                         "GammaDist(x, 1.5, 1.0)") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   287
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   288
    plot.AddDataset ( Histogramm (GammaVariable (2.0, 1.0), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   289
                                  "GammaVariable a=2.0 b=1.0") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   290
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   291
    plot.AddDataset ( Gnuplot2dFunction ("{/Symbol g}(x, 2.0, 1.0)",
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   292
                                         "GammaDist(x, 2.0, 1.0)") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   293
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   294
    plot.AddDataset ( Histogramm (GammaVariable (4.0, 1.0), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   295
                                  "GammaVariable a=4.0 b=1.0") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   296
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   297
    plot.AddDataset ( Gnuplot2dFunction ("{/Symbol g}(x, 4.0, 1.0)",
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   298
                                         "GammaDist(x, 4.0, 1.0)") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   299
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   300
    plot.AddDataset ( Histogramm (GammaVariable (2.0, 2.0), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   301
                                  "GammaVariable a=2.0 b=2.0") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   302
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   303
    plot.AddDataset ( Gnuplot2dFunction ("{/Symbol g}(x, 2.0, 2.0)",
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   304
                                         "GammaDist(x, 2.0, 2.0)") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   305
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   306
    plot.AddDataset ( Histogramm (GammaVariable (2.5, 3.0), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   307
                                  "GammaVariable a=2.5 b=3.0") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   308
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   309
    plot.AddDataset ( Gnuplot2dFunction ("{/Symbol g}(x, 2.5, 3.0)",
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   310
                                         "GammaDist(x, 2.5, 3.0)") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   311
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   312
    plot.AddDataset ( Histogramm (GammaVariable (2.5, 4.5), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   313
                                  "GammaVariable a=2.5 b=4.5") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   314
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   315
    plot.AddDataset ( Gnuplot2dFunction ("{/Symbol g}(x, 2.5, 4.5)",
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   316
                                         "GammaDist(x, 2.5, 4.5)") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   317
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   318
    gnuplots.AddPlot (plot);
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   319
  }
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   320
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   321
  {
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   322
    Gnuplot plot;
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   323
    plot.SetTitle ("ErlangVariable");
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   324
    plot.AppendExtra ("set xrange [0:10]");
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   325
    plot.AppendExtra ("ErlangDist(x,k,l) = x**(k-1) * 1/l**k * exp(-x/l) / (k-1)!");
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   326
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   327
    plot.AppendExtra ("set label 1 'Erlang(x,k,{/Symbol l}) = x^{k-1} e^{-x {/Symbol l}^{-1}} ( {/Symbol l}^k (k-1)! )^{-1}' at 0.7, 0.9");
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   328
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   329
    plot.AddDataset ( Histogramm (ErlangVariable (1, 1.0), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   330
                                  "ErlangVariable k=1 {/Symbol l}=1.0") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   331
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   332
    plot.AddDataset ( Gnuplot2dFunction ("Erlang(x, 1, 1.0)",
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   333
                                         "ErlangDist(x, 1, 1.0)") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   334
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   335
    plot.AddDataset ( Histogramm (ErlangVariable (2, 1.0), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   336
                                  "ErlangVariable k=2 {/Symbol l}=1.0") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   337
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   338
    plot.AddDataset ( Gnuplot2dFunction ("Erlang(x, 2, 1.0)",
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   339
                                         "ErlangDist(x, 2, 1.0)") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   340
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   341
    plot.AddDataset ( Histogramm (ErlangVariable (3, 1.0), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   342
                                  "ErlangVariable k=3 {/Symbol l}=1.0") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   343
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   344
    plot.AddDataset ( Gnuplot2dFunction ("Erlang(x, 3, 1.0)",
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   345
                                         "ErlangDist(x, 3, 1.0)") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   346
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   347
    plot.AddDataset ( Histogramm (ErlangVariable (5, 1.0), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   348
                                  "ErlangVariable k=5 {/Symbol l}=1.0") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   349
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   350
    plot.AddDataset ( Gnuplot2dFunction ("Erlang(x, 5, 1.0)",
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   351
                                         "ErlangDist(x, 5, 1.0)") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   352
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   353
    plot.AddDataset ( Histogramm (ErlangVariable (2, 2.0), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   354
                                  "ErlangVariable k=2 {/Symbol l}=2.0") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   355
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   356
    plot.AddDataset ( Gnuplot2dFunction ("Erlang(x, 2, 2.0)",
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   357
                                         "ErlangDist(x, 2, 2.0)") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   358
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   359
    plot.AddDataset ( Histogramm (ErlangVariable (2, 3.0), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   360
                                  "ErlangVariable k=2 {/Symbol l}=3.0") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   361
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   362
    plot.AddDataset ( Gnuplot2dFunction ("Erlang(x, 2, 3.0)",
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   363
                                         "ErlangDist(x, 2, 3.0)") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   364
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   365
    plot.AddDataset ( Histogramm (ErlangVariable (2, 5.0), probes, precision,
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   366
                                  "ErlangVariable k=2 {/Symbol l}=5.0") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   367
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   368
    plot.AddDataset ( Gnuplot2dFunction ("Erlang(x, 2, 5.0)",
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   369
                                         "ErlangDist(x, 2, 5.0)") );
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   370
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   371
    gnuplots.AddPlot (plot);
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   372
  }
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   373
7256
b04ba6772f8c rerun check-style.py at default level to enforce space after function name
Tom Henderson <tomh@tomh.org>
parents: 7025
diff changeset
   374
  gnuplots.GenerateOutput (std::cout);
4317
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   375
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   376
  return 0;
0a250f44e0ed bug 475: GammaVariable and ErlangVariable
Timo Bingmann <timo.bingmann@student.kit.edu>
parents:
diff changeset
   377
}