omnet java_omnet:自我消息作为被处置对象
模拟运行,但在控制台中我有这个说明 .
undisposed对象:(omnetpp :: cMessage)Mysimulation.Switch4.eth [2] .queue.scheduler.IntervalTimemsg - 检查模块析构函数未处理对象:(omnetpp :: cMessage)Mysimulation.Switch5.eth [1] .queue.scheduler .IntervalTimemsg - 检查模块析构函数
实际上,这是我通过模拟反复使用两个定时消息创建的模块 . 我在线阅读并发现此错误与创建应删除时未删除的对象有关 .
void PriorityScheduler::initialize() {
gateCycleTimemsg = new cMessage("gateCycleTimemsg");
scheduleAt(baseTime , gateCycleTimemsg);
// baseTime = 2s
}
void PriorityScheduler::handleMessage(cMessage *msg) {
if (msg == gateCycleTimemsg) {
if (currentList == (lastIntervalTime)) {
delete msg;
gateCycleTimemsg = new cMessage("gateCycleTimemsg");
scheduleAt( simTime() + gateCycleTime , gateCycleTimemsg);
...
IntervalTimemsg = new cMessage("IntervalTimemsg");
scheduleAt( simTime() + Interval , IntervalTimemsg);
}
else if (currentList == (firstIntervalTime)) {
gateCycleTimemsg = msg; // same message reused
scheduleAt(simTime() + gateCycleTime , gateCycleTimemsg);
//gateCycleTime = 10 seconds
...
IntervalTimemsg = new cMessage("IntervalTimemsg");
scheduleAt( simTime() + Interval , IntervalTimemsg);
// Interval = 1s
}
}
else if (msg == IntervalTimemsg) {
if (currentList == (lastIntervalTime));
else{
IntervalTimemsg = msg;
scheduleAt( simTime() + Interval , IntervalTimemsg);
}
}
插件路径:/home/amr/omnetpp-5.0/samples/etc/plugins;./plugins在抛出'omnetpp :: cRuntimeError'的实例后调用what():对象pk-56-145当前在(omnetpp) :: cEventHeap)simulation.scheduled-events,无法删除 . 如果在omnetpp :: cEventHeap中发生此错误,则需要将其更改为调用drop()才能删除该对象 . 如果在omnetpp :: cEventHeap的析构函数中发生此错误并且pk-56-145是类成员,则omnetpp :: cEventHeap需要在析构函数中调用drop()
我创建了一个构造函数和析构函数 . 在线阅读解决方案之后,我还创建了函数finish() . 仍然没有解决它 .
我也删除了收到的每条消息,并在发送时创建了一个新消息,但它没有改变任何东西 .
edit: 我用delete msg编辑了编码;我添加了一个时间示例并添加了以下部分,
BaseTime'BT',gateCycleTime'CT',Interval'IT'
----> BT
.........
我使用相同的信息用于BT和CT,而另一条信息用于IT,因为我不知道最后一次IT'ITx'的时间 .
omnet java_omnet:自我消息作为被处置对象相关推荐
- iOS进阶 :【NSProxy模拟多继承】作为一个委托代理对象,将消息转发给一个真实的对象或者自己加载的对象
文章目录 前言 I 模拟多继承 1.1 初始化委托对象,用于拦截 UITableView 的选中 cell 事件 1.2 重写-methodSignatureForSelector:方法(获取真实对象 ...
- omnet java_omnet++4.0安装使用
http://my.oschina.net/u/2269841/blog/423659 在windows8上安装omnet++ 谨慎起见先在网上搜索了相关的文章,还好一路顺利.现在开始为电脑安装软件. ...
- 游戏对象之间发送和接收消息
1.创建一个游戏工程, 命名为SRMessageGo 2.在Project视图中创建3个文件夹, Scene文件夹.Resources文件夹和Script文件夹 3.将当前场景保存为GameScene ...
- 进程间通信方式(三)-- IPC对象(消息队列、共享内存、信号灯集)
IPC对象 1. IPC对象 2. 查看IPC对象命令 3. 消息队列 3.1 概念 3.2 相关函数 3.2.1 msgget() 创建或者打开消息队列 3.2.2 ftok() 获取键值 3.2. ...
- delphi VCL研究之消息分发机制(转)
原文来源,http://blog.csdn.net/sushengmiyan/article/details/8635550 1.VCL 概貌 先看一下VCL类图的主要分支,如图4.1所示. 在图中可 ...
- 《UML面向对象设计基础》—第1章1.5节消息
本节书摘来自异步社区<UML面向对象设计基础>一书中的第1章1.5节消息,作者[美]Meliir Page-Jones,更多章节内容可以访问云栖社区"异步社区"公众号查 ...
- Java—面向对象设计—类和对象
理解面向对象程序设计 面向对象程序(Object-oriented programming,OOP)设计是继面向过程又一具有里程碑意义的编程思想,是现实世界模型的自然延伸.下面从结构化程序设计说起,逐 ...
- Java学习总结——类和对象
玖--面向对象设计 类( class )和对象( object )是面向对象程序设计最重要的概念.要深入了解 Java 程序语言,一定要树立面向对象程序设计的观念. 一.理解面向对象程序设计 面向对象 ...
- Rational Rose时序图组成与对象的生命线设置
引用于 http://blog.csdn.net/chenyujing1234 欢迎大家拍砖 一. 1. 序列图的定义 在UML的表示中,序列图将交互关系表示为一个二维图.其中,纵向是时间轴,时间沿竖 ...
最新文章
- 生信人的linux考试
- SSIS中的容器和数据流—举例说明数据转换任务
- 中断、异常、处理对于操作系统的概念
- Web前后端笔记-通过对称加密算法和信息摘要算法防止数据重放
- Java的break和continue关键字
- 数据库还原的多种方式
- 基于51单片机的CC2541蓝牙透传模块的无线通信
- 视频教程-Three.Js (WebGL ThreeJs) 网页3D实战视频教程-其他
- 个人申请软件著作权的记录
- ORacle异常:ORA-00980:同义词转换不再有效
- Linux文件编辑命令vi详细说明
- Linux 的常用系统及网络命令
- LSF---【bsub命令】
- 东大18秋计算机网络在线作业1答案,东大18秋学期《计算机辅助数控编程》在线作业1辅导资料...
- rem 与 px 换算关系
- ExtJS初级教程之ExtJS Tree(三)
- 句子深度假说——冯志伟
- 新一代图片编解码技术在淘宝的应用及落地
- 虚假新闻检测论文阅读(七):A temporal ensembling based semi-supervised ConvNet for the detection of fake news
- 输入每月本金,年利率,月份求复利值