Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEDemandElementDistribution.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// A abstract class for demand elements distributions
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
24
25// ===========================================================================
26// class declaration
27// ===========================================================================
28
29class GNEUndoList;
30
31// ===========================================================================
32// class definitions
33// ===========================================================================
34
36
39 friend class GNERouteHandler;
40
41public:
44
46 bool isDistributionEmpty() const;
47
49 bool keyExists(const GNEDemandElement* key) const;
50
52 bool isValueValid(const GNEDemandElement* key, const double value) const;
53
55 const std::map<const GNEDemandElement*, double>& getDistributionKeyValues() const;
56
58 std::map<std::string, GNEDemandElement*> getPossibleDistributionKeys(SumoXMLTag type) const;
59
61 std::string getAttributeDistributionKeys() const;
62
64 std::string getAttributeDistributionValues() const;
65
68
70 void addDistributionKey(const GNEDemandElement* key, const double value, GNEUndoList* undoList);
71
73 void removeDistributionKey(const GNEDemandElement* key, GNEUndoList* undoList);
74
76 void editDistributionValue(const GNEDemandElement* key, const double newValue, GNEUndoList* undoList);
77
78private:
81
83 std::map<const GNEDemandElement*, double> myDistributionValues;
84
86 void addDistributionKey(const GNEDemandElement* key, const double value);
87
90
92 void editDistributionValue(const GNEDemandElement* key, const double newValue);
93
96
99};
SumoXMLTag
Numbers representing SUMO-XML - element names.
the function-object for an editing operation (abstract base)
GNEDemandElement * myDemandElement
demand element
GNEDemandElementDistribution(const GNEDemandElementDistribution &)=delete
Invalidated copy constructor.
double getAttributeDistributionValue(const GNEDemandElement *key)
get attribute distribution value
void removeDistributionKey(const GNEDemandElement *key, GNEUndoList *undoList)
remove distribution key
std::map< const GNEDemandElement *, double > myDistributionValues
map with distribution keys and values
void addDistributionKey(const GNEDemandElement *key, const double value, GNEUndoList *undoList)
add distribution key
void editDistributionValue(const GNEDemandElement *key, const double newValue, GNEUndoList *undoList)
remove distribution (used in GNEDemandElementDistribution)
const std::map< const GNEDemandElement *, double > & getDistributionKeyValues() const
get map with distribution keys and values
std::map< std::string, GNEDemandElement * > getPossibleDistributionKeys(SumoXMLTag type) const
get list of possible keys sorted by ID
std::string getAttributeDistributionKeys() const
get attribute distribution keys in string format sorted by ID
bool isDistributionEmpty() const
check if distribution is empty
std::string getAttributeDistributionValues() const
get attribute distribution keys in string format sorted by ID
GNEDemandElementDistribution & operator=(const GNEDemandElementDistribution &)=delete
Invalidated assignment operator.
bool keyExists(const GNEDemandElement *key) const
check if the given key can be added in distribution
bool isValueValid(const GNEDemandElement *key, const double value) const
check if the given key-value can be added in distribution
Builds trigger objects for GNENet (busStops, chargingStations, detectors, etc..)