Skip to content

Commit 1811bb1

Browse files
committed
improve docs
1 parent 882ba2b commit 1811bb1

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

docs/src/data_structure.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
# Data Structure
22

33
A [`Network`](@ref) contains a list of vertex and edge models along with a graph.
4-
54
However, in tight numerical loops, it will never access these lists of models directly.
65
Instead, the network maintains an internal representation that tracks all symbolic indices, defining the precise ordering of states and parameters in a flat array representation. To optimize performance, especially for heterogeneous networks, the network employs specialized data structures that batch identical models together.
76

87
This disconnect between the explicit lists and the internal data structures
98
can be confusing.
109

11-
1210
## Flat Parameter and State Arrays
1311

1412
The vertex and edge models may contain metadata, such as initial values for states and parameters.
@@ -66,3 +64,6 @@ nothing #hide
6664
nw = Network(complete_graph(3), [v1,v2,v1], e; dealias=true)
6765
nw[VIndex(1)] === nw[VIndex(3)] # neither of them === v1
6866
```
67+
68+
## Extracting `Network`-object from Containers
69+
`NetworkDynamics.jl` provides a [`extract_nw`](@ref) function, to get a reference to the wrapped `Network` object from different containers, such as solution objects or integrator objects.

docs/src/metadata.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Special cases for symbol metadata are:
2828
- `default`: Stores default values for states/parameters. In initialization, those are considered fixed.
2929
- `guess`: Stores a guess for a state/parameter which needs to solved during initialization ("free" variables).
3030
- `bounds`: Store bounds for variables/parameters
31-
- `init`: Stores the solution of the "free" variables during initialization.
31+
- `init`: Stores the solution of the "free" variables, this is rarely set manual but instead when calling [`initialize_component`](@ref).
3232

3333
Fore those, there are special functions `has_*`, `get_*` and `set_*!`. See [Per Symbol Metadata API](@ref).
3434

src/callbacks.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Creates a callback condition for a [`ComponentCallback`].
6969
- `ctx.model`: a referenc to the ocmponent model
7070
- `ctx.vidx`/`ctx.eidx`: The index of the vertex/edge model.
7171
- `ctx.src`/`ctx.dst`: src and dst indices (only for edge models).
72-
- `ctx.integrator`: The integrator object.
72+
- `ctx.integrator`: The integrator object. Use [`extract_nw`](@ref) to obtain the network.
7373
- `ctx.t=ctx.integrator.t`: The current simulation time.
7474
- `sym`: A vector or tuple of symbols, which represent **states** (**excluding**
7575
inputs, outputs, observed) of the component model. Determines, which states will

0 commit comments

Comments
 (0)