return new CpuCas01(this, host, speedPerPstate, core);
}
-double CpuCas01Model::next_occuring_event_full(double /*now*/)
-{
- return shareResourcesMaxMin(getRunningActionSet(), maxminSystem_, lmm_solve);
-}
-
/************
* Resource *
************/
~CpuCas01Model() override;
Cpu *createCpu(simgrid::s4u::Host *host, std::vector<double> *speedPerPstate, int core) override;
- double next_occuring_event_full(double now) override;
ActionList *p_cpuRunningActionSetThatDoesNotNeedBeingChecked;
};
double NetworkConstantModel::next_occuring_event(double /*now*/)
{
- NetworkConstantAction *action = nullptr;
double min = -1.0;
ActionList *actionSet = getRunningActionSet();
- for(ActionList::iterator it(actionSet->begin()), itend(actionSet->end())
- ; it != itend ; ++it) {
- action = static_cast<NetworkConstantAction*>(&*it);
+ for(auto it(actionSet->begin()), itend(actionSet->end()) ; it != itend ; ++it) {
+ NetworkConstantAction *action = static_cast<NetworkConstantAction*>(&*it);
if (action->latency_ > 0 && (min < 0 || action->latency_ < min))
min = action->latency_;
}
double NetworkModel::next_occuring_event_full(double now)
{
ActionList *runningActions = surf_network_model->getRunningActionSet();
- double minRes = shareResourcesMaxMin(runningActions, surf_network_model->maxminSystem_, surf_network_model->f_networkSolve);
+ double minRes = shareResourcesMaxMin(runningActions, maxminSystem_, f_networkSolve);
- for(ActionList::iterator it(runningActions->begin()), itend(runningActions->end())
- ; it != itend ; ++it) {
+ for(auto it(runningActions->begin()), itend(runningActions->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 min_completion = shareResourcesMaxMin(getRunningActionSet(), maxminSystem_, lmm_solve);
- double rate;
// Foreach disk
for(auto storage: p_storageList) {
- rate = 0;
+ double rate = 0;
// Foreach write action on disk
for (auto write_action: storage->writeActions_) {
rate += lmm_variable_getvalue(write_action->getVariable());
}
double Model::next_occuring_event_full(double /*now*/) {
- THROW_UNIMPLEMENTED;
- return 0.0;
+ return shareResourcesMaxMin(getRunningActionSet(), maxminSystem_, lmm_solve);
}
double shareResourcesMaxMin(ActionList *runningActions, lmm_system_t sys, void (*solve) (lmm_system_t))