We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
关于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供大家参考
The text was updated successfully, but these errors were encountered:
可以直接在github上进行修改,然后提交PR即可!
非常感谢! @Stephenhua 可关注更新一下
Sorry, something went wrong.
No branches or pull requests
关于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供大家参考
The text was updated successfully, but these errors were encountered: