Commit 4dbecd1e authored by Alessio Netti's avatar Alessio Netti
Browse files

Analytics: minor fixes to CS plugin

parent 01b3bb8f
......@@ -82,7 +82,7 @@ void CSOperator::execOnInit() {
_trainingUnit = _units[0]->getName();
_actualBlocks = _units[0]->getInputs().size() < _numBlocks ? _units[0]->getInputs().size() : _numBlocks;
if(_actualBlocks!=_numBlocks)
LOG(warning) << "Operator " << _name << ": cannot enforce " << _numBlocks << ", using " << _actualBlocks << " instead.";
LOG(warning) << "Operator " << _name << ": cannot enforce " << _numBlocks << " blocks, using " << _actualBlocks << " instead.";
} else {
_actualBlocks = _numBlocks;
}
......@@ -164,9 +164,9 @@ bool CSOperator::dumpToFile(std::string &path) {
// Saving CS data in terms of permutation index, minimum and maximum for each input sensor
for(size_t idx=0; idx<_permVector.size(); idx++) {
boost::property_tree::ptree group;
group.push_back(boost::property_tree::ptree::value_type("idx", std::to_string(_permVector[idx])));
group.push_back(boost::property_tree::ptree::value_type("min", std::to_string(_min[idx])));
group.push_back(boost::property_tree::ptree::value_type("max", std::to_string(_max[idx])));
group.push_back(boost::property_tree::ptree::value_type("idx", boost::property_tree::ptree(std::to_string(_permVector[idx]))));
group.push_back(boost::property_tree::ptree::value_type("min", boost::property_tree::ptree(std::to_string(_min[idx]))));
group.push_back(boost::property_tree::ptree::value_type("max", boost::property_tree::ptree(std::to_string(_max[idx]))));
blocks.add_child(std::to_string(idx), group);
}
root.add_child(std::to_string(_permVector.size()), blocks);
......@@ -324,7 +324,7 @@ void CSOperator::computeMinMax(std::vector<std::vector<reading_t>>& v) {
for (const auto &s : v[idx]) {
if (s.value > max)
max = s.value;
else if (s.value < min)
if (s.value < min)
min = s.value;
}
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment