Eclipse 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-2019 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 /****************************************************************************/
15 // The description of a distribution by a curve
16 /****************************************************************************/
17 #ifndef Distribution_Points_h
18 #define Distribution_Points_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include "RandomDistributor.h"
27 #include "Distribution.h"
28 
29 
30 // ===========================================================================
31 // class definitions
32 // ===========================================================================
40  public Distribution, public RandomDistributor<double> {
41 public:
43  Distribution_Points(const std::string& id);
44 
46  virtual ~Distribution_Points();
47 
55  double sample(std::mt19937* which = 0) const {
56  return get(which);
57  }
58 
60  double getMax() const;
61 
63  std::string toStr(std::streamsize accuracy) const;
64 };
65 
66 
67 #endif
68 
69 /****************************************************************************/
70 
Distribution.h
Distribution
Definition: Distribution.h:37
Distribution_Points::toStr
std::string toStr(std::streamsize accuracy) const
Returns the string representation of this distribution.
Definition: Distribution_Points.cpp:49
RandomDistributor< double >::get
double get(std::mt19937 *which=0) const
Draw a sample of the distribution.
Definition: RandomDistributor.h:113
RandomDistributor.h
Distribution_Points::getMax
double getMax() const
Returns the maximum value of this distribution.
Definition: Distribution_Points.cpp:42
RandomDistributor
Represents a generic random distribution.
Definition: RandomDistributor.h:48
Distribution_Points::~Distribution_Points
virtual ~Distribution_Points()
Destructor.
Definition: Distribution_Points.cpp:38
Distribution_Points
Definition: Distribution_Points.h:39
config.h
Distribution_Points::Distribution_Points
Distribution_Points(const std::string &id)
Constructor.
Definition: Distribution_Points.cpp:34
Distribution_Points::sample
double sample(std::mt19937 *which=0) const
Draw a sample of the distribution.
Definition: Distribution_Points.h:55