/** * Gets the total cost of processing or executing this Cloudlet * <tt>Processing Cost = input data transfer + processing cost + output * transfer cost</tt> . * * @return the total cost of processing Cloudlet * @pre $none * @post $result >= 0.0 */ public double getProcessingCost() { // cloudlet cost: execution cost... // double cost = getProcessingCost(); double cost = 0; // ...plus input data transfer cost... cost += accumulatedBwCost; // ...plus output cost cost += costPerBw * getCloudletOutputSize(); return cost; }
/** * Processes the return of cloudlets. * * @param ev a simulation event. * @since 1.0 */ @Override protected void processCloudletReturn(SimEvent ev) { Cloudlet cloudlet = (Cloudlet) ev.getData(); getCloudletReceivedList().add(cloudlet); Log.printLine(CloudSim.clock()+": "+getName()+ ": Cloudlet "+cloudlet.getCloudletId()+" received"); cloudletsSubmitted -= 1; Cloudlet newCloudlet = new Cloudlet(this.cloudletId, (long) ((long)this.maxLengthOfCloudlets * RandomNumberGenerator.getRandomNumbers(1).get(0)), cloudlet.getNumberOfPes(), cloudlet.getCloudletLength(), cloudlet.getCloudletOutputSize(), cloudlet.getUtilizationModelCpu(), cloudlet.getUtilizationModelRam(), cloudlet.getUtilizationModelBw()); newCloudlet.setUserId(getId()); newCloudlet.setVmId(cloudlet.getVmId()); getCloudletList().add(newCloudlet); this.cloudletId++; submitCloudlets(); }