Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.1.2 关于send的描述有极大的误导性 #25

Open
zapquiyou opened this issue Dec 7, 2020 · 1 comment
Open

5.1.2 关于send的描述有极大的误导性 #25

zapquiyou opened this issue Dec 7, 2020 · 1 comment

Comments

@zapquiyou
Copy link

关于send广播的问题其实在官网SimulationManul文档的4.7.3描述的很清楚。虽然本文档的方法不能说是错误,但是却容易使读者陷入误区,认为是一个Module只能同时进行一个send,事实上官方文档的解释是一个Message不能多次发送,并且官网给出了广播发送的方法:
for (int i = 0; i < n; i++)
{
cMessage *copy = msg->dup();
send(copy, "out", i);
}
delete msg;
或:
int outGateBaseId = gateBaseId("out");
for (int i = 0; i < n; i++)
send(i==n-1 ? msg : msg->dup(), outGateBaseId+i);
本身文档也是中文,我就不翻译成英文了,本人时间有限,希望有精力的朋友修改相应部分,在修改之前这个issue设置为open供大家参考

@wangrongwei
Copy link
Owner

可以直接在github上进行修改,然后提交PR即可!

非常感谢!
@Stephenhua 可关注更新一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants