- 1、本文档共13页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 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
您可能关注的文档
最近下载
- Blender软件二次开发:Blender二次开发综合案例分析.pdf VIP
- 国标图集05J909《工程做法》—标准图集.pdf
- Blender软件二次开发:Blender游戏引擎与交互式内容开发.pdf VIP
- 孔子诞辰日致辞稿(共7篇) .doc
- 第一单元第四课《上学路上》课件 湘美版(2024)一年级上册.pptx
- 浙教版信息科技五上 第4课 算法中的数据 课件.pptx
- 经济全球化对国家经济安全的影响研究.pptx
- 聊城大学音乐学院中国音乐史课件 西周春秋战国音乐.ppt
- Blender软件二次开发:BlenderPython脚本优化与调试.pdf VIP
- 第二课 美的本质和特征课件 --中职技校《美育》第四版.pptx
文档评论(0)