observed_document
Stable function · Other
Tier: stable · Kind: function · Topic: Other
| Julia | Rust |
|---|---|
observed_document | earthsci_integrator_planner::numeric::observed_document |
Julia
observed_document(m::EarthSciIntegrator.PlanModel, name::AbstractString, observeds::Vector{String})
observed_document(doc::AbstractDict)
observed_document(m, name, observeds) -> DerivedDocument
§6.8 (D132): the document that evaluates observeds, built as §6.5’s frozen
residual document: no terms, every state the zero right-hand side, and
FrozenEval.frozen_m holding the m-th observed. A map document (name the
map operator, observeds its sources in target order) or a limit document
(name the limit’s observed, which is the one observed).
observed_document(doc) -> (doc′, pairs)
The document doc (a JSON object) with one new state per observed of its
flattened model, so that a program built from it reports the observeds'
values in its right-hand side: the k-th observed in the code-point order
of their flattened names gets the state observed_state``(k),
declared in the model ObservedEval with the observed’s declared shape and
default 0.0, whose right-hand side is the observed itself (D(s) = o,
or for an array the faq of o over its shape). Nothing else changes: each
observed keeps its definition, compiled as it is in doc (no definition is
substituted or expanded), so an observed that reads another still reads that
observed’s value, and the document’s own states keep their equations. Also
returns observed => probe state for each, in that order. An observed
declared with no shape is taken as a scalar. The same document as the Rust
planner’s numeric::observed_document.
Rust
pub fn observed_document(doc: &Value) -> Result<(Value, Vec<(String, String)>), String>
The document doc with one new state per observed of its flattened
model, so that a program built from it reports the observeds’ values in
its right-hand side: the observed at position k of the code-point
order of their flattened names gets the state observed_state``(k),
declared in the model OBSERVED_COMPONENT with the observed’s
declared shape and default 0.0, whose right-hand side is the
observed itself (D(s) = o, or for an array the faq of o over its
shape). Nothing else changes: each observed keeps its definition, which
is compiled as it is in doc (no definition is substituted or
expanded), so an observed that reads another still reads that
observed’s value, and the document’s own states keep their equations.
Also returns each observed’s flattened name with its probe state, in
that order. An observed declared with no shape is taken as a scalar.