CloudSim源代码之SimEntity.doc

  1. 1、本文档共13页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
package org.cloudbus.cloudsim.core; import org.cloudbus.cloudsim.Log; import org.cloudbus.cloudsim.NetworkTopology; import org.cloudbus.cloudsim.core.predicates.Predicate; /**仿真实体 * This class represents a simulation entity. An entity handles events and can * send events to other entities. When this class is extended, there are a few * methods that need to be implemented: * ul * li 【{@link #startEntity()}】 is invoked by the {@link Simulation} class when * the simulation is started. This method should be responsible for starting the * entity up. * li 【{@link #processEvent(SimEvent)}】 is invoked by the {@link Simulation} * class whenever there is an event in the deferred queue, which needs to be * processed by the entity. * li 【{@link #shutdownEntity()}】 is invoked by the {@link Simulation} before the * simulation finishes. If you want to save data in log files this is the method * in which the corresponding code would be placed. * /ul * * @author Marcos Dias de Assuncao * @since CloudSim Toolkit 1.0 */ public abstract class SimEntity implements Cloneable { /** The name. 名称*/ private String name; /** The id. 编号*/ private int id; /** The buffer for selected incoming events. 选定将来临的事件缓冲*/ private SimEvent evbuf; /** The entitys current state. 实体现在状态*/ private int state; /**【创建新实体】 * Creates a new entity. * * @param name the name to be associated with this entity */ public SimEntity(String name) { if (name.indexOf( ) != -1) { throw new IllegalArgumentException( Entity names cant contain spaces.); } this.name = name; id = -1; state = RUNNABLE;//运行 CloudSim.addEntity(this); } /**实体名 * Get the name of this entity. * * @return The entitys name */ public String getName() { return name; } /**分配给实体的ID号 * Get the unique id number assigned to this entity. * * @return The id number */ public int getId() { return id; } // The schedule functions 【调度函数】 /** * Send an event to another entity by id

文档评论(0)

白领文档(原创) + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档