5 #include <Poco/Timestamp.h>
6 #include <Poco/DateTimeFormatter.h>
29 (*this) = std::forward<CalculatorAlgorithmData>(rhs);
46 order = std::move(rhs.getOrder());
47 items = std::move(rhs.getItems());
67 (*this) = std::forward<CalculatorNodeResourceData>(rhs);
84 identity = std::move(rhs.getIdentity());
85 items = std::move(rhs.getItems());
99 std::vector<std::pair<std::string, double> > weights;
108 weights.push_back(std::make_pair(nodeDataList.
getItem(i).getIdentity(),
weight));
114 std::function<bool(std::pair<std::string, double>, std::pair<std::string, double>)> comp;
116 comp = [](std::pair<std::string, double> lhs, std::pair<std::string, double> rhs){
return (lhs.second>rhs.second);};
118 comp = [](std::pair<std::string, double> lhs, std::pair<std::string, double> rhs){
return (lhs.second<rhs.second);};
120 std::sort(weights.begin(), weights.end(), comp);
122 if (!weights.empty())
124 if (weights.front().second != weights.back().second)
126 identity = weights[0].first;
134 std::vector<double> listWeights;
135 for (ResourceUsageCollection::iterator iT=collection.begin();iT!=collection.end();++iT)
140 weight += ((*iT).getItem((*iter).first) * (*iter).second);
142 listWeights.push_back(weight);
151 algorithm = createAlgorithm(type);
156 std::string identity;
157 if (!algorithm.isNull())
159 identity = algorithm->calculate(algorithmData, nodeDataList, resourceUsageManager);
166 std::vector<double> listWeights;
167 if (!algorithm.isNull())
169 listWeights = algorithm->getListWeights(algorithmData, collection);
176 Poco::SharedPtr<CalculatorAlgorithm> pAlg =
nullptr;