SUMO - Simulation of Urban MObility
Distribution_Points.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
18 // The description of a distribution by a curve
19 /****************************************************************************/
20 #ifndef Distribution_Points_h
21 #define Distribution_Points_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include "RandomDistributor.h"
34 #include "Distribution.h"
35 
36 
37 // ===========================================================================
38 // class definitions
39 // ===========================================================================
47  public Distribution, public RandomDistributor<double> {
48 public:
50  Distribution_Points(const std::string& id);
51 
53  virtual ~Distribution_Points();
54 
62  double sample(std::mt19937* which = 0) const {
63  return get(which);
64  }
65 
67  double getMax() const;
68 
70  std::string toStr(std::streamsize accuracy) const;
71 };
72 
73 
74 #endif
75 
76 /****************************************************************************/
77 
Represents a generic random distribution.
std::string toStr(std::streamsize accuracy) const
Returns the string representation of this distribution.
double sample(std::mt19937 *which=0) const
Draw a sample of the distribution.
virtual ~Distribution_Points()
Destructor.
Distribution_Points(const std::string &id)
Constructor.
double getMax() const
Returns the maximum value of this distribution.