#include <simgrid/kernel/resource/Action.hpp>
+extern "C" {
+
+/** @brief Possible update mechanisms */
+enum e_UM_t {
+ UM_FULL, /**< Full update mechanism: the remaining time of every action is recomputed at each step */
+ UM_LAZY, /**< Lazy update mechanism: only the modified actions get recomputed.
+ It may be slower than full if your system is tightly coupled to the point where every action
+ gets recomputed anyway. In that case, you'd better not try to be cleaver with lazy and go for
+ a simple full update. */
+ UM_UNDEFINED /**< Mechanism not defined */
+};
+}
+
namespace simgrid {
namespace kernel {
namespace resource {
virtual ~Model();
/** @brief Get the set of [actions](@ref Action) in *ready* state */
- virtual ActionList* getReadyActionSet() const { return readyActionSet_; }
+ Action::StateSet* getReadyActionSet() const { return ready_action_set_; }
/** @brief Get the set of [actions](@ref Action) in *running* state */
- virtual ActionList* getRunningActionSet() const { return runningActionSet_; }
+ Action::StateSet* getRunningActionSet() const { return running_action_set_; }
/** @brief Get the set of [actions](@ref Action) in *failed* state */
- virtual ActionList* getFailedActionSet() const { return failedActionSet_; }
+ Action::StateSet* getFailedActionSet() const { return failed_action_set_; }
/** @brief Get the set of [actions](@ref Action) in *done* state */
- virtual ActionList* getDoneActionSet() const { return doneActionSet_; }
+ Action::StateSet* getDoneActionSet() const { return done_action_set_; }
/** @brief Get the set of modified [actions](@ref Action) */
- virtual ActionLmmListPtr getModifiedSet() const { return modifiedSet_; }
+ Action::ModifiedSet* getModifiedSet() const;
/** @brief Get the maxmin system of the current Model */
- lmm_system_t getMaxminSystem() const { return maxminSystem_; }
+ lmm::System* getMaxminSystem() const { return maxmin_system_; }
/**
* @brief Get the update mechanism of the current Model
* @see e_UM_t
*/
- e_UM_t getUpdateMechanism() const { return updateMechanism_; }
- void setUpdateMechanism(e_UM_t mechanism) { updateMechanism_ = mechanism; }
+ e_UM_t getUpdateMechanism() const { return update_mechanism_; }
+ void setUpdateMechanism(e_UM_t mechanism) { update_mechanism_ = mechanism; }
/** @brief Get Action heap */
- heap_type& getActionHeap() { return actionHeap_; }
+ heap_type& getActionHeap() { return action_heap_; }
- double actionHeapTopDate() const { return actionHeap_.top().first; }
+ double actionHeapTopDate() const { return action_heap_.top().first; }
Action* actionHeapPop();
- bool actionHeapIsEmpty() const { return actionHeap_.empty(); }
+ bool actionHeapIsEmpty() const { return action_heap_.empty(); }
/**
* @brief Share the resources between the actions
virtual bool nextOccuringEventIsIdempotent() { return true; }
protected:
- ActionLmmListPtr modifiedSet_;
- lmm_system_t maxminSystem_ = nullptr;
- bool selectiveUpdate_;
+ lmm::System* maxmin_system_ = nullptr;
private:
- e_UM_t updateMechanism_ = UM_UNDEFINED;
- ActionList* readyActionSet_; /**< Actions in state SURF_ACTION_READY */
- ActionList* runningActionSet_; /**< Actions in state SURF_ACTION_RUNNING */
- ActionList* failedActionSet_; /**< Actions in state SURF_ACTION_FAILED */
- ActionList* doneActionSet_; /**< Actions in state SURF_ACTION_DONE */
- heap_type actionHeap_;
+ e_UM_t update_mechanism_ = UM_UNDEFINED;
+ Action::StateSet* ready_action_set_ = new Action::StateSet(); /**< Actions in state SURF_ACTION_READY */
+ Action::StateSet* running_action_set_ = new Action::StateSet(); /**< Actions in state SURF_ACTION_RUNNING */
+ Action::StateSet* failed_action_set_ = new Action::StateSet(); /**< Actions in state SURF_ACTION_FAILED */
+ Action::StateSet* done_action_set_ = new Action::StateSet(); /**< Actions in state SURF_ACTION_DONE */
+ heap_type action_heap_;
};
} // namespace resource