double NetworkModel::next_occuring_event_full(double now)
{
- ActionList *runningActions = surf_network_model->getRunningActionSet();
- double minRes = shareResourcesMaxMin(runningActions, maxminSystem_);
+ double minRes = Model::next_occuring_event_full(now);
- for(auto it(runningActions->begin()), itend(runningActions->end()); it != itend ; ++it) {
+ for(auto it(getRunningActionSet()->begin()), itend(getRunningActionSet()->end()); it != itend ; it++) {
NetworkAction *action = static_cast<NetworkAction*>(&*it);
if (action->latency_ > 0)
minRes = (minRes < 0) ? action->latency_ : std::min(minRes, action->latency_);
}
-double HostL07Model::next_occuring_event(double /*now*/)
+double HostL07Model::next_occuring_event(double now)
{
- ActionList *runningActions = getRunningActionSet();
- double min = shareResourcesMaxMin(runningActions, maxminSystem_);
-
- for (auto it(runningActions->begin()), itend(runningActions->end()); it != itend ; ++it) {
+ double min = HostModel::next_occuring_event_full(now);
+ for (auto it(getRunningActionSet()->begin()), itend(getRunningActionSet()->end()); it != itend ; ++it) {
L07Action *action = static_cast<L07Action*>(&*it);
if (action->m_latency > 0 && (min < 0 || action->m_latency < min)) {
min = action->m_latency;
return storage;
}
-double StorageN11Model::next_occuring_event(double /*now*/)
+double StorageN11Model::next_occuring_event(double now)
{
- XBT_DEBUG("storage_share_resources");
+ double min_completion = StorageModel::next_occuring_event_full(now);
- double min_completion = shareResourcesMaxMin(getRunningActionSet(), maxminSystem_);
-
- // Foreach disk
for(auto storage: p_storageList) {
double rate = 0;
- // Foreach write action on disk
+ // Foreach write action on that disk
for (auto write_action: storage->writeActions_) {
rate += lmm_variable_getvalue(write_action->getVariable());
}
}
double Model::next_occuring_event_full(double /*now*/) {
- return shareResourcesMaxMin(getRunningActionSet(), maxminSystem_);
-}
-
-double shareResourcesMaxMin(ActionList *runningActions, lmm_system_t sys)
-{
- sys->solve_fun(sys);
+ maxminSystem_->solve_fun(maxminSystem_);
double min = -1;
- for(auto it(runningActions->begin()), itend(runningActions->end()); it != itend ; ++it) {
+ for (auto it(getRunningActionSet()->begin()), itend(getRunningActionSet()->end()); it != itend ; ++it) {
Action *action = &*it;
double value = lmm_variable_getvalue(action->getVariable());
if (value > 0) {
typedef boost::intrusive::list<Action, ActionLmmOptions> ActionLmmList;
typedef ActionLmmList* ActionLmmListPtr;
-/********************
- * Helper functions *
- ********************/
-
-double shareResourcesMaxMin(ActionList* runningActions, lmm_system_t sys);
-
-
/*********
* Model *
*********/