continue;
/* bogus priority, skip it */
- if (action->getPriority() <= 0 || action->getHat() == Action::Type::LATENCY)
+ if (action->getPriority() <= 0 || action->getType() == Action::Type::LATENCY)
continue;
action->updateRemainingLazy(now);
* Resource *
************/
-namespace simgrid {
-namespace kernel {
-namespace model {
-
-Resource::Resource(surf::Model* model, const std::string& name, lmm::Constraint* constraint)
- : name_(name), model_(model), constraint_(constraint)
-{}
-
-Resource::~Resource() = default;
-
-bool Resource::isOn() const {
- return isOn_;
-}
-bool Resource::isOff() const {
- return not isOn_;
-}
-
-void Resource::turnOn()
-{
- isOn_ = true;
-}
-
-void Resource::turnOff()
-{
- isOn_ = false;
-}
-
-double Resource::getLoad()
-{
- return constraint_->get_usage();
-}
-
-surf::Model* Resource::model() const
-{
- return model_;
-}
-
-const std::string& Resource::getName() const
-{
- return name_;
-}
-
-const char* Resource::getCname() const
-{
- return name_.c_str();
-}
-
-bool Resource::operator==(const Resource &other) const {
- return name_ == other.name_;
-}
-
-kernel::lmm::Constraint* Resource::constraint() const
-{
- return const_cast<kernel::lmm::Constraint*>(constraint_);
-}
-
-}
-} // namespace kernel
-}
-
/**********
* Action *
**********/
void Action::cancel(){
setState(Action::State::failed);
if (getModel()->getUpdateMechanism() == UM_LAZY) {
- if (action_lmm_hook.is_linked())
+ if (modifiedSetHook_.is_linked())
simgrid::xbt::intrusive_erase(*getModel()->getModifiedSet(), *this);
heapRemove(getModel()->getActionHeap());
}
int Action::unref(){
refcount_--;
if (not refcount_) {
- if (action_hook.is_linked())
+ if (stateSetHook_.is_linked())
simgrid::xbt::intrusive_erase(*stateSet_, *this);
if (getVariable())
getModel()->getMaxminSystem()->variable_free(getVariable());
if (getModel()->getUpdateMechanism() == UM_LAZY) {
/* remove from heap */
heapRemove(getModel()->getActionHeap());
- if (action_lmm_hook.is_linked())
+ if (modifiedSetHook_.is_linked())
simgrid::xbt::intrusive_erase(*getModel()->getModifiedSet(), *this);
}
delete this;
*/
void Action::heapInsert(heap_type& heap, double key, Action::Type hat)
{
- hat_ = hat;
+ type_ = hat;
heapHandle_ = heap.emplace(std::make_pair(key, this));
}
void Action::heapRemove(heap_type& heap)
{
- hat_ = Action::Type::NOTSET;
+ type_ = Action::Type::NOTSET;
if (heapHandle_) {
heap.erase(*heapHandle_);
clearHeapHandle();
void Action::heapUpdate(heap_type& heap, double key, Action::Type hat)
{
- hat_ = hat;
+ type_ = hat;
if (heapHandle_) {
heap.update(*heapHandle_, std::make_pair(key, this));
} else {