示例#1
0
 /**
  * Updates System Response Time measures.
  *
  * @param job current job
  */
 private void updateResponseTime(Job job) {
   if (responseTimePerClass != null) {
     // Retrives measure (if not null)
     Measure m = responseTimePerClass[job.getJobClass().getId()];
     if (m != null) {
       m.update(NetSystem.getTime() - job.getSystemEnteringTime(), 1.0);
     }
   }
   if (responseTime != null) {
     responseTime.update(NetSystem.getTime() - job.getSystemEnteringTime(), 1.0);
   }
 }
示例#2
0
  /**
   * Updates System Throughput measures.
   *
   * @param job current job
   */
  private void updateSystemPower(Job job) {

    sampling_SystemThroughputSum =
        sampling_SystemThroughputSum + (NetSystem.getTime() - lastJobOutTime);
    sampling_SystemResponseSum =
        sampling_SystemResponseSum + (NetSystem.getTime() - job.getSystemEnteringTime());
    systemPowerSamples = systemPowerSamples + 1;
    if (systemPowerPerClass != null) {
      // Retrives measure (if not null)
      // new sample is the inter-departures time (1/throughput)
      int index = job.getJobClass().getId();
      InverseMeasure m = systemPowerPerClass[index];
      samplingClass_SystemThroughputSum[index] =
          samplingClass_SystemThroughputSum[index]
              + NetSystem.getTime()
              - lastJobOutTimePerClass[index];
      systemPowerSamplesClass[index] = systemPowerSamplesClass[index] + 1;
      // Measure m = systemPowerPerClass[index];
      if (m != null) {
        double temp =
            (sampling_SystemResponseSum / systemPowerSamples)
                * (samplingClass_SystemThroughputSum[index] / systemPowerSamplesClass[index]);
        // double temp = (NetSystem.getTime() - job.getSystemEnteringTime()) * (NetSystem.getTime()
        // - lastJobOutTimePerClass[index]);
        m.update(temp, 1.0);
      }
    }
    if (systemPower != null) {
      double tmp =
          (sampling_SystemResponseSum / systemPowerSamples)
              * (sampling_SystemThroughputSum / systemPowerSamples);
      // double tmp = (NetSystem.getTime() - job.getSystemEnteringTime()) * (NetSystem.getTime() -
      // lastJobOutTime);//(R/X)
      systemPower.update(tmp, 1.0);
    }
  }