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 /****************************************************************************/
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 
Distribution.h
Distribution
Definition: Distribution.h:38
Distribution_Points::toStr
std::string toStr(std::streamsize accuracy) const
Returns the string representation of this distribution.
Definition: Distribution_Points.cpp:50
RandomDistributor< double >::get
double get(std::mt19937 *which=0) const
Draw a sample of the distribution.
Definition: RandomDistributor.h:111
RandomDistributor.h
Distribution_Points::getMax
double getMax() const
Returns the maximum value of this distribution.
Definition: Distribution_Points.cpp:43
RandomDistributor
Represents a generic random distribution.
Definition: RandomDistributor.h:49
Distribution_Points::~Distribution_Points
virtual ~Distribution_Points()
Destructor.
Definition: Distribution_Points.cpp:39
Distribution_Points
Definition: Distribution_Points.h:40
config.h
Distribution_Points::Distribution_Points
Distribution_Points(const std::string &id)
Constructor.
Definition: Distribution_Points.cpp:35
Distribution_Points::sample
double sample(std::mt19937 *which=0) const
Draw a sample of the distribution.
Definition: Distribution_Points.h:56