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

Clarify documentation of node update() method #3388

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

clinssen
Copy link
Contributor

@clinssen clinssen commented Jan 6, 2025

No description provided.

@clinssen clinssen added S: Normal Handle this with default priority T: Maintenance Work to keep up the quality of the code and documentation. I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) labels Jan 6, 2025
@terhorstd
Copy link
Contributor

This needs a quick review for correctness. Single reviewer should be fine.

Copy link
Contributor

@heplesser heplesser left a comment

Choose a reason for hiding this comment

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

@clinssen Thanks for the PR. Please see my inline comments for some corrections on details.

Comment on lines +285 to +288
* Advance the state of the node forward in time by one ``min_delay``
* interval. Precondition: state of the node corresponds to the time
* ``origin``. Postcondition: state of the node corresponds to the time
* ``origin + min_delay``.
Copy link
Contributor

Choose a reason for hiding this comment

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

Doxygen comments should start with a single line with a brief description that can, e.g., be included in a table of classes. And update() does not strictly advance through one min_delay interval: If Simulate is called with a time that is not a multiple of min_delay, we will stop inside a min_delay slice.

Suggested change
* Advance the state of the node forward in time by one ``min_delay``
* interval. Precondition: state of the node corresponds to the time
* ``origin``. Postcondition: state of the node corresponds to the time
* ``origin + min_delay``.
* Advance the state of the node in time through the given interval.
*
* This method advances the state of the node through the interval
* ``(origin+from, origin+to]``, which is at most ``min_delay`` long.
*
* - Precondition: State of the node corresponds to the time ``origin+from``.
* - Postcondition: State of the node corresponds to the time ``origin+to``.

Comment on lines +290 to +292
* This method is called every ``min_delay`` interval, with each step
* between ``from`` and ``to`` corresponding to one simulation resolution
* (``nest.resolution``) timestep.
Copy link
Contributor

Choose a reason for hiding this comment

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

This also needs to be updated corresponding to the changes above.

* Bring the node from state $t$ to $t+n*dt$, sends SecondaryEvents
* (e.g. GapJunctionEvent) and resets state variables to values at $t$.
* Advance the state of the node forward in time by one ``min_delay``
* interval (see ``update()``); send SecondaryEvents (e.g. GapJunctionEvent)
Copy link
Contributor

Choose a reason for hiding this comment

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

Same points as for update() apply here. Also, can one mark up the "see update()" here in such a way that update() becomes a hyperlink to the documentation for update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) S: Normal Handle this with default priority T: Maintenance Work to keep up the quality of the code and documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants