Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Cosmetics and snake_casing in Action and Model
[simgrid.git] / src / kernel / resource / Model.cpp
index 5e73044..3eb402d 100644 (file)
@@ -12,7 +12,7 @@ namespace simgrid {
 namespace kernel {
 namespace resource {
 
-Model::Model() = default;
+Model::Model(Model::UpdateAlgo algo) : update_algorithm_(algo) {}
 
 Model::~Model()
 {
@@ -27,7 +27,7 @@ Action* Model::actionHeapPop()
 {
   Action* action = action_heap_.top().second;
   action_heap_.pop();
-  action->clearHeapHandle();
+  action->heap_clear_handle();
   return action;
 }
 
@@ -39,9 +39,9 @@ Action::ModifiedSet* Model::get_modified_set() const
 double Model::next_occuring_event(double now)
 {
   // FIXME: set the good function once and for all
-  if (update_mechanism_ == Model::UpdateAlgo::Lazy)
+  if (update_algorithm_ == Model::UpdateAlgo::Lazy)
     return next_occuring_event_lazy(now);
-  else if (update_mechanism_ == Model::UpdateAlgo::Full)
+  else if (update_algorithm_ == Model::UpdateAlgo::Full)
     return next_occuring_event_full(now);
   else
     xbt_die("Invalid cpu update mechanism!");
@@ -62,7 +62,7 @@ double Model::next_occuring_event_lazy(double now)
       continue;
 
     /* bogus priority, skip it */
-    if (action->get_priority() <= 0 || action->get_type() == Action::Type::LATENCY)
+    if (action->get_priority() <= 0 || action->get_type() == Action::Type::latency)
       continue;
 
     action->update_remains_lazy(now);
@@ -93,7 +93,7 @@ double Model::next_occuring_event_lazy(double now)
               action->get_start_time(), min, share, action->get_max_duration());
 
     if (min > -1) {
-      action->heapUpdate(min, max_duration_flag ? Action::Type::MAX_DURATION : Action::Type::NORMAL);
+      action->heapUpdate(min, max_duration_flag ? Action::Type::max_duration : Action::Type::normal);
       XBT_DEBUG("Insert at heap action(%p) min %f now %f", action, min, now);
     } else
       DIE_IMPOSSIBLE;
@@ -140,9 +140,9 @@ double Model::next_occuring_event_full(double /*now*/)
 
 void Model::update_actions_state(double now, double delta)
 {
-  if (update_mechanism_ == Model::UpdateAlgo::Full)
+  if (update_algorithm_ == Model::UpdateAlgo::Full)
     update_actions_state_full(now, delta);
-  else if (update_mechanism_ == Model::UpdateAlgo::Lazy)
+  else if (update_algorithm_ == Model::UpdateAlgo::Lazy)
     update_actions_state_lazy(now, delta);
   else
     xbt_die("Invalid cpu update mechanism!");