📄 experiment.java
字号:
* @post $none */ public void SetBudget(double budget) { this.setBudget(budget); } /** * Sets the experiment budget * @param budget the budget value * @pre budget >= 0.0 * @post $none */ public void setBudget(double budget) { budget_ = budget; } /** * Gets the experiment budget * @return the budget value * @deprecated As of GridBroker 2.1, replaced by * {@link #getBudget()} * @pre $none * @post $result >= 0.0 */ public double GetBudget() { return this.getBudget(); } /** * Gets the experiment budget * @return the budget value * @pre $none * @post $result >= 0.0 */ public double getBudget() { return budget_; } /** * Sets the experiment deadline and budget * @param deadline the deadline value * @param budget the budget value * @deprecated As of GridBroker 2.1, replaced by * {@link #setDeadlineBudget(double, double)} * @pre deadline >= 0.0 * @pre budget >= 0.0 * @post $none */ public void SetDeadlineBudget(double deadline, double budget) { this.setDeadlineBudget(deadline, budget); } /** * Sets the experiment deadline and budget * @param deadline the deadline value * @param budget the budget value * @pre deadline >= 0.0 * @pre budget >= 0.0 * @post $none */ public void setDeadlineBudget(double deadline, double budget) { deadline_ = deadline; budget_ = budget; } /** * Gets the name of a report file * @return the file name * @deprecated As of GridBroker 2.1, replaced by * {@link #getReportFileName()} * @pre $none * @post $result != null */ public String GetReportFileName() { return this.getReportFileName(); } /** * Gets the name of a report file * @return the file name * @pre $none * @post $result != null */ public String getReportFileName() { return reportFile_; } /** * Sets the current time as the experiment start time * @deprecated As of GridBroker 2.1, replaced by * {@link #setStartTime()} * @pre $none * @post $none */ public void SetStartTime() { this.setStartTime(); } /** * Sets the current time as the experiment start time * @pre $none * @post $none */ public void setStartTime() { startTime_ = GridSim.clock(); } /** * Gets the experiment start time * @return the start time * @deprecated As of GridBroker 2.1, replaced by * {@link #getStartTime()} * @pre $none * @post $result >= 0.0 */ public double GetStartTime() { return this.getStartTime(); } /** * Gets the experiment start time * @return the start time * @pre $none * @post $result >= 0.0 */ public double getStartTime() { return startTime_; } /** * Sets the experiment end time * @deprecated As of GridBroker 2.1, replaced by * {@link #setEndTime()} * @pre $none * @post $none */ public void SetEndTime() { this.setEndTime(); } /** * Sets the experiment end time * @pre $none * @post $none */ public void setEndTime() { endTime_ = GridSim.clock(); } /** * Gets the experiment end time * @return the end time * @deprecated As of GridBroker 2.1, replaced by * {@link #getEndTime()} * @pre $none * @post $result >= 0.0 */ public double GetEndTime() { return this.getEndTime(); } /** * Gets the experiment end time * @return the end time * @pre $none * @post $result >= 0.0 */ public double getEndTime() { return endTime_; } /** * Gets the number of Gridlets * @return the gridlet size or <tt>0</tt> if it is empty * @deprecated As of GridBroker 2.1, replaced by * {@link #getNumGridlet()} * @pre $none * @post $result >= 0 */ public int GetNoOfGridlets() { return this.getNumGridlet(); } /** * Gets the number of Gridlets * @return the gridlet size or <tt>0</tt> if it is empty * @pre $none * @post $result >= 0 */ public int getNumGridlet() { return glList_.size(); } /** * Gets the total budget spent on a successful Gridlets' execution. * Calculated based on the actual CPU time * Cost per second of a Gridlet. * @return the budget spent * @deprecated As of GridBroker 2.1, replaced by * {@link #getBudgetSpent()} * @pre $none * @post $result >= 0 */ public double GetBudgetSpent() { return this.getBudgetSpent(); } /** * Gets the total budget spent on a successful Gridlets' execution. * Calculated based on the actual CPU time * Cost per second of a Gridlet. * @return the budget spent * @pre $none * @post $result >= 0 */ public double getBudgetSpent() { double expenses = 0; Gridlet gl; for (int i = 0; i < glList_.size(); i++) { gl = (Gridlet) glList_.get(i); if (gl.getGridletStatus() == Gridlet.SUCCESS) { expenses += gl.getActualCPUTime() * gl.getCostPerSec(); } } return expenses; } /** * Gets the total number of successful Gridlets * @return the total number or <tt>0</tt> if none * @deprecated As of GridBroker 2.1, replaced by * {@link #getNumSuccessfulGridlet()} * @pre $none * @post $result >= 0 */ public int GetNoOfSuccessfulGridlets() { return this.getNumSuccessfulGridlet(); } /** * Gets the total number of successful Gridlets * @return the total number or <tt>0</tt> if none * @pre $none * @post $result >= 0 */ public int getNumSuccessfulGridlet() { int count = 0; Gridlet gl; for (int i = 0; i < glList_.size(); i++) { gl = (Gridlet) glList_.get(i); if (gl.getGridletStatus() == Gridlet.SUCCESS) { count++; } } return count; } /** * Checks whether the Gridlets have been executed successfully or not * @return <tt>true</tt> if the Gridlets are finished, otherwise * <tt>false</tt> * @deprecated As of GridBroker 2.1, replaced by * {@link #isSuccessful()} * @pre $none * @post $none */ public boolean IsSuccessful() { return this.isSuccessful(); } /** * Checks whether the Gridlets have been executed successfully or not * @return <tt>true</tt> if the Gridlets are finished, otherwise * <tt>false</tt> * @pre $none * @post $none */ public boolean isSuccessful() { if ( getNumSuccessfulGridlet() == getNumGridlet() ) { return true; } else { return false; } } /** * Gets the completion ratio based on the number of successful * Gridlets with the total Gridlets. * @return the completion ratio * @deprecated As of GridBroker 2.1, replaced by * {@link #getGridletCompletionFactor()} * @pre $none * @post $result >= 0.0 */ public double GridletCompletionFactor() { return this.getGridletCompletionFactor(); } /** * Gets the completion ratio based on the number of successful * Gridlets with the total Gridlets. * @return the completion ratio * @pre $none * @post $result >= 0.0 */ public double getGridletCompletionFactor() { double factor = 0.0; int numGridlet = getNumGridlet(); if (numGridlet != 0) { factor = (double) getNumSuccessfulGridlet() / numGridlet; } return factor; } /** * Gets the time utilization factor * @return the time utilization factor * @deprecated As of GridBroker 2.1, replaced by * {@link #getTimeUtilFactor()} * @pre $none * @post $none */ public double TimeUtilizationFactor() { return this.getTimeUtilFactor(); } /** * Gets the time utilization factor * @return the time utilization factor * @pre $none * @post $none */ public double getTimeUtilFactor() { return (endTime_ - startTime_) / deadline_; } /** * Gets the budget utilization factor * @return the budget utilization factor * @deprecated As of GridBroker 2.1, replaced by * {@link #getBudgetUtilFactor()} * @pre $none * @post $none */ public double BudgetUtilizationFactor() { return this.getBudgetUtilFactor(); } /** * Gets the budget utilization factor * @return the budget utilization factor * @pre $none * @post $none */ public double getBudgetUtilFactor() { return getBudgetSpent() / budget_; } /** * Accumulates the length of all the Gridlets * @return an Accumulator object * @deprecated As of GridBroker 2.1, replaced by * {@link #getAllGridletLengthAccumulator()} * @see gridsim.Accumulator * @pre $none * @post $result != null */ public Accumulator GetAllGridletsLengthAccumulator() { return this.getAllGridletLengthAccumulator(); } /** * Accumulates the length of all the Gridlets * @return an Accumulator object * @see gridsim.Accumulator * @pre $none * @post $result != null */ public Accumulator getAllGridletLengthAccumulator() { Accumulator accLength = new Accumulator(); for (int i = 0; i < glList_.size(); i++) { accLength.add( ((Gridlet) glList_.get(i)).getGridletLength() ); } return accLength; } } // end class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -