| 238 | } |
| 239 | |
| 240 | void Controller::prepareLRMS() { |
| 241 | // cache not-off indices and on indices |
| 242 | for (auto& v : not_off_indices_) { |
| 243 | v.clear(); |
| 244 | } |
| 245 | for (const size_t& i : not_off_total_) { |
| 246 | const auto lr = lrms_[i].load(std::memory_order::relaxed); |
| 247 | c_lrms_[i] = lr; |
| 248 | not_off_indices_[static_cast<size_t>(lr)].emplace_back(i); |
| 249 | } |
| 250 | is_lr_on_ = !not_off_indices_[1].empty() || !not_off_indices_[2].empty(); |
| 251 | is_ms_on_ = !not_off_indices_[3].empty() || !not_off_indices_[4].empty(); |
| 252 | } |
| 253 | |
| 254 | void Controller::prepareDynamics() { |
| 255 | // cache dynamic on flags |