SUMO - Simulation of Urban MObility
Distribution_Parameterized.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // A distribution described by parameters such as the mean value and std-dev
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef Distribution_MeanDev_h
22 #define Distribution_MeanDev_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <vector>
36 #include "Distribution.h"
37 
38 
39 // ===========================================================================
40 // class definitions
41 // ===========================================================================
50  public Distribution {
51 public:
53  Distribution_Parameterized(const std::string& description);
54 
56  Distribution_Parameterized(const std::string& id, double mean,
57  double deviation);
58 
60  Distribution_Parameterized(const std::string& id, double mean,
61  double deviation, double min, double max);
62 
65 
73  double sample(MTRand* which = 0) const;
74 
76  double getMax() const;
77 
79  std::vector<double>& getParameter() {
80  return myParameter;
81  }
82 
84  const std::vector<double>& getParameter() const {
85  return myParameter;
86  }
87 
89  std::string toStr(std::streamsize accuracy) const;
90 
91 private:
93  std::vector<double> myParameter;
94 
95 };
96 
97 
98 #endif
99 
100 /****************************************************************************/
101 
std::vector< double > myParameter
The distribution&#39;s parameters.
Distribution_Parameterized(const std::string &description)
Constructor for parsable distribution description.
#define min(a, b)
Definition: polyfonts.c:66
std::vector< double > & getParameter()
Returns the parameters of this distribution.
double getMax() const
Returns the maximum value of this distribution.
virtual ~Distribution_Parameterized()
Destructor.
#define max(a, b)
Definition: polyfonts.c:65
std::string toStr(std::streamsize accuracy) const
Returns the string representation of this distribution.
double sample(MTRand *which=0) const
Draw a sample of the distribution.
const std::vector< double > & getParameter() const
Returns the unmodifiable parameters of this distribution.