如何编辑Omnet ++的源代码? [英] How to edit the source code of Omnet++?

查看:290
本文介绍了如何编辑Omnet ++的源代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行Omnet ++时,它将加载.ini.ned文件,并执行模拟并将结果写入.sca.vec文件中.

When I run Omnet++, it loads .ini and .ned files, and performs a simulation and writes the results in .sca and .vec file.

但是,我想修改源代码,以便在运行Omnet ++时,它像每100毫秒一样加载输入文件,并在该间隔之后写入结果.

However I want to modify the source code such that while Omnet++ is running, it loads the input files like every 100 msec and also writes the results after that interval.

我们应该如何修改代码?在仿真过程中,还可以通过其他任何方式在不更改源代码的情况下更新.ini.ned文件吗?

How should we modify the code? Is there any other way to update .ini and .ned file while the simulation is in progress without changing the source code?

推荐答案

可以通过编写其他模型代码来修改正在运行的仿真并在仿真仍处于运行状态时访问其结果.该代码将负责更改模块参数,即时实例化模块并收集结果(全部是对外部刺激的反应).有关如何更改参数的信息,请参见此问题和《用户手册》的后者.

Both modifying a running simulation and accessing a simulation's results while it is still running are possible by writing additional model code. This code would be responsible for changing module parameters, instantiating modules on the fly, and collecting results (all in reaction to external stimuli). See this question for how to change parameters and the User Manual's Section 4.13 ("Dynamic Module Creation") and Section 4.15.6 ("Writing Result Filters and Recorders") for the latter.

这篇关于如何编辑Omnet ++的源代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆