85
85
const SymbolicEdgeIndex{C,S} = Union{EIndex{C,S}, EPIndex{C,S}}
86
86
const SymbolicVertexIndex{C,S} = Union{VIndex{C,S}, VPIndex{C,S}}
87
87
88
+ idxtype (s:: VIndex ) = VIndex
89
+ idxtype (s:: EIndex ) = EIndex
90
+
88
91
#=
89
92
SciMLBase gets the index provider from ODEFunction.sys which defaults to f.sys so we provide it...
90
93
SSI Maintainer assured that f.sys is really only used for symbolic indexig so method seems legit
@@ -417,6 +420,8 @@ function SII.observed(nw::Network, snis)
417
420
418
421
# mapping i -> index in state
419
422
stateidx = Dict {Int, Int} ()
423
+ # mapping i -> index in p
424
+ paraidx = Dict {Int, Int} ()
420
425
# mapping i -> index in output
421
426
outidx = Dict {Int, Int} ()
422
427
# mapping i -> index in aggbuf
@@ -426,6 +431,8 @@ function SII.observed(nw::Network, snis)
426
431
for (i, sni) in enumerate (_snis)
427
432
if SII. is_variable (nw, sni)
428
433
stateidx[i] = SII. variable_index (nw, sni)
434
+ elseif SII. is_parameter (nw, sni)
435
+ paraidx[i] = SII. parameter_index (nw, sni)
429
436
else
430
437
cf = getcomp (nw, sni)
431
438
@@ -467,6 +474,9 @@ function SII.observed(nw::Network, snis)
467
474
if ! isempty (stateidx)
468
475
idx = only (stateidx). second
469
476
u[idx]
477
+ elseif ! isempty (paraidx)
478
+ idx = only (paraidx). second
479
+ p[idx]
470
480
elseif ! isempty (outidx)
471
481
idx = only (outidx). second
472
482
outbuf[idx]
@@ -489,6 +499,9 @@ function SII.observed(nw::Network, snis)
489
499
for (i, statei) in stateidx
490
500
out[i] = u[statei]
491
501
end
502
+ for (i, parai) in paraidx
503
+ out[i] = p[parai]
504
+ end
492
505
for (i, outi) in outidx
493
506
out[i] = outbuf[outi]
494
507
end
0 commit comments