A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Adding the normal distribution
[simgrid.git]
/
src
/
surf
/
storage_n11.cpp
diff --git
a/src/surf/storage_n11.cpp
b/src/surf/storage_n11.cpp
index
6704150
..
668366d
100644
(file)
--- a/
src/surf/storage_n11.cpp
+++ b/
src/surf/storage_n11.cpp
@@
-54,10
+54,10
@@
StorageImpl* StorageN11Model::createStorage(const std::string& id, const std::st
{
StorageType* storage_type = storage_types.at(type_id);
- double Bread =
surf_parse_get_bandwidth(storage_type->model_properties->at("Bread").c_str(),
-
"property Bread, storage", type_id.c_str()
);
+ double Bread =
+
surf_parse_get_bandwidth(storage_type->model_properties->at("Bread").c_str(), "property Bread, storage", type_id
);
double Bwrite = surf_parse_get_bandwidth(storage_type->model_properties->at("Bwrite").c_str(),
- "property Bwrite, storage", type_id
.c_str()
);
+ "property Bwrite, storage", type_id);
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);
@@
-74,12
+74,12
@@
double StorageN11Model::next_occuring_event(double now)
void StorageN11Model::update_actions_state(double /*now*/, double delta)
{
for (auto it = std::begin(*get_started_action_set()); it != std::end(*get_started_action_set());) {
-
StorageAction& action = static_cast<StorageAction&>(*it)
;
+
auto& action = *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));
action.update_max_duration(delta);
- if (((action.get_remains_no_update() <= 0) && (action.get_variable()->get_
weight
() > 0)) ||
+ if (((action.get_remains_no_update() <= 0) && (action.get_variable()->get_
penalty
() > 0)) ||
((action.get_max_duration() != NO_MAX_DURATION) && (action.get_max_duration() <= 0))) {
action.finish(Action::State::FINISHED);
}
@@
-147,7
+147,7
@@
void StorageN11Action::suspend()
{
XBT_IN("(%p)", this);
if (is_running()) {
- get_model()->get_maxmin_system()->update_variable_
weight
(get_variable(), 0.0);
+ get_model()->get_maxmin_system()->update_variable_
penalty
(get_variable(), 0.0);
set_suspend_state(Action::SuspendStates::SUSPENDED);
}
XBT_OUT();