all_existing_models.push_back(this);
}
-StorageImpl* StorageN11Model::createStorage(std::string id, std::string type_id, std::string content_name,
- std::string attach)
+StorageImpl* StorageN11Model::createStorage(const std::string& id, const std::string& type_id,
+ const std::string& content_name, const std::string& attach)
{
StorageType* storage_type = storage_types.at(type_id);
double Bwrite = surf_parse_get_bandwidth(storage_type->model_properties->at("Bwrite").c_str(),
"property Bwrite, storage", type_id.c_str());
- StorageImpl* storage =
- new StorageN11(this, id, get_maxmin_system(), Bread, Bwrite, type_id, content_name, storage_type->size, attach);
-
XBT_DEBUG("SURF storage create resource\n\t\tid '%s'\n\t\ttype '%s'\n\t\tBread '%f'\n", id.c_str(), type_id.c_str(),
Bread);
- return storage;
+ return new StorageN11(this, id, get_maxmin_system(), Bread, Bwrite, type_id, content_name, storage_type->size,
+ attach);
}
double StorageN11Model::next_occuring_event(double now)
StorageAction& action = static_cast<StorageAction&>(*it);
++it; // increment iterator here since the following calls to action.finish() may invalidate it
action.update_remains(lrint(action.get_variable()->get_value() * delta));
-
- if (action.get_max_duration() > NO_MAX_DURATION)
- action.update_max_duration(delta);
+ action.update_max_duration(delta);
if (((action.get_remains_no_update() <= 0) && (action.get_variable()->get_weight() > 0)) ||
- ((action.get_max_duration() > NO_MAX_DURATION) && (action.get_max_duration() <= 0))) {
+ ((action.get_max_duration() != NO_MAX_DURATION) && (action.get_max_duration() <= 0))) {
action.finish(kernel::resource::Action::State::FINISHED);
}
}
* Resource *
************/
-StorageN11::StorageN11(StorageModel* model, std::string name, kernel::lmm::System* maxminSystem, double bread,
- double bwrite, std::string type_id, std::string content_name, sg_size_t size, std::string attach)
+StorageN11::StorageN11(StorageModel* model, const std::string& name, kernel::lmm::System* maxminSystem, double bread,
+ double bwrite, const std::string& type_id, const std::string& content_name, sg_size_t size,
+ const std::string& attach)
: StorageImpl(model, name, maxminSystem, bread, bwrite, type_id, content_name, size, attach)
{
XBT_DEBUG("Create resource with Bread '%f' Bwrite '%f' and Size '%llu'", bread, bwrite, size);