X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f7397f4d3ef62a8b6a9463a357875ee51479a6a8..7c480b01951b33f03d72ede0a47a45a88bd40b61:/include/simgrid/kernel/resource/Model.hpp diff --git a/include/simgrid/kernel/resource/Model.hpp b/include/simgrid/kernel/resource/Model.hpp index 3478fee4be..dc228ad614 100644 --- a/include/simgrid/kernel/resource/Model.hpp +++ b/include/simgrid/kernel/resource/Model.hpp @@ -35,36 +35,36 @@ public: virtual ~Model(); /** @brief Get the set of [actions](@ref Action) in *ready* state */ - ActionList* getReadyActionSet() const { return readyActionSet_; } + Action::StateSet* get_ready_action_set() const { return ready_action_set_; } /** @brief Get the set of [actions](@ref Action) in *running* state */ - ActionList* getRunningActionSet() const { return runningActionSet_; } + Action::StateSet* get_running_action_set() const { return running_action_set_; } /** @brief Get the set of [actions](@ref Action) in *failed* state */ - ActionList* getFailedActionSet() const { return failedActionSet_; } + Action::StateSet* get_failed_action_set() const { return failed_action_set_; } /** @brief Get the set of [actions](@ref Action) in *done* state */ - ActionList* getDoneActionSet() const { return doneActionSet_; } + Action::StateSet* get_done_action_set() const { return done_action_set_; } /** @brief Get the set of modified [actions](@ref Action) */ - ActionLmmListPtr getModifiedSet() const { return modifiedSet_; } + Action::ModifiedSet* get_modified_set() const; /** @brief Get the maxmin system of the current Model */ - lmm_system_t getMaxminSystem() const { return maxminSystem_; } + lmm::System* get_maxmin_system() 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 @@ -72,9 +72,9 @@ public: * @param now The current time of the simulation * @return The delta of time till the next action will finish */ - virtual double nextOccuringEvent(double now); - virtual double nextOccuringEventLazy(double now); - virtual double nextOccuringEventFull(double now); + virtual double next_occuring_event(double now); + virtual double next_occuring_event_lazy(double now); + virtual double next_occuring_event_full(double now); /** * @brief Update action to the current time @@ -82,9 +82,9 @@ public: * @param now The current time of the simulation * @param delta The delta of time since the last update */ - virtual void updateActionsState(double now, double delta); - virtual void updateActionsStateLazy(double now, double delta); - virtual void updateActionsStateFull(double now, double delta); + virtual void update_actions_state(double now, double delta); + virtual void update_actions_state_lazy(double now, double delta); + virtual void update_actions_state_full(double now, double delta); /** @brief Returns whether this model have an idempotent shareResource() * @@ -94,16 +94,15 @@ public: virtual bool nextOccuringEventIsIdempotent() { return true; } protected: - ActionLmmListPtr modifiedSet_ = nullptr; - lmm_system_t maxminSystem_ = nullptr; + lmm::System* maxmin_system_ = nullptr; private: - e_UM_t updateMechanism_ = UM_UNDEFINED; - ActionList* readyActionSet_ = new ActionList(); /**< Actions in state SURF_ACTION_READY */ - ActionList* runningActionSet_ = new ActionList(); /**< Actions in state SURF_ACTION_RUNNING */ - ActionList* failedActionSet_ = new ActionList(); /**< Actions in state SURF_ACTION_FAILED */ - ActionList* doneActionSet_ = new ActionList(); /**< 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