- simgrid::s4u::Storage* storage = simgrid::s4u::Storage::by_name("Disk1");
- int id = simgrid::s4u::this_actor::get_pid();
- XBT_INFO("process %d is writing!", id);
- storage->write(3000000);
- XBT_INFO("process %d goes to sleep for %d seconds", id, id);
- simgrid::s4u::this_actor::sleep_for(id);
- XBT_INFO("process %d is writing again!", id);
- storage->write(3000000);
- XBT_INFO("process %d goes to sleep for %d seconds", id, 6 - id);
- simgrid::s4u::this_actor::sleep_for(6 - id);
- XBT_INFO("process %d is reading!", id);
- storage->read(3000000);
- XBT_INFO("process %d goes to sleep for %d seconds", id, id);
- simgrid::s4u::this_actor::sleep_for(id);
- XBT_INFO("process %d is reading again!", id);
- storage->read(3000000);
+ const sg4::Disk* disk = sg4::this_actor::get_host()->get_disks().front(); // Disk1
+ aid_t id = sg4::this_actor::get_pid();
+ XBT_INFO("actor %ld is writing!", id);
+ disk->write(4000000);
+ XBT_INFO("actor %ld goes to sleep for %ld seconds", id, id);
+ sg4::this_actor::sleep_for(static_cast<double>(id));
+ XBT_INFO("actor %ld is writing again!", id);
+ disk->write(4000000);
+ XBT_INFO("actor %ld goes to sleep for %ld seconds", id, 6 - id);
+ sg4::this_actor::sleep_for(static_cast<double>(6 - id));
+ XBT_INFO("actor %ld is reading!", id);
+ disk->read(4000000);
+ XBT_INFO("actor %ld goes to sleep for %ld seconds", id, id);
+ sg4::this_actor::sleep_for(static_cast<double>(id));
+ XBT_INFO("actor %ld is reading again!", id);
+ disk->read(4000000);