31 myDemandElement(demandElement) {
50 return ((value >= 0) && (value <= 1));
57const std::map<const GNEDemandElement*, double>&
63std::map<std::string, GNEDemandElement*>
65 std::map<std::string, GNEDemandElement*> possibleKeys;
69 for (
const auto& key : allKeys) {
71 possibleKeys[key.second->getID()] = key.second;
81 std::set<std::string> sortedKeys;
83 sortedKeys.insert(values.first->getID());
93 std::map<std::string, const GNEDemandElement*> sortedKeys;
95 sortedKeys[values.first->getID()] = values.first;
98 std::vector<double> values;
99 for (
const auto& sortedKey : sortedKeys) {
SumoXMLTag
Numbers representing SUMO-XML - element names.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
GNENet * getNet() const
get pointer to net
static void editValue(GNEDemandElement *distribution, const GNEDemandElement *key, const double newValue, GNEUndoList *undoList)
edit value
static void addKey(GNEDemandElement *distribution, const GNEDemandElement *key, const double value, GNEUndoList *undoList)
add new key
static void removeKey(GNEDemandElement *distribution, const GNEDemandElement *key, GNEUndoList *undoList)
remove key
GNEDemandElement * myDemandElement
demand element
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)
GNEDemandElementDistribution(GNEDemandElement *demandElement)
Constructor.
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
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
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEDemandElement * > > & getDemandElements() const
get demand elements
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net