Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
mv NetworkAction::rate_ to Action::user_bound_
[simgrid.git] / src / surf / disk_s19.cpp
index 1066e62..11eb89f 100644 (file)
@@ -31,11 +31,9 @@ DiskS19Model::DiskS19Model()
   all_existing_models.push_back(this);
 }
 
-DiskImpl* DiskS19Model::createDisk(const std::string& id, double read_bw, double write_bw)
+DiskImpl* DiskS19Model::create_disk(const std::string& name, double read_bandwidth, double write_bandwidth)
 {
-  XBT_DEBUG("SURF disk create resource\n\t\tid '%s'\n\t\tread_bw '%f'\n", id.c_str(), read_bw);
-
-  return new DiskS19(this, id, read_bw, write_bw);
+  return (new DiskS19(name, read_bandwidth, write_bandwidth))->set_model(this);
 }
 
 double DiskS19Model::next_occurring_event(double now)
@@ -61,22 +59,6 @@ void DiskS19Model::update_actions_state(double /*now*/, double delta)
 /************
  * Resource *
  ************/
-
-DiskS19::DiskS19(DiskModel* model, const std::string& name, double read_bw, double write_bw)
-    : DiskImpl(name)
-{
-  lmm::System* maxmin_system = model->get_maxmin_system();
-  this->set_read_bandwidth(read_bw)
-      ->set_write_bandwidth(write_bw)
-      ->set_read_constraint(maxmin_system->constraint_new(this, read_bw))
-      ->set_write_constraint(maxmin_system->constraint_new(this, write_bw))
-      ->set_name(name)
-      ->set_model(model)
-      ->set_constraint(maxmin_system->constraint_new(this, std::max(read_bw, write_bw)));
-  XBT_DEBUG("Create resource with read_bw '%f' write_bw '%f'", read_bw, write_bw);
-  DiskImpl::turn_on();
-}
-
 DiskAction* DiskS19::io_start(sg_size_t size, s4u::Io::OpType type)
 {
   return new DiskS19Action(get_model(), static_cast<double>(size), not is_on(), this, type);