X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/aad504c6335cf338e4a478768cadaf4bb1f67cb3..fa4076fe495b91c58d1f6a3cdbbb3cb95b39a4bd:/include/simgrid/kernel/resource/Resource.hpp diff --git a/include/simgrid/kernel/resource/Resource.hpp b/include/simgrid/kernel/resource/Resource.hpp index f1edd894f6..2c1bcc1014 100644 --- a/include/simgrid/kernel/resource/Resource.hpp +++ b/include/simgrid/kernel/resource/Resource.hpp @@ -52,13 +52,12 @@ public: /** @brief Apply an event of external load event to that resource */ virtual void apply_event(profile::Event* event, double value) = 0; - /** @brief Check if the current Resource is used (if it currently serves an action) */ - virtual bool is_used() const = 0; - /** @brief Check if the current Resource is active */ virtual bool is_on() const { return is_on_; } virtual bool is_sealed() const { return sealed_; } + /** @brief Check if the current Resource is used (if it currently serves an action) */ + virtual bool is_used() const = 0; /** @brief Turn on the current Resource */ virtual void turn_on() { is_on_ = true; } /** @brief Turn off the current Resource */ @@ -102,6 +101,8 @@ public: * * The load due to external usages modeled by profile files is ignored.*/ virtual double get_load() const { return constraint_->get_usage(); } + + bool is_used() const override { return model_->get_maxmin_system()->constraint_used(constraint_); } }; } // namespace resource