/** * Sets the safety parameter. * * @param safetyParameter the new safety parameter */ protected void setSafetyParameter(double safetyParameter) { if (safetyParameter < 0) { Log.printConcatLine("The safety parameter cannot be less than zero. The passed value is: ", safetyParameter); System.exit(0); } this.safetyParameter = safetyParameter; }
/** * Sets the safety parameter. * * @param safetyParameter the new safety parameter * @todo It should raise an InvalidArgumentException instead of calling System.exit(0) */ protected void setSafetyParameter(double safetyParameter) { if (safetyParameter < 0) { Log.printConcatLine("The safety parameter cannot be less than zero. The passed value is: ", safetyParameter); System.exit(0); } this.safetyParameter = safetyParameter; }
@Override public void shutdownEntity() { Log.printConcatLine(getName(), " is shutting down..."); }
@Override public void shutdownEntity() { Log.printConcatLine(getName(), " is shutting down..."); }
@Override public void shutdownEntity() { Log.printConcatLine(getName(), " is shutting down..."); }
@Override public void shutdownEntity() { Log.printConcatLine(getName(), " is shutting down..."); }
@Override public void shutdownEntity() { Log.printConcatLine(getName(), " is shutting down..."); }
@Override public void shutdownEntity() { Log.printConcatLine(getName(), " is shutting down..."); }
/** * Here all the method related to VM requests will be received and forwarded to the related * method. * * @param ev the received event * @pre $none * @post $none */ protected void processOtherEvent(SimEvent ev) { if (ev == null) { Log.printConcatLine(getName(), ".processOtherEvent(): Error - an event is null."); } }
@Override public double addFile(List<File> list) { double result = 0.0; if (list == null || list.isEmpty()) { Log.printConcatLine(name, ".addFile(): Warning - list is empty."); return result; } Iterator<File> it = list.iterator(); File file = null; while (it.hasNext()) { file = it.next(); result += addFile(file); // add each file in the list } return result; }
/** * Tells all registered entities about the end of simulation. * * @pre $none * @post $none */ private void notifyAllEntity() { Log.printConcatLine(super.getName(), ": Notify all CloudSim entities for shutting down."); signalShutdown(resList); signalShutdown(gisList); // reset the values resList.clear(); gisList.clear(); }
public void writeTofile(String[] entries) throws IOException { // feed in your array (or convert your data to an array) try { writer = new CSVWriter(new FileWriter(fileAddress, true), ',',CSVWriter.NO_QUOTE_CHARACTER); } catch (IOException e) { Log.printConcatLine("Couldn't find the file to write to: ", fileAddress); } writer.writeNext(entries); writer.flush(); writer.close(); }
@Override public void startEntity() { Log.printConcatLine(getName(), " is starting..."); schedule(getId(), 0, CloudSimTags.RESOURCE_CHARACTERISTICS_REQUEST); }
@Override public void startEntity() { Log.printConcatLine(getName(), " is starting..."); schedule(getId(), 0, CloudSimTags.RESOURCE_CHARACTERISTICS_REQUEST); }
@Override public void startEntity() { Log.printConcatLine(getName(), " is starting..."); schedule(getId(), 0, CloudSimTags.RESOURCE_CHARACTERISTICS_REQUEST); }
@Override public void startEntity() { Log.printConcatLine(getName(), " is starting..."); schedule(getId(), 0, CloudSimTags.RESOURCE_CHARACTERISTICS_REQUEST); }
/** * Prints the over utilized hosts. * * @param overUtilizedHosts the over utilized hosts */ protected void printOverUtilizedHosts(List<PowerContainerHostUtilizationHistory> overUtilizedHosts) { if (!Log.isDisabled()) { Log.printLine("Over-utilized hosts:"); for (PowerContainerHostUtilizationHistory host : overUtilizedHosts) { Log.printConcatLine("Host #", host.getId()); } Log.printLine(); } }
/** * Prints the over utilized hosts. * * @param overUtilizedHosts the over utilized hosts */ protected void printOverUtilizedHosts(List<PowerHostUtilizationHistory> overUtilizedHosts) { if (!Log.isDisabled()) { Log.printLine("Over-utilized hosts:"); for (PowerHostUtilizationHistory host : overUtilizedHosts) { Log.printConcatLine("Host #", host.getId()); } Log.printLine(); } }
/** * Destroy all virtual machines running in datacenters. * * @pre $none * @post $none */ protected void clearDatacenters() { for (Vm vm : getVmsCreatedList()) { Log.printConcatLine(CloudSim.clock(), ": " + getName(), ": Destroying VM #", vm.getId()); sendNow(getVmsToDatacentersMap().get(vm.getId()), CloudSimTags.VM_DESTROY, vm); } getVmsCreatedList().clear(); }
@Override public void startEntity() { Log.printConcatLine(getName(), " is starting..."); // this resource should register to regional CIS. // However, if not specified, then register to system CIS (the // default CloudInformationService) entity. int gisID = CloudSim.getEntityId(regionalCisName); if (gisID == -1) { gisID = CloudSim.getCloudInfoServiceEntityId(); } // send the registration to CIS sendNow(gisID, CloudSimTags.REGISTER_RESOURCE, getId()); // Below method is for a child class to override registerOtherEntity(); }