⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gridsimcore.java

📁 一个非常著名的网格模拟器,能够运行网格调度算法!
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
     * Check type of entity     * @return true if entity has NETWORK communication channel, otherwise     *          it returns false     * @deprecated As of GridSim 2.1, replaced by {@link #isNetworked()}     * @pre $none     * @post $result == true || false     */    protected boolean IsNetworked() {        return isNetworked();    }    /**     * Check type of entity     * @return true if entity has NETWORK communication channel, otherwise     *          it returns false     * @pre $none     * @post $result == true || false     */    protected boolean isNetworked() {        return networkedFlag_;    }    /**     * Sends an event/message to another entity by <tt>delaying</tt>     * the simulation time     * from the current time, with a tag representing the event type.     * <p>     * It is <tt>recommended</tt> to use <tt>send()</tt> method with     * an output port if the network bandwidth plays an important role in     * this simulation. However, the entity must have the network entities, i.e.     * <tt>Input</tt> and <tt>Output</tt> port (specified during the creation     * of the entity by giving a baud rate or bandwidth speed).     * Below is an example on how to do:     * <p>     * <code>     * ... // other code <br>     * // object is the entity or message you want to send <br>     * // size is the object size in bytes (rough estimation) <br>     * // destination id is the entity ID you want to send the object to <br>     * IO_data data = new IO_data(object, size, destinationID); <br>     * <br> <br>     * // If this entity extends from GridSim class, then you should use it <br>     * // otherwise need to create a new <tt>Sim_port</tt> object <br>     * Sim_port port = super.output; <br> <br>     * // delay is the simulation time delay <br>     * // tag is the event type (user-defined or choose one from     *    <tt>GridSimTags</tt> class)<br>     * send(port, delay, tag, data);<br>     * ... // remaining other code <br>     * </code>     *     * @param entityName the name of the destination entity     * @param delay      how long from the current simulation time the event     *                   should be sent.     *                   If delay is a negative number, then it will be     *                   changed to 0.0     * @param gridSimTag an user-defined number representing the type of     *                   an event/message     * @deprecated As of GridSim 2.1, replaced by {@link #send(String, double,     *             int)}     * @pre entityName != null     * @pre delay >= 0.0     * @post $none     */    protected void Send(String entityName, double delay, int gridSimTag) {        send(entityName, delay, gridSimTag);    }    /**     * Sends an event/message to another entity by <tt>delaying</tt>     * the simulation time     * from the current time, with a tag representing the event type.     * <p>     * It is <tt>recommended</tt> to use <tt>send()</tt> method with     * an output port if the network bandwidth plays an important role in     * this simulation. However, the entity must have the network entities, i.e.     * <tt>Input</tt> and <tt>Output</tt> port (specified during the creation     * of the entity by giving a baud rate or bandwidth speed).     * Below is an example on how to do:     * <p>     * <code>     * ... // other code <br>     * // object is the entity or message you want to send <br>     * // size is the object size in bytes (rough estimation) <br>     * // destination id is the entity ID you want to send the object to <br>     * IO_data data = new IO_data(object, size, destinationID); <br>     * <br> <br>     * // If this entity extends from GridSim class, then you should use it <br>     * // otherwise need to create a new <tt>Sim_port</tt> object <br>     * Sim_port port = super.output; <br> <br>     * // delay is the simulation time delay <br>     * // tag is the event type (user-defined or choose one from     *    <tt>GridSimTags</tt> class)<br>     * send(port, delay, tag, data);<br>     * ... // remaining other code <br>     * </code>     *     * @param entityName the name of the destination entity     * @param delay      how long from the current simulation time the event     *                   should be sent.     *                   If delay is a negative number, then it will be     *                   changed to 0.0     * @param gridSimTag an user-defined number representing the type of     *                   an event/message     * @pre entityName != null     * @pre delay >= 0.0     * @post $none     */    protected void send(String entityName, double delay, int gridSimTag)    {        if (entityName == null) {            return;        }        // if delay is -ve, then it doesn't make sense. So resets to 0.0        if (delay < 0.0) {            delay = 0.0;        }        int id = GridSim.getEntityId(entityName);        if (id < 0)        {            System.out.println(super.get_name() + ".send(): Error - " +                "invalid entity name \"" + entityName + "\".");            return;        }        super.sim_schedule(id, delay, gridSimTag);    }    /**     * Sends an event/message to another entity by <tt>delaying</tt>     * the simulation time     * from the current time, with a tag representing the event type.     * <p>     * It is <tt>recommended</tt> to use <tt>send()</tt> method with     * an output port if the network bandwidth plays an important role in     * this simulation. However, the entity must have the network entities, i.e.     * <tt>Input</tt> and <tt>Output</tt> port (specified during the creation     * of the entity by giving a baud rate or bandwidth speed).     * Below is an example on how to do:     * <p>     * <code>     * ... // other code <br>     * // object is the entity or message you want to send <br>     * // size is the object size in bytes (rough estimation) <br>     * // destination id is the entity ID you want to send the object to <br>     * IO_data data = new IO_data(object, size, destinationID); <br>     * <br> <br>     * // If this entity extends from GridSim class, then you should use it <br>     * // otherwise need to create a new <tt>Sim_port</tt> object <br>     * Sim_port port = super.output; <br> <br>     * // delay is the simulation time delay <br>     * // tag is the event type (user-defined or choose one from     *    <tt>GridSimTags</tt> class)<br>     * send(port, delay, tag, data);<br>     * ... // remaining other code <br>     * </code>     *     * @param entityName the name of the destination entity     * @param delay      how long from the current simulation time the event     *                   should be sent.     *                   If delay is a negative number, then it will be     *                   changed to 0.0     * @param gridSimTag an user-defined number representing the type of     *                   an event/message     * @param data       A reference to data to be sent with the event     * @deprecated As of GridSim 2.1, replaced by {@link #send(String, double,     *             int, Object)}     * @pre entityName != null     * @pre delay >= 0.0     * @pre data != null     * @post $none     */    protected void Send(String entityName, double delay, int gridSimTag,                        Object data)    {        send(entityName, delay, gridSimTag, data);    }    /**     * Sends an event/message to another entity by <tt>delaying</tt>     * the simulation time     * from the current time, with a tag representing the event type.     * <p>     * It is <tt>recommended</tt> to use <tt>send()</tt> method with     * an output port if the network bandwidth plays an important role in     * this simulation. However, the entity must have the network entities, i.e.     * <tt>Input</tt> and <tt>Output</tt> port (specified during the creation     * of the entity by giving a baud rate or bandwidth speed).     * Below is an example on how to do:     * <p>     * <code>     * ... // other code <br>     * // object is the entity or message you want to send <br>     * // size is the object size in bytes (rough estimation) <br>     * // destination id is the entity ID you want to send the object to <br>     * IO_data data = new IO_data(object, size, destinationID); <br>     * <br> <br>     * // If this entity extends from GridSim class, then you should use it <br>     * // otherwise need to create a new <tt>Sim_port</tt> object <br>     * Sim_port port = super.output; <br> <br>     * // delay is the simulation time delay <br>     * // tag is the event type (user-defined or choose one from     *    <tt>GridSimTags</tt> class)<br>     * send(port, delay, tag, data);<br>     * ... // remaining other code <br>     * </code>     *     * @param entityName the name of the destination entity     * @param delay      how long from the current simulation time the event     *                   should be sent.     *                   If delay is a negative number, then it will be     *                   changed to 0.0     * @param gridSimTag an user-defined number representing the type of     *                   an event/message     * @param data       A reference to data to be sent with the event     * @pre entityName != null     * @pre delay >= 0.0     * @pre data != null     * @post $none     */    protected void send(String entityName, double delay, int gridSimTag,                        Object data)    {        if (entityName == null) {            return;        }        // if delay is -ve, then it doesn't make sense. So resets to 0.0        if (delay < 0.0) {            delay = 0.0;        }        int id = GridSim.getEntityId(entityName);        if (id < 0)        {            System.out.println(super.get_name() + ".send(): Error - " +                "invalid entity name \"" + entityName + "\".");            return;        }        super.sim_schedule(id, delay, gridSimTag, data);    }    /**     * Sends an event/message to another entity by <tt>delaying</tt>     * the simulation time     * from the current time, with a tag representing the event type.     * <p>     * It is <tt>recommended</tt> to use <tt>send()</tt> method with     * an output port if the network bandwidth plays an important role in     * this simulation. However, the entity must have the network entities, i.e.     * <tt>Input</tt> and <tt>Output</tt> port (specified during the creation     * of the entity by giving a baud rate or bandwidth speed).     * Below is an example on how to do:     * <p>     * <code>     * ... // other code <br>     * // object is the entity or message you want to send <br>     * // size is the object size in bytes (rough estimation) <br>     * // destination id is the entity ID you want to send the object to <br>     * IO_data data = new IO_data(object, size, destinationID); <br>     * <br> <br>     * // If this entity extends from GridSim class, then you should use it <br>     * // otherwise need to create a new <tt>Sim_port</tt> object <br>     * Sim_port port = super.output; <br> <br>     * // delay is the simulation time delay <br>     * // tag is the event type (user-defined or choose one from     *    <tt>GridSimTags</tt> class)<br>     * send(port, delay, tag, data);<br>     * ... // remaining other code <br>     * </code>     *     * @param entityID   the id number of the destination entity     * @param delay      how long from the current simulation time the event     *                   should be sent.     *                   If delay is a negative number, then it will be     *                   changed to 0.0     * @param gridSimTag an user-defined number representing the type of     *                   an event/message     * @deprecated As of GridSim 2.1, replaced by {@link #send(int, double,     *             int)}     * @pre entityID > 0     * @pre delay >= 0.0     * @post $none     */    protected void Send(int entityID, double delay, int gridSimTag) {        send(entityID, delay, gridSimTag);    }    /**     * Sends an event/message to another entity by <tt>delaying</tt>     * the simulation time     * from the current time, with a tag representing the event type.     * <p>     * It is <tt>recommended</tt> to use <tt>send()</tt> method with     * an output port if the network bandwidth plays an important role in     * this simulation. However, the entity must have the network entities, i.e.     * <tt>Input</tt> and <tt>Output</tt> port (specified during the creation     * of the entity by giving a baud rate or bandwidth speed).     * Below is an example on how to do:     * <p>     * <code>     * ... // other code <br>     * // object is the entity or message you want to send <br>     * // size is the object size in bytes (rough estimation) <br>     * // destination id is the entity ID you want to send the object to <br>     * IO_data data = new IO_data(object, size, destinationID); <br>     * <br> <br>     * // If this entity extends from GridSim class, then you should use it <br>     * // otherwise need to create a new <tt>Sim_port</tt> object <br>     * Sim_port port = super.output; <br> <br>     * // delay is the simulation time delay <br>     * // tag is the event type (user-defined or choose one from     *    <tt>GridSimTags</tt> class)<br>     * send(port, delay, tag, data);<br>     * ... // remaining other code <br>     * </code>     *     * @param entityID   the id number of the destination entity     * @param delay      how long from the current simulation time the event     *                   should be sent.     *                   If delay is a negative number, then it will be     *                   changed to 0.0     * @param gridSimTag an user-defined number representing the type of     *                   an event/message     * @pre entityID > 0     * @pre delay >= 0.0     * @post $none     */    protected void send(int entityID, double delay, int gridSimTag)    {        if (entityID < 0) {            return;        }        // if delay is -ve, then it doesn't make sense. So resets to 0.0        if (delay < 0.0) {            delay = 0.0;        }

⌨️ 快捷键说明

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