X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/801817fee1842a25f3155c0426c96761a4e312ee..9e3bd4e25dac71e594a6e47ee77ccacd51da1a7c:/src/kernel/resource/Resource.cpp diff --git a/src/kernel/resource/Resource.cpp b/src/kernel/resource/Resource.cpp index 6016ae4f80..72899f059f 100644 --- a/src/kernel/resource/Resource.cpp +++ b/src/kernel/resource/Resource.cpp @@ -3,7 +3,7 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ -#include "src/kernel/resource/Resource.hpp" +#include "simgrid/kernel/resource/Resource.hpp" #include "src/kernel/lmm/maxmin.hpp" // Constraint #include "src/surf/surf_interface.hpp" @@ -11,48 +11,48 @@ namespace simgrid { namespace kernel { namespace resource { -Resource::Resource(surf::Model* model, const std::string& name, lmm::Constraint* constraint) +Resource::Resource(Model* model, const std::string& name, lmm::Constraint* constraint) : name_(name), model_(model), constraint_(constraint) { } Resource::~Resource() = default; -bool Resource::isOn() const +bool Resource::is_on() const { - return isOn_; + return is_on_; } -bool Resource::isOff() const +bool Resource::is_off() const { - return not isOn_; + return not is_on_; } -void Resource::turnOn() +void Resource::turn_on() { - isOn_ = true; + is_on_ = true; } -void Resource::turnOff() +void Resource::turn_off() { - isOn_ = false; + is_on_ = false; } -double Resource::getLoad() +double Resource::get_load() { return constraint_->get_usage(); } -surf::Model* Resource::model() const +Model* Resource::get_model() const { return model_; } -const std::string& Resource::getName() const +const std::string& Resource::get_name() const { return name_; } -const char* Resource::getCname() const +const char* Resource::get_cname() const { return name_.c_str(); } @@ -62,9 +62,9 @@ bool Resource::operator==(const Resource& other) const return name_ == other.name_; } -kernel::lmm::Constraint* Resource::constraint() const +kernel::lmm::Constraint* Resource::get_constraint() const { - return const_cast(constraint_); + return constraint_; } } // namespace resource