- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
opnet process modelsimple_source分析
simple_source模块的功能是按照配置产生包,包括不同的包格式和产生速率,也是比较简单的进程模型。
参考了《opnet process model:simple_source分析》/ebinghaus/blog/item/c7cade9228876c83a877a405.html
该模块有4个local statistic,注意有5个model attribute,分别是Packet Interarrival Time,Packet Size,Packet Format,Start Time,Stop Time,这些是在使用该模块时需要配置的,当然也可以使用默认配置。
状态机也很简单:
在header block中定义了
/* Include files.?????*/#include?oms_dist_support.h //注意该模块使用了外部文件《oms_dist_support》和《oms_string_support》
/* Special attribute values.??*/#define??SSC_INFINITE_TIME??-1.0 //定义无穷大时间为-1
/* Interrupt code values.???*/ //注意这里的中断代码是自定义的,为了在产生自中断是使用#define??SSC_START????0#define??SSC_GENERATE???1#define??SSC_STOP????2
/* Node configuration constants.?*/#define??SSC_STRM_TO_LOW???0 //发送的stream index,默认的,该模块只有一个stream连接,所以不需要动态获取stream index
/* Macro definitions for state??transitions.*/ //转换条件为中断代码是自定义的常量:
#define??START????(intrpt_code == SSC_START)#define??DISABLED???(intrpt_code == SSC_STOP)#define??STOP????(intrpt_code == SSC_STOP)#define??PACKET_GENERATE??(intrpt_code == SSC_GENERATE)
/* Function prototypes.????*/static void???ss_packet_generate (void); //产生包的函数,在function block中定义
?
一,INIT的入口代码:
/* At this initial state, we read the values of source attributes?*//* and schedule a selt interrupt that will indicate our start time?*//* for packet generation.???????????*/
/* Obtain the object id of the surrounding module.?????*/own_id = op_id_self (); //首先得到surrounding objid,应该是自己的objid,后面根据objid获取对象的属性
/* Read the values of the packet generation parameters, i.e. the?*//* attribute values of the surrounding module.??????*/
//用op_ima_obj_attr_get()得到对象的属性的值,是产生包的参数。注意interarrival_str和size_str是临时变量,还是char数组类型。op_ima_obj_attr_get (own_id, Packet Interarrival Time, interarrival_str);op_ima_obj_attr_get (own_id, Packet Size,????????????? size_str);op_ima_obj_attr_get (own_id, Packet Format,??????????? format_str);op_ima_obj_attr_get (own_id, Start Time,?????????????? start_time);op_ima_obj_attr_get (own_id, Stop Time,????????
您可能关注的文档
- Mobility and Learning Engaging People in Design of their Everyday Environments.pdf
- MobileFinder系统管理软件使用教程.doc
- MOBOTIX与手机实现音视频互通方法.pdf
- Mobile_应用程序部署和测试的最佳实战.pdf
- Model Parameter Identification with SPICE OPUS a Comparison of Direct Search and Elitistic.pdf
- Modeling Metallic Microstructure Using Moving Finite Elements.pdf
- Modeling the Searching Behavior of Social Monkeys.pdf
- Modeling, Design and Performance Evaluation of Interactive Distributed VideoonDemand Syst.pdf
- Modelling a Permutation Problem.pdf
- Modelling and detecting the cascade vulnerability problem using soft constraints.pdf
- Opportunities for Adaptation and Learning in Dynamically Stable Legged Robots.pdf
- OPNET环境下DOSnuke的攻防仿真.pdf
- OPGW光缆技术资料.doc
- Optical Design of DyeSensitized Nanocrystalline Solar Cells.pdf
- Optical Specifications for Optical Design, Testing and Production.pdf
- OptiFiber光缆认证(OTDR)分析仪.doc
- Optimal Design of an Indian Carpet Weaving Loom Structure.pdf
- Optimal Direct Determination of Sparse JacobianMatrices.pdf
- Optimal Dynamic Embeddings of Complete Binary Trees.pdf
- Optimal Trees for Searching in Codebook.pdf
最近下载
- 九年级数学秋季开学第一课(北师大版).pptx
- 部编人教版八年级上册道德与法治全册新质教学课件(配2025年秋改版教材).pptx
- 第1讲 我爱你中国(第一课时)美丽中国是我家(课件)-《新时代中国特色社会主义思想学生读本(小学低年级)》.pptx VIP
- 大学毕业论文_外文文献及中文翻译-财务风险的重要性how important is financial risk.doc VIP
- 人美版(2024)一年级美术上册第一单元《1.1介绍我自己》教学设计.docx VIP
- 民警进幼儿园安全讲课.pptx VIP
- 2024全国职业院校技能大赛ZZ055导游服务赛项规程+赛题 (2).docx VIP
- 计算机网络基础 龚娟 第2章 数据通信基础.ppt VIP
- 沙田柚种植技术最新完整版本.pptx VIP
- DBJ52_T103-2021:模块化箱式房屋安装及验收技术标准.pdf VIP
文档评论(0)