- double value = -1;
-
- solve(sys);
-
- ActionList::iterator it(running_actions->begin()), itend(running_actions->end());
- for(; it != itend ; ++it) {
- action = &*it;
- value = lmm_variable_getvalue(action->getVariable());
- if ((value > 0) || (action->getMaxDuration() >= 0))
- break;
- }
-
- if (!action)
- return -1.0;
-
- if (value > 0) {
- if (action->getRemains() > 0)
- min = action->getRemainsNoUpdate() / value;
- else
- min = 0.0;
- if ((action->getMaxDuration() >= 0) && (action->getMaxDuration() < min))
- min = action->getMaxDuration();
- } else
- min = action->getMaxDuration();
-
-
- for (++it; it != itend; ++it) {
- action = &*it;
- value = lmm_variable_getvalue(action->getVariable());
+ for (auto it(getRunningActionSet()->begin()), itend(getRunningActionSet()->end()); it != itend ; ++it) {
+ Action *action = &*it;
+ double value = lmm_variable_getvalue(action->getVariable());