m_lastValue = lmm_variable_getvalue(getVariable());
}
-void CpuAction::setBound(double bound)
-{
- XBT_IN("(%p,%g)", this, bound);
- m_bound = bound;
- lmm_update_variable_bound(getModel()->getMaxminSystem(), getVariable(), bound);
-
- if (getModel()->getUpdateMechanism() == UM_LAZY)
- heapRemove(getModel()->getActionHeap());
- XBT_OUT();
-}
-
/*
*
* This function formulates a constraint problem that pins a given task to
/**
* @brief CpuAction constructor
*/
- CpuAction(): m_bound(0) {};
+ CpuAction() {};
/**
* @brief CpuAction constructor
* @param failed [TODO]
*/
CpuAction(ModelPtr model, double cost, bool failed)
- : Action(model, cost, failed), m_bound(0) {} //FIXME:REMOVE
+ : Action(model, cost, failed) {} //FIXME:REMOVE
/**
* @brief CpuAction constructor
* @param var The lmm variable associated to this CpuAction if it is part of a LMM component
*/
CpuAction(ModelPtr model, double cost, bool failed, lmm_variable_t var)
- : Action(model, cost, failed, var), m_bound(0) {}
+ : Action(model, cost, failed, var) {}
/**
* @brief Set the affinity of the current CpuAction
*/
virtual void setAffinity(CpuPtr cpu, unsigned long mask);
- /**
- * @brief Set the bound of current CpuAction
- * @details [TODO]
- *
- * @param bound [TODO]
- */
- virtual void setBound(double bound);
-
- /**
- * @brief Get the bound of the current CpuAction
- *
- * @return The bound of the current CpuAction
- */
- double getBound() { return m_bound; }
-
void setState(e_surf_action_state_t state);
void updateRemainingLazy(double now);
- double m_bound; /*< the capping of the CPU use */
+
};
#endif /* SURF_CPU_INTERFACE_HPP_ */
XBT_OUT();
}
+double Action::getBound()
+{
+ return (p_variable) ? lmm_variable_getbound(p_variable) : 0;
+}
+
+void Action::setBound(double bound)
+{
+ XBT_IN("(%p,%g)", this, bound);
+ if (p_variable)
+ lmm_update_variable_bound(getModel()->getMaxminSystem(), getVariable(), bound);
+
+ if (getModel()->getUpdateMechanism() == UM_LAZY)
+ heapRemove(getModel()->getActionHeap());
+ XBT_OUT();
+}
+
double Action::getStartTime()
{
return m_start;
*/
virtual void setState(e_surf_action_state_t state);
+ /**
+ * @brief Get the bound of the current Action
+ *
+ * @return The bound of the current Action
+ */
+ double getBound();
+
+ /**
+ * @brief Set the bound of the current Action
+ *
+ * @param bound The new bound of the current Action
+ */
+ void setBound(double bound);
+
/**
* @brief Get the start time of the current action
*