コード例 #1
0
ファイル: storage_n11.cpp プロジェクト: fabienchaix/simgrid
double StorageN11Model::next_occuring_event(double /*now*/)
{
  XBT_DEBUG("storage_share_resources");

  double min_completion = shareResourcesMaxMin(getRunningActionSet(), maxminSystem_, lmm_solve);

  double rate;
  // Foreach disk
  for(auto storage: p_storageList) {
    rate = 0;
    // Foreach write action on disk
    for (auto write_action: storage->writeActions_) {
      rate += lmm_variable_getvalue(write_action->getVariable());
    }
    if(rate > 0)
      min_completion = MIN(min_completion, (storage->size_-storage->usedSize_)/rate);
  }

  return min_completion;
}
コード例 #2
0
    double NetworkModel::next_occuring_event_full(double now)
    {
      NetworkAction *action = NULL;
      ActionList *runningActions = surf_network_model->getRunningActionSet();
      double minRes;

      minRes = shareResourcesMaxMin(runningActions, surf_network_model->maxminSystem_, surf_network_model->f_networkSolve);

      for(ActionList::iterator it(runningActions->begin()), itend(runningActions->end())
          ; it != itend ; ++it) {
        action = static_cast<NetworkAction*>(&*it);
        if (action->latency_ > 0) {
          minRes = (minRes < 0) ? action->latency_ : std::min(minRes, action->latency_);
        }
      }

      XBT_DEBUG("Min of share resources %f", minRes);

      return minRes;
    }