-bool Action::is_suspended()
-{
- return suspended_ == SuspendStates::suspended;
-}
-/* insert action on heap using a given key and a hat (heap_action_type)
- * a hat can be of three types for communications:
- *
- * NORMAL = this is a normal heap entry stating the date to finish transmitting
- * LATENCY = this is a heap entry to warn us when the latency is payed
- * MAX_DURATION =this is a heap entry to warn us when the max_duration limit is reached
- */
-void Action::heapInsert(double key, Action::Type hat)
-{
- type_ = hat;
- heap_hook_ = get_model()->getActionHeap().emplace(std::make_pair(key, this));
-}
-
-void Action::heapRemove()
-{
- type_ = Action::Type::NOTSET;
- if (heap_hook_) {
- get_model()->getActionHeap().erase(*heap_hook_);
- clearHeapHandle();
- }
-}
-
-void Action::heapUpdate(double key, Action::Type hat)
-{
- type_ = hat;
- if (heap_hook_) {
- get_model()->getActionHeap().update(*heap_hook_, std::make_pair(key, this));
- } else {
- heap_hook_ = get_model()->getActionHeap().emplace(std::make_pair(key, this));
- }
-}
-