]> AND Public Git Repository - simgrid.git/blobdiff - src/surf/disk_s19.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Attribute 'virtual' is redundant with 'override'.
[simgrid.git] / src / surf / disk_s19.cpp
index 2ef29b3d275f1f06dc4d00101ae3708e13ad9ce2..d84dfc318e6904b5d049923cdbb7efee7be9ba07 100644 (file)
@@ -41,7 +41,7 @@ void DiskS19Model::update_actions_state(double /*now*/, double delta)
   for (auto it = std::begin(*get_started_action_set()); it != std::end(*get_started_action_set());) {
     auto& action = *it;
     ++it; // increment iterator here since the following calls to action.finish() may invalidate it
-    action.update_remains(rint(action.get_variable()->get_value() * delta));
+    action.update_remains(rint(action.get_rate() * delta));
     action.update_max_duration(delta);
 
     if (((action.get_remains_no_update() <= 0) && (action.get_variable()->get_penalty() > 0)) ||
@@ -75,7 +75,7 @@ void DiskS19::update_penalties(double delta) const
 {
   const kernel::lmm::Element* elem     = nullptr;
   const kernel::lmm::Element* nextelem = nullptr;
-  int numelem                          = 0;
+  size_t numelem                       = 0;
   while (const auto* var = get_constraint()->get_variable_safe(&elem, &nextelem, &numelem)) {
     auto* action = static_cast<DiskS19Action*>(var->get_id());
     action->sharing_penalty_ += delta;
@@ -88,8 +88,7 @@ void DiskS19::set_read_bandwidth(double value)
 {
   read_bw_.peak = value;
 
-  get_model()->get_maxmin_system()->update_constraint_bound(get_constraint(),
-                                                            sg_bandwidth_factor * (read_bw_.peak * read_bw_.scale));
+  get_model()->get_maxmin_system()->update_constraint_bound(get_constraint(), read_bw_.peak * read_bw_.scale);
 
   double delta = 1.0 / value - 1.0 / (read_bw_.peak * read_bw_.scale);
   update_penalties(delta);
@@ -99,8 +98,7 @@ void DiskS19::set_write_bandwidth(double value)
 {
   write_bw_.peak = value;
 
-  get_model()->get_maxmin_system()->update_constraint_bound(get_constraint(),
-                                                            sg_bandwidth_factor * (write_bw_.peak * write_bw_.scale));
+  get_model()->get_maxmin_system()->update_constraint_bound(get_constraint(), write_bw_.peak * write_bw_.scale);
 
   double delta = 1.0 / value - 1.0 / (write_bw_.peak * write_bw_.scale);
   update_penalties(delta);