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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 22 additions & 14 deletions nestkernel/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,33 +282,41 @@ class Node
}

/**
* Bring the node from state $t$ to $t+n*dt$.
* 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``.
Comment on lines +285 to +288
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``.

*
* n->update(T, from, to) performs the update steps beginning
* at T+from .. T+to-1, ie, emitting events with time stamps
* T+from+1 .. T+to.
* This method is called every ``min_delay`` interval, with each step
* between ``from`` and ``to`` corresponding to one simulation resolution
* (``nest.resolution``) timestep.
Comment on lines +290 to +292
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.

*
* @param Time network time at beginning of time slice.
* @param long initial step inside time slice
* @param long post-final step inside time slice
* ``update(T, from, to)`` performs the update steps in the interval
* ``T+from .. T+to-1``. If events are emitted, they have time stamps in
* the interval ``T+from+1 .. T+to``.
*
* @param origin network time at beginning of time slice
* @param from initial step inside time slice
* @param to post-final step inside time slice
*
*/
virtual void update( Time const&, const long, const long ) = 0;

/**
* 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?

* and then reset state variables to values at ``origin``.
*
* n->wfr_update(T, from, to) performs the update steps beginning
* at T+from .. T+to-1.
* ``wfr_update(T, from, to)`` performs the update steps in the interval
* ``T+from .. T+to-1``.
*
* Does not emit spikes, does not log state variables.
*
* throws UnexpectedEvent if not reimplemented in derived class
*
* @param Time network time at beginning of time slice.
* @param long initial step inside time slice
* @param long post-final step inside time slice
* @param origin network time at beginning of time slice
* @param from initial step inside time slice
* @param to post-final step inside time slice
*
*/
virtual bool wfr_update( Time const&, const long, const long );
Expand Down
Loading