nbPoints_ = speedTrace->event_list.size() + 1;
timePoints_ = new double[nbPoints_];
integral_ = new double[nbPoints_];
- for (auto val : speedTrace->event_list) {
+ for (auto const& val : speedTrace->event_list) {
timePoints_[i] = time;
integral_[i] = integral;
integral += val.date_ * val.value_;
type_ = TRACE_DYNAMIC;
/* count the total time of trace file */
- for (auto val : speedTrace->event_list)
+ for (auto const& val : speedTrace->event_list)
total_time += val.date_;
trace_ = new CpuTiTrace(speedTrace);
{
xbt_assert(low < high, "Wrong parameters: low (%d) should be smaller than high (%d)", low, high);
- int mid;
do {
- mid = low + (high - low) / 2;
+ int mid = low + (high - low) / 2;
XBT_DEBUG("a %f low %d high %d mid %d value %f", a, low, high, mid, array[mid]);
if (array[mid] > a)
CpuTiAction *action;
double sum_priority = 0.0;
double total_area;
- double min_finish = -1;
/* update remaining amount of actions */
updateRemainingAmount(now);
for(ActionTiList::iterator it(actionSet_->begin()), itend(actionSet_->end()) ; it != itend ; ++it) {
action = &*it;
- min_finish = -1;
+ double min_finish = -1;
/* action not running, skip it */
if (action->getStateSet() != surf_cpu_model_pm->getRunningActionSet())
continue;
: CpuAction(model_, cost, failed)
, cpu_(cpu)
{
+ indexHeap_ = -1;
cpu_->modified(true);
}
XBT_OUT();
}
-void CpuTiAction::setPriority(double priority)
+void CpuTiAction::setSharingWeight(double priority)
{
XBT_IN("(%p,%g)", this, priority);
- priority_ = priority;
+ sharingWeight_ = priority;
cpu_->modified(true);
XBT_OUT();
}