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-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // The description of a distribution by a curve
17 /****************************************************************************/
18 #ifndef Distribution_Points_h
19 #define Distribution_Points_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include "RandomDistributor.h"
28 #include "Distribution.h"
29 
30 
31 // ===========================================================================
32 // class definitions
33 // ===========================================================================
41  public Distribution, public RandomDistributor<double> {
42 public:
44  Distribution_Points(const std::string& id);
45 
47  virtual ~Distribution_Points();
48 
56  double sample(std::mt19937* which = 0) const {
57  return get(which);
58  }
59 
61  double getMax() const;
62 
64  std::string toStr(std::streamsize accuracy) const;
65 };
66 
67 
68 #endif
69 
70 /****************************************************************************/
71 
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.