| 76 | } |
| 77 | |
| 78 | OperatePtr Action::toOperate() const { |
| 79 | OperatePtr opt = std::make_shared<DeviceOperateWrapper>(); |
| 80 | opt->act = this->_actionType; |
| 81 | opt->aid = this->getId(); |
| 82 | if (this->_visitedCount <= 1) { |
| 83 | opt->throttle = static_cast<float>(randomInt(10, Action::_throttle)); |
| 84 | } |
| 85 | return opt; |
| 86 | } |
| 87 | |
| 88 | std::shared_ptr<Action> Action::NOP = std::make_shared<Action>(ActionType::NOP); |
| 89 | std::shared_ptr<Action> Action::ACTIVATE = std::make_shared<Action>(ActionType::ACTIVATE); |
no test coverage detected