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

Public GIT Repository
say bye to simgrid::surf namespace
[simgrid.git] / src / surf / cpu_cas01.cpp
index 1142c220b10bfdf98da3bb0ccc761f990385dcc8..62c30c493975e7b40612b34f5409765efe3ed4c7 100644 (file)
@@ -79,11 +79,6 @@ CpuImpl* CpuCas01Model::create_cpu(s4u::Host* host, const std::vector<double>& s
 /************
  * Resource *
  ************/
-bool CpuCas01::is_used() const
-{
-  return get_model()->get_maxmin_system()->constraint_used(get_constraint());
-}
-
 /** @brief take into account changes of speed (either load or max) */
 void CpuCas01::on_speed_change()
 {
@@ -112,7 +107,7 @@ void CpuCas01::apply_event(profile::Event* event, double value)
     on_speed_change();
 
     tmgr_trace_event_unref(&speed_.event);
-  } else if (event == state_event_) {
+  } else if (event == get_state_event()) {
     if (value > 0) {
       if (not is_on()) {
         XBT_VERB("Restart actors on host %s", get_iface()->get_cname());
@@ -134,7 +129,7 @@ void CpuCas01::apply_event(profile::Event* event, double value)
         }
       }
     }
-    tmgr_trace_event_unref(&state_event_);
+    unref_state_event();
 
   } else {
     xbt_die("Unknown event!\n");
@@ -167,7 +162,7 @@ CpuAction* CpuCas01::sleep(double duration)
   if (duration > 0)
     duration = std::max(duration, sg_surf_precision);
 
-  XBT_IN("(%s,%g)", get_cname(), duration);
+  XBT_IN("(%s, %g)", get_cname(), duration);
   auto* action = new CpuCas01Action(get_model(), 1.0, not is_on(), speed_.scale * speed_.peak, get_constraint(), 1);
 
   // FIXME: sleep variables should not consume 1.0 in System::expand()
@@ -208,11 +203,6 @@ CpuCas01Action::CpuCas01Action(Model* model, double cost, bool failed, double sp
   model->get_maxmin_system()->expand(constraint, get_variable(), 1.0);
 }
 
-int CpuCas01Action::requested_core() const
-{
-  return requested_core_;
-}
-
 } // namespace resource
 } // namespace kernel
 } // namespace simgrid