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

Error in Part 7 of tictoc tutorial #15

Closed
Fanfoue opened this issue May 17, 2021 · 1 comment
Closed

Error in Part 7 of tictoc tutorial #15

Fanfoue opened this issue May 17, 2021 · 1 comment

Comments

@Fanfoue
Copy link

Fanfoue commented May 17, 2021

Part 7 of tictoc tutorial creates a parametrized network with a given number of central nodes.
In the .ned file, there is an error in the connections.
It is currently written:

        for i=2..numCentralNodes+1 {
            tic[i].gate++ <--> Channel <--> tic[i+1].gate++;
        }

The for-loop should stop at numCentralNodes instead of numCentralNodes+1.
The connection created for i = num+1 is not part of the central path,
and is already created in the next lines:

        // connect the 2 nodes on the other side to the central nodes
        tic[numCentralNodes+2].gate++ <--> Channel <--> tic[numCentralNodes+1].gate++;
        tic[numCentralNodes+3].gate++ <--> Channel <--> tic[numCentralNodes+1].gate++;

With current code, the node tic[numCentralNodes+1] is connected twice with tic[numCentralNodes+2].
For example, see attached screenshot with numCentralNodes=2, node 3 is connected twice to node 4.
If you want me to make a PR or if you need more info, let me know.

ScreenshotWithNum=2

@torokati44
Copy link
Member

torokati44 commented Nov 7, 2023

Oh, you are absolutely right. Nice catch, thank you! Sorry for the significant delay in response.
The mistake was probably made because in NED, for historical reasons, for loops are inclusive on the right end of the range, and here this was not taken into account.

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