Skip to content

Conversation

@Azson
Copy link
Collaborator

@Azson Azson commented Apr 8, 2021

No description provided.

if (trace.find("rtt") != trace.end()) {
ti.rtt_ms_ = lexical_cast<decltype(ti.rtt_ms_)>(trace["rtt"]);
} else {
ti.rtt_ms_ = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't set 0 as the default value, try boost::optional.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in commit 03f42d6

for (size_t i = 0; i < nodes_.GetN(); i++) {
auto node = nodes_.Get(i);
// set delay in channel
node->GetDevice(0)->GetChannel()->SetAttribute("Delay", StringValue(std::to_string(trace.rtt_ms_/2.0) + "ms"));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check whether RTT was assigned.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in commit 03f42d6

@Pterosaur
Copy link
Contributor

Please correct the test

@Azson Azson changed the title support to change rtt dynamically in gym and make a test script support to change rtt dynamically in gym Apr 8, 2021
@Azson Azson requested a review from Pterosaur April 9, 2021 01:58
@Pterosaur Pterosaur merged commit cc842e7 into OpenNetLab:master Apr 9, 2021
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

Successfully merging this pull request may close these issues.

2 participants