failuremsg.java

来自「中間件開發详细说明:清华大学J2EE教程讲义(ppt)-Tsinghua Uni」· Java 代码 · 共 104 行

JAVA
104
字号
/* * Title:        GridSim Toolkit * Description:  GridSim (Grid Simulation) Toolkit for Modeling and Simulation *               of Parallel and Distributed Systems such as Clusters and Grids * Licence:      GPL - http://www.gnu.org/copyleft/gpl.html * * Author: Agustin Caminero * Organization: Universidad de Castilla La Mancha (UCLM), Spain. * Created on: Nov 2006. */package gridsim.resFailure;/** * This class is used by * {@link gridsim.resFailure.RegionalGISWithFailure} to commnunicate with * {@link gridsim.resFailure.GridResourceWithFailure} * for simulating a resource failure. * * @author       Agustin Caminero * @since        GridSim Toolkit 4.1 */public class FailureMsg{    /** The time that the failure will last */    private double time;    /** The id of the resource */    private int res_id;    /** The number of machines that will fail in this resource */    private int numMachines;    /**     * Creates a new failure message     * @param time  the time that the failure will last     * @param rid   the resource id     */    public FailureMsg(double time, int rid) {        this.time = time;        res_id  = rid;        numMachines = 0;    }    /**     * This method sets the time atribute of the ResourceFailure object     * @param time   the time that the failure will last     */    public void setTime(double time)    {        this.time = time;    }    /**     * This method returns the time atribute of the ResourceFailure object     * @return time     */    public double getTime()    {        return time;    }    /**     * This method sets the res_id atribute of the ResourceFailure object     * @param r the resource id of the resource     */    public void setRes(int r)    {        res_id = r;    }    /**     * This method returns the res_id atribute of the ResourceFailure object     * @return the resource id     */    public int getRes()    {        return res_id;    }    /**     * This method sets the numMachines atribute of the ResourceFailure object     * @param n the number of machines which will fail in this resource     */    public void setNumMachines(int n)    {        numMachines = n;    }    /**     * This method returns the number of machines which will fail     * in this resource     * @return number of failed machines     */    public double getNumMachines()    {        return numMachines;    }} // end class

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?