From e9c5329620a0092a86824b360bdc35dfc4160d0a Mon Sep 17 00:00:00 2001
From: "Documenter.jl" <documenter@juliadocs.github.io>
Date: Wed, 15 May 2024 16:16:19 +0000
Subject: [PATCH] build based on fd60d42

---
 dev/index.html                   |  2 +-
 dev/lib/algorithms/index.html    | 20 ++++++++++----------
 dev/lib/core/index.html          | 22 +++++++++++-----------
 dev/lib/models/index.html        |  2 +-
 dev/lib/operators/index.html     |  2 +-
 dev/lib/rtutils/index.html       |  6 +++---
 dev/lib/sfuncs/index.html        | 18 +++++++++---------
 dev/lib/utilities/index.html     |  4 ++--
 dev/search/index.html            |  2 +-
 dev/tutorial/examples/index.html |  2 +-
 dev/tutorial/tutorial/index.html |  2 +-
 11 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/dev/index.html b/dev/index.html
index affb251..4ea2125 100644
--- a/dev/index.html
+++ b/dev/index.html
@@ -1,2 +1,2 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Getting Started · Scruff.jl</title><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href>Scruff.jl</a></span></div><form class="docs-search" action="search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li class="is-active"><a class="tocitem" href>Getting Started</a><ul class="internal"><li><a class="tocitem" href="#Installation"><span>Installation</span></a></li><li><a class="tocitem" href="#Developing-Scruff"><span>Developing Scruff</span></a></li><li><a class="tocitem" href="#Learning-about-Scruff"><span>Learning about Scruff</span></a></li><li><a class="tocitem" href="#Contributing-to-Scruff"><span>Contributing to Scruff</span></a></li></ul></li><li><a class="tocitem" href="tutorial/tutorial/">Tutorial</a></li><li><a class="tocitem" href="tutorial/examples/">Examples</a></li><li><span class="tocitem">Library</span><ul><li><a class="tocitem" href="lib/core/">Core</a></li><li><a class="tocitem" href="lib/sfuncs/">Stochastic Functions</a></li><li><a class="tocitem" href="lib/operators/">Operators</a></li><li><a class="tocitem" href="lib/models/">Models</a></li><li><a class="tocitem" href="lib/algorithms/">Algorithms</a></li><li><a class="tocitem" href="lib/utilities/">Utilities</a></li><li><a class="tocitem" href="lib/rtutils/">Runtime Utilities</a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Getting Started</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Getting Started</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/charles-river-analytics/Scruff.jl/blob/develop/docs/src/index.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="Scruff"><a class="docs-heading-anchor" href="#Scruff">Scruff</a><a id="Scruff-1"></a><a class="docs-heading-anchor-permalink" href="#Scruff" title="Permalink"></a></h1><p>Scruff is an AI framework to build agents that sense, reason, and learn in the world using a variety of models.   It aims to integrate many different kinds of models in a coherent framework, provide flexibility in spatiotemporal modeling, and provide tools to compose, share, and reuse models and model components.</p><p>Warning: Scruff is rapidly evolving beta research software. Although the software already has a lot of functionality, we intend to expand on this in the future and cannot promise stability of the code or the APIs at the moment.</p><h2 id="Installation"><a class="docs-heading-anchor" href="#Installation">Installation</a><a id="Installation-1"></a><a class="docs-heading-anchor-permalink" href="#Installation" title="Permalink"></a></h2><p>First, <a href="https://julialang.org/downloads/">download Julia 1.6.0 or later</a>.</p><p>Then, install the Scruff package with the Julia package manager.  From the Julia REPL, type <code>]</code> to enter the Pkg REPL mode and then run:</p><pre><code class="language-julia-repl hljs">pkg&gt; add Scruff</code></pre><h2 id="Developing-Scruff"><a class="docs-heading-anchor" href="#Developing-Scruff">Developing Scruff</a><a id="Developing-Scruff-1"></a><a class="docs-heading-anchor-permalink" href="#Developing-Scruff" title="Permalink"></a></h2><p>To develop Scruff, first pull down the code</p><pre><code class="language-bash hljs">$ git clone https://github.com/p2t2/Scruff.git</code></pre><h2 id="Learning-about-Scruff"><a class="docs-heading-anchor" href="#Learning-about-Scruff">Learning about Scruff</a><a id="Learning-about-Scruff-1"></a><a class="docs-heading-anchor-permalink" href="#Learning-about-Scruff" title="Permalink"></a></h2><p>Please read the <a href="tutorial/tutorial/#The-Scruff-Tutorial">The Scruff Tutorial</a>, which describes most of the language features through examples. The library documentation contains detailed information about most of the data structures and functions used in the code.</p><h2 id="Contributing-to-Scruff"><a class="docs-heading-anchor" href="#Contributing-to-Scruff">Contributing to Scruff</a><a id="Contributing-to-Scruff-1"></a><a class="docs-heading-anchor-permalink" href="#Contributing-to-Scruff" title="Permalink"></a></h2><p>We welcome contributions from the community. Please see the issues in Github for some of the improvements  we would like to make, and feel free to add your own suggestions. </p></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="tutorial/tutorial/">Tutorial »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Tuesday 7 May 2024 20:00">Tuesday 7 May 2024</span>. Using Julia version 1.7.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Getting Started · Scruff.jl</title><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href>Scruff.jl</a></span></div><form class="docs-search" action="search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li class="is-active"><a class="tocitem" href>Getting Started</a><ul class="internal"><li><a class="tocitem" href="#Installation"><span>Installation</span></a></li><li><a class="tocitem" href="#Developing-Scruff"><span>Developing Scruff</span></a></li><li><a class="tocitem" href="#Learning-about-Scruff"><span>Learning about Scruff</span></a></li><li><a class="tocitem" href="#Contributing-to-Scruff"><span>Contributing to Scruff</span></a></li></ul></li><li><a class="tocitem" href="tutorial/tutorial/">Tutorial</a></li><li><a class="tocitem" href="tutorial/examples/">Examples</a></li><li><span class="tocitem">Library</span><ul><li><a class="tocitem" href="lib/core/">Core</a></li><li><a class="tocitem" href="lib/sfuncs/">Stochastic Functions</a></li><li><a class="tocitem" href="lib/operators/">Operators</a></li><li><a class="tocitem" href="lib/models/">Models</a></li><li><a class="tocitem" href="lib/algorithms/">Algorithms</a></li><li><a class="tocitem" href="lib/utilities/">Utilities</a></li><li><a class="tocitem" href="lib/rtutils/">Runtime Utilities</a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Getting Started</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Getting Started</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/charles-river-analytics/Scruff.jl/blob/develop/docs/src/index.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="Scruff"><a class="docs-heading-anchor" href="#Scruff">Scruff</a><a id="Scruff-1"></a><a class="docs-heading-anchor-permalink" href="#Scruff" title="Permalink"></a></h1><p>Scruff is an AI framework to build agents that sense, reason, and learn in the world using a variety of models.   It aims to integrate many different kinds of models in a coherent framework, provide flexibility in spatiotemporal modeling, and provide tools to compose, share, and reuse models and model components.</p><p>Warning: Scruff is rapidly evolving beta research software. Although the software already has a lot of functionality, we intend to expand on this in the future and cannot promise stability of the code or the APIs at the moment.</p><h2 id="Installation"><a class="docs-heading-anchor" href="#Installation">Installation</a><a id="Installation-1"></a><a class="docs-heading-anchor-permalink" href="#Installation" title="Permalink"></a></h2><p>First, <a href="https://julialang.org/downloads/">download Julia 1.6.0 or later</a>.</p><p>Then, install the Scruff package with the Julia package manager.  From the Julia REPL, type <code>]</code> to enter the Pkg REPL mode and then run:</p><pre><code class="language-julia-repl hljs">pkg&gt; add Scruff</code></pre><h2 id="Developing-Scruff"><a class="docs-heading-anchor" href="#Developing-Scruff">Developing Scruff</a><a id="Developing-Scruff-1"></a><a class="docs-heading-anchor-permalink" href="#Developing-Scruff" title="Permalink"></a></h2><p>To develop Scruff, first pull down the code</p><pre><code class="language-bash hljs">$ git clone https://github.com/p2t2/Scruff.git</code></pre><h2 id="Learning-about-Scruff"><a class="docs-heading-anchor" href="#Learning-about-Scruff">Learning about Scruff</a><a id="Learning-about-Scruff-1"></a><a class="docs-heading-anchor-permalink" href="#Learning-about-Scruff" title="Permalink"></a></h2><p>Please read the <a href="tutorial/tutorial/#The-Scruff-Tutorial">The Scruff Tutorial</a>, which describes most of the language features through examples. The library documentation contains detailed information about most of the data structures and functions used in the code.</p><h2 id="Contributing-to-Scruff"><a class="docs-heading-anchor" href="#Contributing-to-Scruff">Contributing to Scruff</a><a id="Contributing-to-Scruff-1"></a><a class="docs-heading-anchor-permalink" href="#Contributing-to-Scruff" title="Permalink"></a></h2><p>We welcome contributions from the community. Please see the issues in Github for some of the improvements  we would like to make, and feel free to add your own suggestions. </p></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="tutorial/tutorial/">Tutorial »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Wednesday 15 May 2024 16:16">Wednesday 15 May 2024</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/dev/lib/algorithms/index.html b/dev/lib/algorithms/index.html
index 98d92dd..7b07778 100644
--- a/dev/lib/algorithms/index.html
+++ b/dev/lib/algorithms/index.html
@@ -1,12 +1,12 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Algorithms · Scruff.jl</title><script data-outdated-warner src="../../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../../assets/documenter.js"></script><script src="../../siteinfo.js"></script><script src="../../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../../">Scruff.jl</a></span></div><form class="docs-search" action="../../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../../">Getting Started</a></li><li><a class="tocitem" href="../../tutorial/tutorial/">Tutorial</a></li><li><a class="tocitem" href="../../tutorial/examples/">Examples</a></li><li><span class="tocitem">Library</span><ul><li><a class="tocitem" href="../core/">Core</a></li><li><a class="tocitem" href="../sfuncs/">Stochastic Functions</a></li><li><a class="tocitem" href="../operators/">Operators</a></li><li><a class="tocitem" href="../models/">Models</a></li><li class="is-active"><a class="tocitem" href>Algorithms</a></li><li><a class="tocitem" href="../utilities/">Utilities</a></li><li><a class="tocitem" href="../rtutils/">Runtime Utilities</a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Library</a></li><li class="is-active"><a href>Algorithms</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Algorithms</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/charles-river-analytics/Scruff.jl/blob/develop/docs/src/lib/algorithms.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="scruff_algorithms"><a class="docs-heading-anchor" href="#scruff_algorithms">Scruff.Algorithms</a><a id="scruff_algorithms-1"></a><a class="docs-heading-anchor-permalink" href="#scruff_algorithms" title="Permalink"></a></h1><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.Queryable" href="#Scruff.Algorithms.Queryable"><code>Scruff.Algorithms.Queryable</code></a> — <span class="docstring-category">Type</span></header><section><div><p>A query target is either a variable instance or a variable. Allowing queries to be defined in terms of instances rather than variables makes it possible to ask queries across multiple instances of a variable at different times. However, in many cases the current instance of the variable(s) is required and then it is easier to use variables.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/query.jl#L26-L32">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.Algorithm" href="#Scruff.Algorithms.Algorithm"><code>Scruff.Algorithms.Algorithm</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Algorithm</code></pre><p>The supertype of all algorithms.</p><p>A standard set of queries is defined for algorithms. Any given subtype of <code>Algorithm</code> will implement a subset of these queries.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/algorithm.jl#L8-L15">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.BP" href="#Scruff.Algorithms.BP"><code>Scruff.Algorithms.BP</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type BP &lt;: InstantAlgorithm</code></pre><p>Belief Propagation algorithm</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/instant/bp.jl#L5-L9">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.CoherentWindow" href="#Scruff.Algorithms.CoherentWindow"><code>Scruff.Algorithms.CoherentWindow</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct CoherentWindow &lt;: WindowCreator end</code></pre><p>A variant of AsyncWindow that ensures that parent values are never stale for any variable that gets updated in a filter step. In other words, if any parent of a direct parent has been updated more recently than a variable to be updated, the direct parent is added to the variables to be updated. This condition then recurses for the direct parents.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/filtering/windowcreator.jl#L82-L88">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.Filter" href="#Scruff.Algorithms.Filter"><code>Scruff.Algorithms.Filter</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type Filter &lt;: Algorithm end</code></pre><p>General type of filtering algorithms.</p><p>Must implement init<em>filter and filter</em>step methods.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/filtering/filter.jl#L6-L12">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.Importance" href="#Scruff.Algorithms.Importance"><code>Scruff.Algorithms.Importance</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Importance &lt;: InstantAlgorithm</code></pre><p>Representation of an importance sampling algorithm.</p><p><strong>arguments</strong></p><ul><li>proposal_function Specifies how the algorithm should make proposals. This is a function</li></ul><p>that takes a runtime and an instance and returns a proposer.  The proposer takes parent values and proposes a value for the instance along with a log score.</p><ul><li>num_particles The number of completed particles to use. This is not necessarily the</li></ul><p>number attempted. If there are rejections, the algorithm will continue to create particles until <code>num_particles</code> have been completed. Warning: With impossible evidence, the process will not terminate.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/instant/importance.jl#L9-L23">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.InstantAlgorithm" href="#Scruff.Algorithms.InstantAlgorithm"><code>Scruff.Algorithms.InstantAlgorithm</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">InstantAlgorithm
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Algorithms · Scruff.jl</title><script data-outdated-warner src="../../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../../assets/documenter.js"></script><script src="../../siteinfo.js"></script><script src="../../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../../">Scruff.jl</a></span></div><form class="docs-search" action="../../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../../">Getting Started</a></li><li><a class="tocitem" href="../../tutorial/tutorial/">Tutorial</a></li><li><a class="tocitem" href="../../tutorial/examples/">Examples</a></li><li><span class="tocitem">Library</span><ul><li><a class="tocitem" href="../core/">Core</a></li><li><a class="tocitem" href="../sfuncs/">Stochastic Functions</a></li><li><a class="tocitem" href="../operators/">Operators</a></li><li><a class="tocitem" href="../models/">Models</a></li><li class="is-active"><a class="tocitem" href>Algorithms</a></li><li><a class="tocitem" href="../utilities/">Utilities</a></li><li><a class="tocitem" href="../rtutils/">Runtime Utilities</a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Library</a></li><li class="is-active"><a href>Algorithms</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Algorithms</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/charles-river-analytics/Scruff.jl/blob/develop/docs/src/lib/algorithms.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="scruff_algorithms"><a class="docs-heading-anchor" href="#scruff_algorithms">Scruff.Algorithms</a><a id="scruff_algorithms-1"></a><a class="docs-heading-anchor-permalink" href="#scruff_algorithms" title="Permalink"></a></h1><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.Queryable" href="#Scruff.Algorithms.Queryable"><code>Scruff.Algorithms.Queryable</code></a> — <span class="docstring-category">Type</span></header><section><div><p>A query target is either a variable instance or a variable. Allowing queries to be defined in terms of instances rather than variables makes it possible to ask queries across multiple instances of a variable at different times. However, in many cases the current instance of the variable(s) is required and then it is easier to use variables.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/query.jl#L26-L32">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.Algorithm" href="#Scruff.Algorithms.Algorithm"><code>Scruff.Algorithms.Algorithm</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Algorithm</code></pre><p>The supertype of all algorithms.</p><p>A standard set of queries is defined for algorithms. Any given subtype of <code>Algorithm</code> will implement a subset of these queries.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/algorithm.jl#L8-L15">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.BP" href="#Scruff.Algorithms.BP"><code>Scruff.Algorithms.BP</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type BP &lt;: InstantAlgorithm</code></pre><p>Belief Propagation algorithm</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/instant/bp.jl#L5-L9">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.CoherentWindow" href="#Scruff.Algorithms.CoherentWindow"><code>Scruff.Algorithms.CoherentWindow</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct CoherentWindow &lt;: WindowCreator end</code></pre><p>A variant of AsyncWindow that ensures that parent values are never stale for any variable that gets updated in a filter step. In other words, if any parent of a direct parent has been updated more recently than a variable to be updated, the direct parent is added to the variables to be updated. This condition then recurses for the direct parents.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/filtering/windowcreator.jl#L82-L88">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.Filter" href="#Scruff.Algorithms.Filter"><code>Scruff.Algorithms.Filter</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type Filter &lt;: Algorithm end</code></pre><p>General type of filtering algorithms.</p><p>Must implement init<em>filter and filter</em>step methods.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/filtering/filter.jl#L6-L12">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.Importance" href="#Scruff.Algorithms.Importance"><code>Scruff.Algorithms.Importance</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Importance &lt;: InstantAlgorithm</code></pre><p>Representation of an importance sampling algorithm.</p><p><strong>arguments</strong></p><ul><li>proposal_function Specifies how the algorithm should make proposals. This is a function</li></ul><p>that takes a runtime and an instance and returns a proposer.  The proposer takes parent values and proposes a value for the instance along with a log score.</p><ul><li>num_particles The number of completed particles to use. This is not necessarily the</li></ul><p>number attempted. If there are rejections, the algorithm will continue to create particles until <code>num_particles</code> have been completed. Warning: With impossible evidence, the process will not terminate.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/instant/importance.jl#L9-L23">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.InstantAlgorithm" href="#Scruff.Algorithms.InstantAlgorithm"><code>Scruff.Algorithms.InstantAlgorithm</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">InstantAlgorithm
 
-Algorithm that runs once on an `InstantNetwork`.</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/instant/instantalgorithm.jl#L5-L9">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.IterativeAlgorithm" href="#Scruff.Algorithms.IterativeAlgorithm"><code>Scruff.Algorithms.IterativeAlgorithm</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type IterativeAlgorithm &lt;: InstantAlgorithm</code></pre><p>Algorithm that runs iteratively on an <code>InstantNetwork</code>.</p><p>The algorithm should support two methods: <code>prepare</code> and <code>refine</code>.</p><p>An IterativeAlgorithm is also trivially an InstantAlgorithm where <code>Infer</code> is implemented by calling <code>prepare</code> and <code>refine</code> once.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/iterative/iterativealgorithm.jl#L6-L15">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.IterativeSampler" href="#Scruff.Algorithms.IterativeSampler"><code>Scruff.Algorithms.IterativeSampler</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct IterativeSampler &lt;: IterativeAlgorithm</code></pre><p>An iterative algorithm that uses a sampler to accumulate more samples on each refinement.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/iterative/iterativesampler.jl#L4-L8">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.LazyInference" href="#Scruff.Algorithms.LazyInference"><code>Scruff.Algorithms.LazyInference</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct LazyInference &lt;: IterativeAlgorithm</code></pre><p>An iterative algorithm that expands recursively and increases the ranges of instances on every iteration.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/iterative/lazyinference.jl#L41-L45">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.LazyState" href="#Scruff.Algorithms.LazyState"><code>Scruff.Algorithms.LazyState</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">mutable struct LazyState</code></pre><p>Maintains the state of a lazy algorithm</p><p><strong>Fields</strong></p><ul><li><code>previous_algorithm</code>: The last instant algorithm used, if any</li><li><code>evidence</code>: The evidence supplied in <code>prepare</code></li><li><code>interventions</code>: The interventions supplied in <code>prepare</code></li><li><code>placeholder_beliefs</code>: The placeholder beliefs supplied in <code>prepare</code></li><li><code>next_size</code>: The range size to use in the next call to <code>refine</code></li><li><code>next_depth</code>: The depth to use in the next call to <code>refine</code></li><li><code>next_iteration</code>: The number of the next iteration</li><li><code>is_complete</code>: A flag indicating whether the netwowk has been fully expanded</li><li><code>order</code>: The order of nodes used in computations</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/iterative/lazyinference.jl#L5-L21">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.LazyState-NTuple{4, Any}" href="#Scruff.Algorithms.LazyState-NTuple{4, Any}"><code>Scruff.Algorithms.LazyState</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">LazyState(ns, nd, ni, ic)</code></pre><p>Intantiate <code>LazyState</code> with <code>next_size</code>, <code>next_depth</code>, <code>next_iterator</code>, and <code>is_complete</code>. </p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/iterative/lazyinference.jl#L34-L38">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.LoopyBP" href="#Scruff.Algorithms.LoopyBP"><code>Scruff.Algorithms.LoopyBP</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">LoopyBP</code></pre><p>An instant algorithm that runs loopy belief propagation.</p><p><strong>Arguments</strong></p><ul><li>default<em>range</em>size: The size to use as default when calling <code>support</code> on a node.</li><li>epsilon: The allowable difference between beliefs on successive iterations </li></ul><p>for termination.</p><ul><li>maxiterations: The maximum number of iterations to run. <code>infer</code> will terminate if </li></ul><p>this number of iterations is reached, even if it has not converged.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/instant/loopybp.jl#L5-L16">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.Particles" href="#Scruff.Algorithms.Particles"><code>Scruff.Algorithms.Particles</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Particles</code></pre><p>A structure of particles containing a vector of <code>Samples</code> and of log_weights. </p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/sample_utils.jl#L18-L22">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.Query" href="#Scruff.Algorithms.Query"><code>Scruff.Algorithms.Query</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type Query end</code></pre><p>General type of query that can be answered after running an algorithm.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/query.jl#L19-L23">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.Sample" href="#Scruff.Algorithms.Sample"><code>Scruff.Algorithms.Sample</code></a> — <span class="docstring-category">Type</span></header><section><div><p>Sample = Dict{Symbol, Any}</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/sample_utils.jl#L15">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.ThreePassBP" href="#Scruff.Algorithms.ThreePassBP"><code>Scruff.Algorithms.ThreePassBP</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">ThreePassBP
+Algorithm that runs once on an `InstantNetwork`.</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/instant/instantalgorithm.jl#L5-L9">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.IterativeAlgorithm" href="#Scruff.Algorithms.IterativeAlgorithm"><code>Scruff.Algorithms.IterativeAlgorithm</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type IterativeAlgorithm &lt;: InstantAlgorithm</code></pre><p>Algorithm that runs iteratively on an <code>InstantNetwork</code>.</p><p>The algorithm should support two methods: <code>prepare</code> and <code>refine</code>.</p><p>An IterativeAlgorithm is also trivially an InstantAlgorithm where <code>Infer</code> is implemented by calling <code>prepare</code> and <code>refine</code> once.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/iterative/iterativealgorithm.jl#L6-L15">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.IterativeSampler" href="#Scruff.Algorithms.IterativeSampler"><code>Scruff.Algorithms.IterativeSampler</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct IterativeSampler &lt;: IterativeAlgorithm</code></pre><p>An iterative algorithm that uses a sampler to accumulate more samples on each refinement.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/iterative/iterativesampler.jl#L4-L8">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.LazyInference" href="#Scruff.Algorithms.LazyInference"><code>Scruff.Algorithms.LazyInference</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct LazyInference &lt;: IterativeAlgorithm</code></pre><p>An iterative algorithm that expands recursively and increases the ranges of instances on every iteration.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/iterative/lazyinference.jl#L41-L45">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.LazyState" href="#Scruff.Algorithms.LazyState"><code>Scruff.Algorithms.LazyState</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">mutable struct LazyState</code></pre><p>Maintains the state of a lazy algorithm</p><p><strong>Fields</strong></p><ul><li><code>previous_algorithm</code>: The last instant algorithm used, if any</li><li><code>evidence</code>: The evidence supplied in <code>prepare</code></li><li><code>interventions</code>: The interventions supplied in <code>prepare</code></li><li><code>placeholder_beliefs</code>: The placeholder beliefs supplied in <code>prepare</code></li><li><code>next_size</code>: The range size to use in the next call to <code>refine</code></li><li><code>next_depth</code>: The depth to use in the next call to <code>refine</code></li><li><code>next_iteration</code>: The number of the next iteration</li><li><code>is_complete</code>: A flag indicating whether the netwowk has been fully expanded</li><li><code>order</code>: The order of nodes used in computations</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/iterative/lazyinference.jl#L5-L21">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.LazyState-NTuple{4, Any}" href="#Scruff.Algorithms.LazyState-NTuple{4, Any}"><code>Scruff.Algorithms.LazyState</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">LazyState(ns, nd, ni, ic)</code></pre><p>Intantiate <code>LazyState</code> with <code>next_size</code>, <code>next_depth</code>, <code>next_iterator</code>, and <code>is_complete</code>. </p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/iterative/lazyinference.jl#L34-L38">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.LoopyBP" href="#Scruff.Algorithms.LoopyBP"><code>Scruff.Algorithms.LoopyBP</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">LoopyBP</code></pre><p>An instant algorithm that runs loopy belief propagation.</p><p><strong>Arguments</strong></p><ul><li>default<em>range</em>size: The size to use as default when calling <code>support</code> on a node.</li><li>epsilon: The allowable difference between beliefs on successive iterations </li></ul><p>for termination.</p><ul><li>maxiterations: The maximum number of iterations to run. <code>infer</code> will terminate if </li></ul><p>this number of iterations is reached, even if it has not converged.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/instant/loopybp.jl#L5-L16">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.Particles" href="#Scruff.Algorithms.Particles"><code>Scruff.Algorithms.Particles</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Particles</code></pre><p>A structure of particles containing a vector of <code>Samples</code> and of log_weights. </p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/sample_utils.jl#L18-L22">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.Query" href="#Scruff.Algorithms.Query"><code>Scruff.Algorithms.Query</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type Query end</code></pre><p>General type of query that can be answered after running an algorithm.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/query.jl#L19-L23">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.Sample" href="#Scruff.Algorithms.Sample"><code>Scruff.Algorithms.Sample</code></a> — <span class="docstring-category">Type</span></header><section><div><p>Sample = Dict{Symbol, Any}</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/sample_utils.jl#L15">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.ThreePassBP" href="#Scruff.Algorithms.ThreePassBP"><code>Scruff.Algorithms.ThreePassBP</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">ThreePassBP
 
-An instant algorithm that runs three passes of belief propagation.</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/instant/threepassbp.jl#L7-L11">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.VE" href="#Scruff.Algorithms.VE"><code>Scruff.Algorithms.VE</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">VE(query_vars::Vector{Variable})</code></pre><p>An instant algorithm that runs variable elimination.</p><p><strong>Arguments</strong></p><ul><li>network</li><li><code>query_vars</code>: The variables to query, which are not eliminated</li><li>depth: A depth of 1 means not to expand expanders, otherwise expands recursively to the given depth</li><li>bounds: If true, return lower and upper bounds factors, otherwise just return a single factor</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/instant/ve.jl#L9-L19">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.WindowFilter" href="#Scruff.Algorithms.WindowFilter"><code>Scruff.Algorithms.WindowFilter</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct WindowFilter &lt;: Filter
+An instant algorithm that runs three passes of belief propagation.</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/instant/threepassbp.jl#L7-L11">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.VE" href="#Scruff.Algorithms.VE"><code>Scruff.Algorithms.VE</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">VE(query_vars::Vector{Variable})</code></pre><p>An instant algorithm that runs variable elimination.</p><p><strong>Arguments</strong></p><ul><li>network</li><li><code>query_vars</code>: The variables to query, which are not eliminated</li><li>depth: A depth of 1 means not to expand expanders, otherwise expands recursively to the given depth</li><li>bounds: If true, return lower and upper bounds factors, otherwise just return a single factor</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/instant/ve.jl#L9-L19">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.WindowFilter" href="#Scruff.Algorithms.WindowFilter"><code>Scruff.Algorithms.WindowFilter</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct WindowFilter &lt;: Filter
 
-General construction for a filter based on a flexible windowing scheme.</code></pre><p>#arguments     window<em>creator Defines the method used to create windows     inference</em>algorithm Defines the algorithm to use on a window     postprocess! A postprocessing function, that takes the runtime and does any additional processing needed to carry to the next iteration. Defaults to doing nothing.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/filtering/windowfilter.jl#L7-L17">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.AsyncBP" href="#Scruff.Algorithms.AsyncBP"><code>Scruff.Algorithms.AsyncBP</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">AsyncBP(range_size = 10, T = Float64)</code></pre><p>A window filter that uses an asynchronous window with ThreePassBP with the given range size. <code>T</code> represents the time type and must be the same as used in creation of the runtime.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/filtering/bpfilter.jl#L13-L18">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.AsyncLoopy" href="#Scruff.Algorithms.AsyncLoopy"><code>Scruff.Algorithms.AsyncLoopy</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">AsyncLoopy(range_size = 10, T = Float64)</code></pre><p>A window filter that uses an asynchronous window with LoopyBP with the given range size. <code>T</code> represents the time type and must be the same as used in creation of the runtime.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/filtering/loopyfilter.jl#L13-L18">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.AsyncPF" href="#Scruff.Algorithms.AsyncPF"><code>Scruff.Algorithms.AsyncPF</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">AsyncPF(num_particles::Int, resampling_size::Int = num_particles, T = Float64)</code></pre><p>A particle filter that uses an asynchronous window with the given number of particles and resampling buffer size. <code>T</code> represents the time type and must be the same as used in creation of the runtime.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/filtering/particlefilter.jl#L24-L29">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.CoherentBP" href="#Scruff.Algorithms.CoherentBP"><code>Scruff.Algorithms.CoherentBP</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">CoherentBP(range_size = 10, T = Float64)</code></pre><p>A window filter that uses a coherent window with ThreePassBP with the given range size. <code>T</code> represents the time type and must be the same as used in creation of the runtime.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/filtering/bpfilter.jl#L21-L26">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.CoherentLoopy" href="#Scruff.Algorithms.CoherentLoopy"><code>Scruff.Algorithms.CoherentLoopy</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">CoherentLoopy(range_size = 10, T = Float64)</code></pre><p>A window filter that uses a coherent window with LoopyBP with the given range size. <code>T</code> represents the time type and must be the same as used in creation of the runtime.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/filtering/loopyfilter.jl#L21-L26">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.CoherentPF" href="#Scruff.Algorithms.CoherentPF"><code>Scruff.Algorithms.CoherentPF</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">CoherentPF(num_particles::Int, resampling_size::Int = num_particles, T = Float64)</code></pre><p>A particle filter that uses a coherent window with the given number of particles and resampling buffer size. <code>T</code> represents the time type and must be the same as used in creation of the runtime.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/filtering/particlefilter.jl#L32-L37">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.LSFI-Tuple{Any}" href="#Scruff.Algorithms.LSFI-Tuple{Any}"><code>Scruff.Algorithms.LSFI</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">function LSFI(query_vars; 
-    increment = 10, start_size = increment, max_iterations = 100, start_depth = 1)</code></pre><p>A lazy inference algorithm that uses variable elimination at every step.</p><p><strong>Arguments</strong></p><ul><li><code>query_vars</code>: Variables that can be queried after each <code>refine</code> step</li><li><code>increment</code>: The increment to range size on every iteration</li><li><code>start_size</code>: The starting range size</li><li><code>max_iterations</code>: The maximum number of refinement steps</li><li><code>start_depth</code>: The depth of recursive expansion in the first iteration</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/iterative/lsfi.jl#L4-L16">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.SyncBP" href="#Scruff.Algorithms.SyncBP"><code>Scruff.Algorithms.SyncBP</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">SyncBP(range_size = 10)</code></pre><p>A window filter that uses a synchronous window with ThreePassBP with the given range size.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/filtering/bpfilter.jl#L6-L10">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.SyncLoopy" href="#Scruff.Algorithms.SyncLoopy"><code>Scruff.Algorithms.SyncLoopy</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">SyncLoopy(range_size = 10)</code></pre><p>A window filter that uses a synchronous window with LoopyBP with the given range size.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/filtering/loopyfilter.jl#L6-L10">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.SyncPF" href="#Scruff.Algorithms.SyncPF"><code>Scruff.Algorithms.SyncPF</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">SyncPF(num_particles::Int, resampling_size::Int = num_particles)</code></pre><p>A particle filter that uses a synchronous window with the given number of particles and resampling buffer size.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/filtering/particlefilter.jl#L17-L21">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.answer-Tuple{Scruff.Algorithms.Query, Scruff.Algorithms.Algorithm, Runtime, VariableInstance}" href="#Scruff.Algorithms.answer-Tuple{Scruff.Algorithms.Query, Scruff.Algorithms.Algorithm, Runtime, VariableInstance}"><code>Scruff.Algorithms.answer</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">answer(::Query, ::Algorithm, ::Runtime, ::VariableInstance)
+General construction for a filter based on a flexible windowing scheme.</code></pre><p>#arguments     window<em>creator Defines the method used to create windows     inference</em>algorithm Defines the algorithm to use on a window     postprocess! A postprocessing function, that takes the runtime and does any additional processing needed to carry to the next iteration. Defaults to doing nothing.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/filtering/windowfilter.jl#L7-L17">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.AsyncBP" href="#Scruff.Algorithms.AsyncBP"><code>Scruff.Algorithms.AsyncBP</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">AsyncBP(range_size = 10, T = Float64)</code></pre><p>A window filter that uses an asynchronous window with ThreePassBP with the given range size. <code>T</code> represents the time type and must be the same as used in creation of the runtime.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/filtering/bpfilter.jl#L13-L18">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.AsyncLoopy" href="#Scruff.Algorithms.AsyncLoopy"><code>Scruff.Algorithms.AsyncLoopy</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">AsyncLoopy(range_size = 10, T = Float64)</code></pre><p>A window filter that uses an asynchronous window with LoopyBP with the given range size. <code>T</code> represents the time type and must be the same as used in creation of the runtime.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/filtering/loopyfilter.jl#L13-L18">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.AsyncPF" href="#Scruff.Algorithms.AsyncPF"><code>Scruff.Algorithms.AsyncPF</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">AsyncPF(num_particles::Int, resampling_size::Int = num_particles, T = Float64)</code></pre><p>A particle filter that uses an asynchronous window with the given number of particles and resampling buffer size. <code>T</code> represents the time type and must be the same as used in creation of the runtime.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/filtering/particlefilter.jl#L24-L29">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.CoherentBP" href="#Scruff.Algorithms.CoherentBP"><code>Scruff.Algorithms.CoherentBP</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">CoherentBP(range_size = 10, T = Float64)</code></pre><p>A window filter that uses a coherent window with ThreePassBP with the given range size. <code>T</code> represents the time type and must be the same as used in creation of the runtime.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/filtering/bpfilter.jl#L21-L26">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.CoherentLoopy" href="#Scruff.Algorithms.CoherentLoopy"><code>Scruff.Algorithms.CoherentLoopy</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">CoherentLoopy(range_size = 10, T = Float64)</code></pre><p>A window filter that uses a coherent window with LoopyBP with the given range size. <code>T</code> represents the time type and must be the same as used in creation of the runtime.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/filtering/loopyfilter.jl#L21-L26">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.CoherentPF" href="#Scruff.Algorithms.CoherentPF"><code>Scruff.Algorithms.CoherentPF</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">CoherentPF(num_particles::Int, resampling_size::Int = num_particles, T = Float64)</code></pre><p>A particle filter that uses a coherent window with the given number of particles and resampling buffer size. <code>T</code> represents the time type and must be the same as used in creation of the runtime.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/filtering/particlefilter.jl#L32-L37">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.LSFI-Tuple{Any}" href="#Scruff.Algorithms.LSFI-Tuple{Any}"><code>Scruff.Algorithms.LSFI</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">function LSFI(query_vars; 
+    increment = 10, start_size = increment, max_iterations = 100, start_depth = 1)</code></pre><p>A lazy inference algorithm that uses variable elimination at every step.</p><p><strong>Arguments</strong></p><ul><li><code>query_vars</code>: Variables that can be queried after each <code>refine</code> step</li><li><code>increment</code>: The increment to range size on every iteration</li><li><code>start_size</code>: The starting range size</li><li><code>max_iterations</code>: The maximum number of refinement steps</li><li><code>start_depth</code>: The depth of recursive expansion in the first iteration</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/iterative/lsfi.jl#L4-L16">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.SyncBP" href="#Scruff.Algorithms.SyncBP"><code>Scruff.Algorithms.SyncBP</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">SyncBP(range_size = 10)</code></pre><p>A window filter that uses a synchronous window with ThreePassBP with the given range size.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/filtering/bpfilter.jl#L6-L10">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.SyncLoopy" href="#Scruff.Algorithms.SyncLoopy"><code>Scruff.Algorithms.SyncLoopy</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">SyncLoopy(range_size = 10)</code></pre><p>A window filter that uses a synchronous window with LoopyBP with the given range size.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/filtering/loopyfilter.jl#L6-L10">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.SyncPF" href="#Scruff.Algorithms.SyncPF"><code>Scruff.Algorithms.SyncPF</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">SyncPF(num_particles::Int, resampling_size::Int = num_particles)</code></pre><p>A particle filter that uses a synchronous window with the given number of particles and resampling buffer size.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/filtering/particlefilter.jl#L17-L21">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.answer-Tuple{Scruff.Algorithms.Query, Scruff.Algorithms.Algorithm, Runtime, VariableInstance}" href="#Scruff.Algorithms.answer-Tuple{Scruff.Algorithms.Query, Scruff.Algorithms.Algorithm, Runtime, VariableInstance}"><code>Scruff.Algorithms.answer</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">answer(::Query, ::Algorithm, ::Runtime, ::VariableInstance)
 answer(::Query, ::Algorithm, ::Runtime, ::Vector{VariableInstance})
 answer(::Query, ::Algorithm, ::Runtime, ::Queryable)
 answer(::Query, ::Algorithm, ::Runtime, ::Vector{Queryable})
@@ -30,16 +30,16 @@
 Default implementations are provided that delegate to the instance-specific methods.
 
 Defining a very high-level default implementation that throws an error enables implementations
-to go through sequences of preferences.</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/query.jl#L43-L69">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.create_window-Tuple{Scruff.Algorithms.SyncWindow, Runtime, Vector{&lt;:Variable}, Int64}" href="#Scruff.Algorithms.create_window-Tuple{Scruff.Algorithms.SyncWindow, Runtime, Vector{&lt;:Variable}, Int64}"><code>Scruff.Algorithms.create_window</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">create_window(::SyncWindow, runtime::Runtime, variables::Vector{&lt;:Variable}, time::Int)::Vector{Instance}</code></pre><p>Creates a window by instantiating all variables at all intermediate time steps from the earliest parent to the given time. The <code>variables</code> argument is ignored.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/filtering/windowcreator.jl#L22-L27">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.dynamic_name_and_time" href="#Scruff.Algorithms.dynamic_name_and_time"><code>Scruff.Algorithms.dynamic_name_and_time</code></a> — <span class="docstring-category">Function</span></header><section><div><p>Create a dynamic name and time from an instant node. T is the time type.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/filtering/windowutils.jl#L16-L18">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.effective_sample_size-Tuple{Vector{Float64}}" href="#Scruff.Algorithms.effective_sample_size-Tuple{Vector{Float64}}"><code>Scruff.Algorithms.effective_sample_size</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">expected_sample_size(log_weights::Vector{Float64})</code></pre><p>Effective sample size</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/sample_utils.jl#L68-L72">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.expectation-Tuple{Scruff.Algorithms.Algorithm, Runtime, Union{Variable{I, J, O}, VariableInstance{O}} where {O, I, J}, Function}" href="#Scruff.Algorithms.expectation-Tuple{Scruff.Algorithms.Algorithm, Runtime, Union{Variable{I, J, O}, VariableInstance{O}} where {O, I, J}, Function}"><code>Scruff.Algorithms.expectation</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">expectation(alg::Algorithm, runtime::Runtime, item::Queryable, f::Function)::Float64</code></pre><p>Return the expectation of the function <code>f</code> over the marginal distribution of <code>item</code>.</p><p>The default implementation uses the expectation operation on the SFunc representing the marginal distribution.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/query.jl#L205-L212">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.filter_step-Union{Tuple{T}, Tuple{Scruff.Algorithms.Filter, DynamicRuntime{T}, Vector{&lt;:Variable}, T, Dict{Symbol, Score}}} where T" href="#Scruff.Algorithms.filter_step-Union{Tuple{T}, Tuple{Scruff.Algorithms.Filter, DynamicRuntime{T}, Vector{&lt;:Variable}, T, Dict{Symbol, Score}}} where T"><code>Scruff.Algorithms.filter_step</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">filter_step(filter::Filter, runtime::Runtime, variables::Vector{Variable}, time::T, evidence::Dict{Symbol, Score})</code></pre><p>Run one step of the filter by instantiating the given variables at the given time and passing in the given evidence.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/filtering/filter.jl#L22-L26">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.init_filter!-Tuple{Scruff.Algorithms.Filter, DynamicRuntime}" href="#Scruff.Algorithms.init_filter!-Tuple{Scruff.Algorithms.Filter, DynamicRuntime}"><code>Scruff.Algorithms.init_filter!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">init_filter!(::Filter, ::DynamicRuntime)</code></pre><p>An interface for intializing the filter for a dynamic runtime.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/filtering/filter.jl#L15-L19">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.initial_instant_runtime-Tuple{DynamicRuntime}" href="#Scruff.Algorithms.initial_instant_runtime-Tuple{DynamicRuntime}"><code>Scruff.Algorithms.initial_instant_runtime</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">Creates an instant runtime for the first time step.</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/filtering/windowutils.jl#L128-L130">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.instant_name-Tuple{Symbol, Number}" href="#Scruff.Algorithms.instant_name-Tuple{Symbol, Number}"><code>Scruff.Algorithms.instant_name</code></a> — <span class="docstring-category">Method</span></header><section><div><p>Create a name in an instant network corresponding to the given dynamic name and time.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/filtering/windowutils.jl#L9-L11">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.instant_node-Tuple{VariableInstance}" href="#Scruff.Algorithms.instant_node-Tuple{VariableInstance}"><code>Scruff.Algorithms.instant_node</code></a> — <span class="docstring-category">Method</span></header><section><div><p>Create an instant node from a dynamic variable instance.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/filtering/windowutils.jl#L34-L36">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.instant_node-Union{Tuple{PlaceholderInstance{O}}, Tuple{O}} where O" href="#Scruff.Algorithms.instant_node-Union{Tuple{PlaceholderInstance{O}}, Tuple{O}} where O"><code>Scruff.Algorithms.instant_node</code></a> — <span class="docstring-category">Method</span></header><section><div><p>Create an instant node from a dynamic placeholder instance.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/filtering/windowutils.jl#L44-L46">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.instant_runtime_from_instances-Tuple{DynamicRuntime, Vector{Instance}}" href="#Scruff.Algorithms.instant_runtime_from_instances-Tuple{DynamicRuntime, Vector{Instance}}"><code>Scruff.Algorithms.instant_runtime_from_instances</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">instant_runtime_from_instances(runtime::DynamicRuntime, instances::Vector{Instance})</code></pre><p>Create an instant runtime from the given instances in the given dynamic runtime.</p><p>This runtime has an instant network that contains a variable for each instance in <code>insts</code>,  tagged with the time of the instance. The network also contains a placeholder for each instance in <code>placeholder_insts</code>. The function also instantiates the variables in the instant runtime and stores any runtime  values from the dynamic runtime with the corresponding instances in the instant runtime. This function is useful for running instant algorithms on a time window  for dynamic reasoning.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/filtering/windowutils.jl#L54-L66">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.joint-Tuple{Scruff.Algorithms.Algorithm, Runtime, Vector{Union{Variable{I, J, O}, VariableInstance{O}} where {O, I, J}}}" href="#Scruff.Algorithms.joint-Tuple{Scruff.Algorithms.Algorithm, Runtime, Vector{Union{Variable{I, J, O}, VariableInstance{O}} where {O, I, J}}}"><code>Scruff.Algorithms.joint</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">joint(alg::Algorithm, run::Runtime, items::Vector{Queryable})::Union{Score{O}, Tuple{Score{O}, Score{O}}}</code></pre><p>Return the joint distribution over <code>items</code>, or lower and upper distributions, depending on the algorithm.</p><p>The returned <code>Score</code> assigns a score for each Vector of values of the items.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/query.jl#L109-L116">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.lw_proposal-Tuple{Runtime, VariableInstance}" href="#Scruff.Algorithms.lw_proposal-Tuple{Runtime, VariableInstance}"><code>Scruff.Algorithms.lw_proposal</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">lw_proposal(runtime::Runtime, instance::VariableInstance, parent_values::Tuple)</code></pre><p>Return a proposer and scorer to implement likelihood weighting.</p><p>This proposal scheme is the same as the prior proposal unless a variable has hard evidence. In the case of hard evidence, the proposer sets the value of the variable to the evidence value and scores it by the log conditional probability of the evidence given the parent values.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/instant/importance.jl#L86-L95">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.make_custom_proposal-Tuple{Dict{Symbol, SFunc}}" href="#Scruff.Algorithms.make_custom_proposal-Tuple{Dict{Symbol, SFunc}}"><code>Scruff.Algorithms.make_custom_proposal</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">make_custom_proposal(custom_sfs::Dict{Symbol, SFunc})</code></pre><p>Create a proposal function for a custom proposal scheme.</p><p>Returns a proposal function that can be provided to the Importance constructor. Evidence is handled similar to <code>lw</code>, except that the custom proposal is used for soft evidence.</p><p><strong>Arguments</strong></p><ul><li>custom_sfs A dictionary mapping variable names to custom sfuncs used for their proposal.</li></ul><p>Need not be complete; if a variable is not in this dictionary, its standard sfunc will be used.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/instant/importance.jl#L112-L125">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.marginal-Tuple{Scruff.Algorithms.Particles, Symbol}" href="#Scruff.Algorithms.marginal-Tuple{Scruff.Algorithms.Particles, Symbol}"><code>Scruff.Algorithms.marginal</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">marginal(parts::Particles, x::Symbol)::Cat</code></pre><p>Returns a Cat representing the marginal distribution over the given symbol according to parts</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/sample_utils.jl#L47-L51">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.marginal-Union{Tuple{O}, Tuple{Scruff.Algorithms.Algorithm, Runtime, Union{Variable{I, J, O}, VariableInstance{O}} where {I, J}}} where O" href="#Scruff.Algorithms.marginal-Union{Tuple{O}, Tuple{Scruff.Algorithms.Algorithm, Runtime, Union{Variable{I, J, O}, VariableInstance{O}} where {I, J}}} where O"><code>Scruff.Algorithms.marginal</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">marginal(alg::Algorithm, runtime::Runtime, item::Queryable{O})::Union{Dist{O}, Tuple{Dist{O}, Dist{O}}} where O</code></pre><p>Return the marginal distribution over <code>item</code>, or lower and upper marginals, depending on the algorithm.</p><p>The returned <code>Score</code> assigns a score to each value of <code>item</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/query.jl#L94-L101">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.mean-Union{Tuple{O}, Tuple{Scruff.Algorithms.Algorithm, Runtime, Union{Variable{I, J, O}, VariableInstance{O}} where {I, J}}} where O&lt;:Number" href="#Scruff.Algorithms.mean-Union{Tuple{O}, Tuple{Scruff.Algorithms.Algorithm, Runtime, Union{Variable{I, J, O}, VariableInstance{O}} where {I, J}}} where O&lt;:Number"><code>Scruff.Algorithms.mean</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">mean(alg::Algorithm, runtime::Runtime, item::Queryable)</code></pre><p>Return the mean of <code>item</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/query.jl#L237-L241">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.normalize_weights-Tuple{Vector{Float64}}" href="#Scruff.Algorithms.normalize_weights-Tuple{Vector{Float64}}"><code>Scruff.Algorithms.normalize_weights</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">normalize_weights(log_weights::Vector{Float64})</code></pre><p>Normalize weights</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/sample_utils.jl#L78-L82">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.prepare-Tuple{Scruff.Algorithms.InstantAlgorithm, InstantRuntime, Vector{&lt;:SFunc{Tuple{}}}, Vector{Tuple{Symbol, Score}}, Vector{Tuple{Symbol, SFunc{Tuple{}}}}}" href="#Scruff.Algorithms.prepare-Tuple{Scruff.Algorithms.InstantAlgorithm, InstantRuntime, Vector{&lt;:SFunc{Tuple{}}}, Vector{Tuple{Symbol, Score}}, Vector{Tuple{Symbol, SFunc{Tuple{}}}}}"><code>Scruff.Algorithms.prepare</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">prepare(algorithm::IterativeAlgorithm, runtime::InstantRuntime
+to go through sequences of preferences.</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/query.jl#L43-L69">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.create_window-Tuple{Scruff.Algorithms.SyncWindow, Runtime, Vector{&lt;:Variable}, Int64}" href="#Scruff.Algorithms.create_window-Tuple{Scruff.Algorithms.SyncWindow, Runtime, Vector{&lt;:Variable}, Int64}"><code>Scruff.Algorithms.create_window</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">create_window(::SyncWindow, runtime::Runtime, variables::Vector{&lt;:Variable}, time::Int)::Vector{Instance}</code></pre><p>Creates a window by instantiating all variables at all intermediate time steps from the earliest parent to the given time. The <code>variables</code> argument is ignored.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/filtering/windowcreator.jl#L22-L27">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.dynamic_name_and_time" href="#Scruff.Algorithms.dynamic_name_and_time"><code>Scruff.Algorithms.dynamic_name_and_time</code></a> — <span class="docstring-category">Function</span></header><section><div><p>Create a dynamic name and time from an instant node. T is the time type.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/filtering/windowutils.jl#L16-L18">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.effective_sample_size-Tuple{Vector{Float64}}" href="#Scruff.Algorithms.effective_sample_size-Tuple{Vector{Float64}}"><code>Scruff.Algorithms.effective_sample_size</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">expected_sample_size(log_weights::Vector{Float64})</code></pre><p>Effective sample size</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/sample_utils.jl#L68-L72">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.expectation-Tuple{Scruff.Algorithms.Algorithm, Runtime, Union{Variable{I, J, O}, VariableInstance{O}} where {O, I, J}, Function}" href="#Scruff.Algorithms.expectation-Tuple{Scruff.Algorithms.Algorithm, Runtime, Union{Variable{I, J, O}, VariableInstance{O}} where {O, I, J}, Function}"><code>Scruff.Algorithms.expectation</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">expectation(alg::Algorithm, runtime::Runtime, item::Queryable, f::Function)::Float64</code></pre><p>Return the expectation of the function <code>f</code> over the marginal distribution of <code>item</code>.</p><p>The default implementation uses the expectation operation on the SFunc representing the marginal distribution.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/query.jl#L205-L212">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.filter_step-Union{Tuple{T}, Tuple{Scruff.Algorithms.Filter, DynamicRuntime{T}, Vector{&lt;:Variable}, T, Dict{Symbol, Score}}} where T" href="#Scruff.Algorithms.filter_step-Union{Tuple{T}, Tuple{Scruff.Algorithms.Filter, DynamicRuntime{T}, Vector{&lt;:Variable}, T, Dict{Symbol, Score}}} where T"><code>Scruff.Algorithms.filter_step</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">filter_step(filter::Filter, runtime::Runtime, variables::Vector{Variable}, time::T, evidence::Dict{Symbol, Score})</code></pre><p>Run one step of the filter by instantiating the given variables at the given time and passing in the given evidence.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/filtering/filter.jl#L22-L26">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.init_filter!-Tuple{Scruff.Algorithms.Filter, DynamicRuntime}" href="#Scruff.Algorithms.init_filter!-Tuple{Scruff.Algorithms.Filter, DynamicRuntime}"><code>Scruff.Algorithms.init_filter!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">init_filter!(::Filter, ::DynamicRuntime)</code></pre><p>An interface for intializing the filter for a dynamic runtime.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/filtering/filter.jl#L15-L19">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.initial_instant_runtime-Tuple{DynamicRuntime}" href="#Scruff.Algorithms.initial_instant_runtime-Tuple{DynamicRuntime}"><code>Scruff.Algorithms.initial_instant_runtime</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">Creates an instant runtime for the first time step.</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/filtering/windowutils.jl#L128-L130">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.instant_name-Tuple{Symbol, Number}" href="#Scruff.Algorithms.instant_name-Tuple{Symbol, Number}"><code>Scruff.Algorithms.instant_name</code></a> — <span class="docstring-category">Method</span></header><section><div><p>Create a name in an instant network corresponding to the given dynamic name and time.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/filtering/windowutils.jl#L9-L11">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.instant_node-Tuple{VariableInstance}" href="#Scruff.Algorithms.instant_node-Tuple{VariableInstance}"><code>Scruff.Algorithms.instant_node</code></a> — <span class="docstring-category">Method</span></header><section><div><p>Create an instant node from a dynamic variable instance.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/filtering/windowutils.jl#L34-L36">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.instant_node-Union{Tuple{PlaceholderInstance{O}}, Tuple{O}} where O" href="#Scruff.Algorithms.instant_node-Union{Tuple{PlaceholderInstance{O}}, Tuple{O}} where O"><code>Scruff.Algorithms.instant_node</code></a> — <span class="docstring-category">Method</span></header><section><div><p>Create an instant node from a dynamic placeholder instance.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/filtering/windowutils.jl#L44-L46">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.instant_runtime_from_instances-Tuple{DynamicRuntime, Vector{Instance}}" href="#Scruff.Algorithms.instant_runtime_from_instances-Tuple{DynamicRuntime, Vector{Instance}}"><code>Scruff.Algorithms.instant_runtime_from_instances</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">instant_runtime_from_instances(runtime::DynamicRuntime, instances::Vector{Instance})</code></pre><p>Create an instant runtime from the given instances in the given dynamic runtime.</p><p>This runtime has an instant network that contains a variable for each instance in <code>insts</code>,  tagged with the time of the instance. The network also contains a placeholder for each instance in <code>placeholder_insts</code>. The function also instantiates the variables in the instant runtime and stores any runtime  values from the dynamic runtime with the corresponding instances in the instant runtime. This function is useful for running instant algorithms on a time window  for dynamic reasoning.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/filtering/windowutils.jl#L54-L66">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.joint-Tuple{Scruff.Algorithms.Algorithm, Runtime, Vector{Union{Variable{I, J, O}, VariableInstance{O}} where {O, I, J}}}" href="#Scruff.Algorithms.joint-Tuple{Scruff.Algorithms.Algorithm, Runtime, Vector{Union{Variable{I, J, O}, VariableInstance{O}} where {O, I, J}}}"><code>Scruff.Algorithms.joint</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">joint(alg::Algorithm, run::Runtime, items::Vector{Queryable})::Union{Score{O}, Tuple{Score{O}, Score{O}}}</code></pre><p>Return the joint distribution over <code>items</code>, or lower and upper distributions, depending on the algorithm.</p><p>The returned <code>Score</code> assigns a score for each Vector of values of the items.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/query.jl#L109-L116">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.lw_proposal-Tuple{Runtime, VariableInstance}" href="#Scruff.Algorithms.lw_proposal-Tuple{Runtime, VariableInstance}"><code>Scruff.Algorithms.lw_proposal</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">lw_proposal(runtime::Runtime, instance::VariableInstance, parent_values::Tuple)</code></pre><p>Return a proposer and scorer to implement likelihood weighting.</p><p>This proposal scheme is the same as the prior proposal unless a variable has hard evidence. In the case of hard evidence, the proposer sets the value of the variable to the evidence value and scores it by the log conditional probability of the evidence given the parent values.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/instant/importance.jl#L86-L95">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.make_custom_proposal-Tuple{Dict{Symbol, SFunc}}" href="#Scruff.Algorithms.make_custom_proposal-Tuple{Dict{Symbol, SFunc}}"><code>Scruff.Algorithms.make_custom_proposal</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">make_custom_proposal(custom_sfs::Dict{Symbol, SFunc})</code></pre><p>Create a proposal function for a custom proposal scheme.</p><p>Returns a proposal function that can be provided to the Importance constructor. Evidence is handled similar to <code>lw</code>, except that the custom proposal is used for soft evidence.</p><p><strong>Arguments</strong></p><ul><li>custom_sfs A dictionary mapping variable names to custom sfuncs used for their proposal.</li></ul><p>Need not be complete; if a variable is not in this dictionary, its standard sfunc will be used.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/instant/importance.jl#L112-L125">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.marginal-Tuple{Scruff.Algorithms.Particles, Symbol}" href="#Scruff.Algorithms.marginal-Tuple{Scruff.Algorithms.Particles, Symbol}"><code>Scruff.Algorithms.marginal</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">marginal(parts::Particles, x::Symbol)::Cat</code></pre><p>Returns a Cat representing the marginal distribution over the given symbol according to parts</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/sample_utils.jl#L47-L51">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.marginal-Union{Tuple{O}, Tuple{Scruff.Algorithms.Algorithm, Runtime, Union{Variable{I, J, O}, VariableInstance{O}} where {I, J}}} where O" href="#Scruff.Algorithms.marginal-Union{Tuple{O}, Tuple{Scruff.Algorithms.Algorithm, Runtime, Union{Variable{I, J, O}, VariableInstance{O}} where {I, J}}} where O"><code>Scruff.Algorithms.marginal</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">marginal(alg::Algorithm, runtime::Runtime, item::Queryable{O})::Union{Dist{O}, Tuple{Dist{O}, Dist{O}}} where O</code></pre><p>Return the marginal distribution over <code>item</code>, or lower and upper marginals, depending on the algorithm.</p><p>The returned <code>Score</code> assigns a score to each value of <code>item</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/query.jl#L94-L101">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.mean-Union{Tuple{O}, Tuple{Scruff.Algorithms.Algorithm, Runtime, Union{Variable{I, J, O}, VariableInstance{O}} where {I, J}}} where O&lt;:Number" href="#Scruff.Algorithms.mean-Union{Tuple{O}, Tuple{Scruff.Algorithms.Algorithm, Runtime, Union{Variable{I, J, O}, VariableInstance{O}} where {I, J}}} where O&lt;:Number"><code>Scruff.Algorithms.mean</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">mean(alg::Algorithm, runtime::Runtime, item::Queryable)</code></pre><p>Return the mean of <code>item</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/query.jl#L237-L241">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.normalize_weights-Tuple{Vector{Float64}}" href="#Scruff.Algorithms.normalize_weights-Tuple{Vector{Float64}}"><code>Scruff.Algorithms.normalize_weights</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">normalize_weights(log_weights::Vector{Float64})</code></pre><p>Normalize weights</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/sample_utils.jl#L78-L82">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.prepare-Tuple{Scruff.Algorithms.InstantAlgorithm, InstantRuntime, Vector{&lt;:SFunc{Tuple{}}}, Vector{Tuple{Symbol, Score}}, Vector{Tuple{Symbol, SFunc{Tuple{}}}}}" href="#Scruff.Algorithms.prepare-Tuple{Scruff.Algorithms.InstantAlgorithm, InstantRuntime, Vector{&lt;:SFunc{Tuple{}}}, Vector{Tuple{Symbol, Score}}, Vector{Tuple{Symbol, SFunc{Tuple{}}}}}"><code>Scruff.Algorithms.prepare</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">prepare(algorithm::IterativeAlgorithm, runtime::InstantRuntime
     evidence::Dict{Symbol, &lt;:Score}, 
     interventions::Dict{Symbol, &lt;:Dist},
-    placeholder_beliefs::Dict{Symbol, &lt;:Dist})</code></pre><p>Prepare the inference algorithm for iteration.</p><p>Stores the algorithm state in <code>runtime</code>. </p><p><strong>Arguments</strong></p><ul><li><code>algorithm</code>: The iterative algorithm to run.</li><li><code>runtime</code>: The runtime in which to run the algorithm.</li><li><code>evidence</code>: The supplied evidence, which defaults to <code>Dict()</code>. </li><li><code>interventions</code>: The supplied interventions, which defaults to <code>Dict()</code>. </li><li><code>placeholder_beliefs</code>: The beliefs associated with the placeholders in the </li></ul><p>network, which default to <code>Dict()</code>. </p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/iterative/iterativealgorithm.jl#L18-L35">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.probability-Tuple{Scruff.Algorithms.Algorithm, Runtime, Vector{Union{Variable{I, J, O}, VariableInstance{O}} where {O, I, J}}, Function}" href="#Scruff.Algorithms.probability-Tuple{Scruff.Algorithms.Algorithm, Runtime, Vector{Union{Variable{I, J, O}, VariableInstance{O}} where {O, I, J}}, Function}"><code>Scruff.Algorithms.probability</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">probability(alg::Algorithm, run::Runtime, items::Vector{Queryable}, predicate::Function)::Union{Float64, Tuple{Float64, Float64}}</code></pre><p>Return the probability that <code>items</code> satisfy <code>query</code> or lower and upper probabilities.</p><p><code>predicate</code> is a function from Vector{Any} to <code>Bool</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/query.jl#L129-L135">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.probability-Tuple{Scruff.Algorithms.Particles, Function}" href="#Scruff.Algorithms.probability-Tuple{Scruff.Algorithms.Particles, Function}"><code>Scruff.Algorithms.probability</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">probability(parts::Particles, predicate::Sample -&gt; Bool)::Float64
+    placeholder_beliefs::Dict{Symbol, &lt;:Dist})</code></pre><p>Prepare the inference algorithm for iteration.</p><p>Stores the algorithm state in <code>runtime</code>. </p><p><strong>Arguments</strong></p><ul><li><code>algorithm</code>: The iterative algorithm to run.</li><li><code>runtime</code>: The runtime in which to run the algorithm.</li><li><code>evidence</code>: The supplied evidence, which defaults to <code>Dict()</code>. </li><li><code>interventions</code>: The supplied interventions, which defaults to <code>Dict()</code>. </li><li><code>placeholder_beliefs</code>: The beliefs associated with the placeholders in the </li></ul><p>network, which default to <code>Dict()</code>. </p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/iterative/iterativealgorithm.jl#L18-L35">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.probability-Tuple{Scruff.Algorithms.Algorithm, Runtime, Vector{Union{Variable{I, J, O}, VariableInstance{O}} where {O, I, J}}, Function}" href="#Scruff.Algorithms.probability-Tuple{Scruff.Algorithms.Algorithm, Runtime, Vector{Union{Variable{I, J, O}, VariableInstance{O}} where {O, I, J}}, Function}"><code>Scruff.Algorithms.probability</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">probability(alg::Algorithm, run::Runtime, items::Vector{Queryable}, predicate::Function)::Union{Float64, Tuple{Float64, Float64}}</code></pre><p>Return the probability that <code>items</code> satisfy <code>query</code> or lower and upper probabilities.</p><p><code>predicate</code> is a function from Vector{Any} to <code>Bool</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/query.jl#L129-L135">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.probability-Tuple{Scruff.Algorithms.Particles, Function}" href="#Scruff.Algorithms.probability-Tuple{Scruff.Algorithms.Particles, Function}"><code>Scruff.Algorithms.probability</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">probability(parts::Particles, predicate::Sample -&gt; Bool)::Float64
 
-Returns the probability that the predicate is satisfied</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/sample_utils.jl#L28-L32">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.probability-Union{Tuple{O}, Tuple{Scruff.Algorithms.Algorithm, Runtime, Union{Variable{I, J, O}, VariableInstance{O}} where {I, J}, O}} where O" href="#Scruff.Algorithms.probability-Union{Tuple{O}, Tuple{Scruff.Algorithms.Algorithm, Runtime, Union{Variable{I, J, O}, VariableInstance{O}} where {I, J}, O}} where O"><code>Scruff.Algorithms.probability</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">probability(alg::Algorithm, run::Runtime, item::Queryable{O}, value::O)::Union{Float64, Tuple{Float64, Float64}} where O</code></pre><p>Return the probability that <code>item</code> has <code>value</code> or lower and upper probabilities.</p><p>The default implementation tries to use the more general probability of a query. If that fails, it uses the <code>cpdf</code> operation on the marginal of <code>item</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/query.jl#L146-L153">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.probability_bounds-Tuple{Scruff.Algorithms.Algorithm, Runtime, Union{Variable{I, J, O}, VariableInstance{O}} where {O, I, J}, Vector}" href="#Scruff.Algorithms.probability_bounds-Tuple{Scruff.Algorithms.Algorithm, Runtime, Union{Variable{I, J, O}, VariableInstance{O}} where {O, I, J}, Vector}"><code>Scruff.Algorithms.probability_bounds</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">probability_bounds(alg::Algorithm, run::Runtime, item::Queryable, range::Vector)::Tuple{Vector{Float64}, Vector{Float64}}
+Returns the probability that the predicate is satisfied</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/sample_utils.jl#L28-L32">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.probability-Union{Tuple{O}, Tuple{Scruff.Algorithms.Algorithm, Runtime, Union{Variable{I, J, O}, VariableInstance{O}} where {I, J}, O}} where O" href="#Scruff.Algorithms.probability-Union{Tuple{O}, Tuple{Scruff.Algorithms.Algorithm, Runtime, Union{Variable{I, J, O}, VariableInstance{O}} where {I, J}, O}} where O"><code>Scruff.Algorithms.probability</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">probability(alg::Algorithm, run::Runtime, item::Queryable{O}, value::O)::Union{Float64, Tuple{Float64, Float64}} where O</code></pre><p>Return the probability that <code>item</code> has <code>value</code> or lower and upper probabilities.</p><p>The default implementation tries to use the more general probability of a query. If that fails, it uses the <code>cpdf</code> operation on the marginal of <code>item</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/query.jl#L146-L153">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.probability_bounds-Tuple{Scruff.Algorithms.Algorithm, Runtime, Union{Variable{I, J, O}, VariableInstance{O}} where {O, I, J}, Vector}" href="#Scruff.Algorithms.probability_bounds-Tuple{Scruff.Algorithms.Algorithm, Runtime, Union{Variable{I, J, O}, VariableInstance{O}} where {O, I, J}, Vector}"><code>Scruff.Algorithms.probability_bounds</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">probability_bounds(alg::Algorithm, run::Runtime, item::Queryable, range::Vector)::Tuple{Vector{Float64}, Vector{Float64}}
 
 For an algorithm that produces lower and upper bounds, return vectors of lower and upper bounds on probabilities for values in the range.
 
-The range is important for computing the bounds, because it is assumed that values outside the range have probability zero.</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/query.jl#L188-L194">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.refine-Tuple{Scruff.Algorithms.IterativeAlgorithm, InstantRuntime}" href="#Scruff.Algorithms.refine-Tuple{Scruff.Algorithms.IterativeAlgorithm, InstantRuntime}"><code>Scruff.Algorithms.refine</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">refine(algorithm::IterativeAlgorithm, runtime::InstantRuntime)</code></pre><p>Perform the next iteration of the algorithm.</p><p>Uses the algorithm state stored in <code>runtime</code> and stores the next state in <code>runtime</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/iterative/iterativealgorithm.jl#L40-L46">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.rejection_proposal-Tuple{Runtime, VariableInstance}" href="#Scruff.Algorithms.rejection_proposal-Tuple{Runtime, VariableInstance}"><code>Scruff.Algorithms.rejection_proposal</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">rejection_proposal(::Runtime, instance::VariableInstance, parent_values::Tuple)</code></pre><p>Return a proposer and scorer to implement standard rejection sampling from the prior. It proposes a value for the <code>instance</code> from its sfunc, and scores it by the evidence, if any.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/instant/importance.jl#L63-L69">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.retrieve_values_from_instant_runtime!-Union{Tuple{T}, Tuple{DynamicRuntime{T}, InstantRuntime}} where T" href="#Scruff.Algorithms.retrieve_values_from_instant_runtime!-Union{Tuple{T}, Tuple{DynamicRuntime{T}, InstantRuntime}} where T"><code>Scruff.Algorithms.retrieve_values_from_instant_runtime!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">retrieve_values_from_instant_runtime!(dynrun::DynamicRuntime, instrun::InstantRuntime)
+The range is important for computing the bounds, because it is assumed that values outside the range have probability zero.</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/query.jl#L188-L194">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.refine-Tuple{Scruff.Algorithms.IterativeAlgorithm, InstantRuntime}" href="#Scruff.Algorithms.refine-Tuple{Scruff.Algorithms.IterativeAlgorithm, InstantRuntime}"><code>Scruff.Algorithms.refine</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">refine(algorithm::IterativeAlgorithm, runtime::InstantRuntime)</code></pre><p>Perform the next iteration of the algorithm.</p><p>Uses the algorithm state stored in <code>runtime</code> and stores the next state in <code>runtime</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/iterative/iterativealgorithm.jl#L40-L46">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.rejection_proposal-Tuple{Runtime, VariableInstance}" href="#Scruff.Algorithms.rejection_proposal-Tuple{Runtime, VariableInstance}"><code>Scruff.Algorithms.rejection_proposal</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">rejection_proposal(::Runtime, instance::VariableInstance, parent_values::Tuple)</code></pre><p>Return a proposer and scorer to implement standard rejection sampling from the prior. It proposes a value for the <code>instance</code> from its sfunc, and scores it by the evidence, if any.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/instant/importance.jl#L63-L69">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.retrieve_values_from_instant_runtime!-Union{Tuple{T}, Tuple{DynamicRuntime{T}, InstantRuntime}} where T" href="#Scruff.Algorithms.retrieve_values_from_instant_runtime!-Union{Tuple{T}, Tuple{DynamicRuntime{T}, InstantRuntime}} where T"><code>Scruff.Algorithms.retrieve_values_from_instant_runtime!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">retrieve_values_from_instant_runtime!(dynrun::DynamicRuntime, instrun::InstantRuntime)
 
 Retrieve values in a dynamic runtime from an instant runtime constructed
-using `instant_runtime_from_instances`.</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/filtering/windowutils.jl#L163-L168">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.variance-Tuple{Scruff.Algorithms.Algorithm, Runtime, Union{Variable{I, J, O}, VariableInstance{O}} where {O, I, J}}" href="#Scruff.Algorithms.variance-Tuple{Scruff.Algorithms.Algorithm, Runtime, Union{Variable{I, J, O}, VariableInstance{O}} where {O, I, J}}"><code>Scruff.Algorithms.variance</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">variance(alg::Algorithm, runtime::Runtime, item::Queryable)::Float64</code></pre><p>Return the variance of <code>item</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/algorithms/query.jl#L257-L261">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../models/">« Models</a><a class="docs-footer-nextpage" href="../utilities/">Utilities »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Tuesday 7 May 2024 20:00">Tuesday 7 May 2024</span>. Using Julia version 1.7.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+using `instant_runtime_from_instances`.</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/filtering/windowutils.jl#L163-L168">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Algorithms.variance-Tuple{Scruff.Algorithms.Algorithm, Runtime, Union{Variable{I, J, O}, VariableInstance{O}} where {O, I, J}}" href="#Scruff.Algorithms.variance-Tuple{Scruff.Algorithms.Algorithm, Runtime, Union{Variable{I, J, O}, VariableInstance{O}} where {O, I, J}}"><code>Scruff.Algorithms.variance</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">variance(alg::Algorithm, runtime::Runtime, item::Queryable)::Float64</code></pre><p>Return the variance of <code>item</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/algorithms/query.jl#L257-L261">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../models/">« Models</a><a class="docs-footer-nextpage" href="../utilities/">Utilities »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Wednesday 15 May 2024 16:16">Wednesday 15 May 2024</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/dev/lib/core/index.html b/dev/lib/core/index.html
index b6902ce..deb4d22 100644
--- a/dev/lib/core/index.html
+++ b/dev/lib/core/index.html
@@ -1,19 +1,19 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Core · Scruff.jl</title><script data-outdated-warner src="../../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../../assets/documenter.js"></script><script src="../../siteinfo.js"></script><script src="../../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../../">Scruff.jl</a></span></div><form class="docs-search" action="../../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../../">Getting Started</a></li><li><a class="tocitem" href="../../tutorial/tutorial/">Tutorial</a></li><li><a class="tocitem" href="../../tutorial/examples/">Examples</a></li><li><span class="tocitem">Library</span><ul><li class="is-active"><a class="tocitem" href>Core</a></li><li><a class="tocitem" href="../sfuncs/">Stochastic Functions</a></li><li><a class="tocitem" href="../operators/">Operators</a></li><li><a class="tocitem" href="../models/">Models</a></li><li><a class="tocitem" href="../algorithms/">Algorithms</a></li><li><a class="tocitem" href="../utilities/">Utilities</a></li><li><a class="tocitem" href="../rtutils/">Runtime Utilities</a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Library</a></li><li class="is-active"><a href>Core</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Core</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/charles-river-analytics/Scruff.jl/blob/develop/docs/src/lib/core.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="scruff_core"><a class="docs-heading-anchor" href="#scruff_core">Scruff</a><a id="scruff_core-1"></a><a class="docs-heading-anchor-permalink" href="#scruff_core" title="Permalink"></a></h1><article class="docstring"><header><a class="docstring-binding" id="Scruff.BELIEF" href="#Scruff.BELIEF"><code>Scruff.BELIEF</code></a> — <span class="docstring-category">Constant</span></header><section><div><pre><code class="language-julia hljs">BELIEF</code></pre><p>The constant key used to store belief for a specific variable instance</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L567-L571">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.EVIDENCE" href="#Scruff.EVIDENCE"><code>Scruff.EVIDENCE</code></a> — <span class="docstring-category">Constant</span></header><section><div><pre><code class="language-julia hljs">EVIDENCE</code></pre><p>The constant key used to store evidence for a specific variable instance</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L606-L610">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.INTERVENTION" href="#Scruff.INTERVENTION"><code>Scruff.INTERVENTION</code></a> — <span class="docstring-category">Constant</span></header><section><div><pre><code class="language-julia hljs">INTERVENTION</code></pre><p>The constant key used to store interventions for a specific variable instance</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L641-L645">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Node" href="#Scruff.Node"><code>Scruff.Node</code></a> — <span class="docstring-category">Type</span></header><section><div><p><code>Node{O} = Union{Placeholder{O}, Variable{I,J,O} where {I,J}}</code></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/core.jl#L169">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Dist" href="#Scruff.Dist"><code>Scruff.Dist</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Dist{T} = SFunc{Tuple{}, T}</code></pre><p><strong>Additional supported operators</strong></p><ul><li><code>make_factors</code></li><li><code>send_lambda</code></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/core.jl#L75-L81">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.DynamicNetwork" href="#Scruff.DynamicNetwork"><code>Scruff.DynamicNetwork</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">DynamicNetwork{I,J,O} &lt;: Network{I,J,O}</code></pre><p>A network that can transition over time.   See <a href="#Scruff.Network"><code>Network</code></a> for the type parameters.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/core.jl#L320-L325">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.DynamicRuntime" href="#Scruff.DynamicRuntime"><code>Scruff.DynamicRuntime</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct DynamicRuntime &lt;: Runtime</code></pre><p>A runtime that represents a network whose variables take on many instances at different times <code>T</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L213-L217">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Env" href="#Scruff.Env"><code>Scruff.Env</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Env</code></pre><p>Holds all external state of a Runtime.  The <code>Env</code> supports the following methods:</p><pre><code class="nohighlight hljs">get_state(env::Env) :: Dict{Symbol, Any}
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Core · Scruff.jl</title><script data-outdated-warner src="../../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../../assets/documenter.js"></script><script src="../../siteinfo.js"></script><script src="../../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../../">Scruff.jl</a></span></div><form class="docs-search" action="../../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../../">Getting Started</a></li><li><a class="tocitem" href="../../tutorial/tutorial/">Tutorial</a></li><li><a class="tocitem" href="../../tutorial/examples/">Examples</a></li><li><span class="tocitem">Library</span><ul><li class="is-active"><a class="tocitem" href>Core</a></li><li><a class="tocitem" href="../sfuncs/">Stochastic Functions</a></li><li><a class="tocitem" href="../operators/">Operators</a></li><li><a class="tocitem" href="../models/">Models</a></li><li><a class="tocitem" href="../algorithms/">Algorithms</a></li><li><a class="tocitem" href="../utilities/">Utilities</a></li><li><a class="tocitem" href="../rtutils/">Runtime Utilities</a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Library</a></li><li class="is-active"><a href>Core</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Core</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/charles-river-analytics/Scruff.jl/blob/develop/docs/src/lib/core.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="scruff_core"><a class="docs-heading-anchor" href="#scruff_core">Scruff</a><a id="scruff_core-1"></a><a class="docs-heading-anchor-permalink" href="#scruff_core" title="Permalink"></a></h1><article class="docstring"><header><a class="docstring-binding" id="Scruff.BELIEF" href="#Scruff.BELIEF"><code>Scruff.BELIEF</code></a> — <span class="docstring-category">Constant</span></header><section><div><pre><code class="language-julia hljs">BELIEF</code></pre><p>The constant key used to store belief for a specific variable instance</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L567-L571">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.EVIDENCE" href="#Scruff.EVIDENCE"><code>Scruff.EVIDENCE</code></a> — <span class="docstring-category">Constant</span></header><section><div><pre><code class="language-julia hljs">EVIDENCE</code></pre><p>The constant key used to store evidence for a specific variable instance</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L606-L610">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.INTERVENTION" href="#Scruff.INTERVENTION"><code>Scruff.INTERVENTION</code></a> — <span class="docstring-category">Constant</span></header><section><div><pre><code class="language-julia hljs">INTERVENTION</code></pre><p>The constant key used to store interventions for a specific variable instance</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L641-L645">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Node" href="#Scruff.Node"><code>Scruff.Node</code></a> — <span class="docstring-category">Type</span></header><section><div><p><code>Node{O} = Union{Placeholder{O}, Variable{I,J,O} where {I,J}}</code></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/core.jl#L169">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Dist" href="#Scruff.Dist"><code>Scruff.Dist</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Dist{T} = SFunc{Tuple{}, T}</code></pre><p><strong>Additional supported operators</strong></p><ul><li><code>make_factors</code></li><li><code>send_lambda</code></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/core.jl#L75-L81">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.DynamicNetwork" href="#Scruff.DynamicNetwork"><code>Scruff.DynamicNetwork</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">DynamicNetwork{I,J,O} &lt;: Network{I,J,O}</code></pre><p>A network that can transition over time.   See <a href="#Scruff.Network"><code>Network</code></a> for the type parameters.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/core.jl#L320-L325">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.DynamicRuntime" href="#Scruff.DynamicRuntime"><code>Scruff.DynamicRuntime</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct DynamicRuntime &lt;: Runtime</code></pre><p>A runtime that represents a network whose variables take on many instances at different times <code>T</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L213-L217">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Env" href="#Scruff.Env"><code>Scruff.Env</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Env</code></pre><p>Holds all external state of a Runtime.  The <code>Env</code> supports the following methods:</p><pre><code class="nohighlight hljs">get_state(env::Env) :: Dict{Symbol, Any}
 has_state(env::Env, key::Symbol) :: Bool
 get_state(env::Env, key::Symbol)
 set_state!(env::Env, key::Symbol, value)
 delete_state!(env::Env, key::Symbol)
 clear_state!(env::Env)
-clone(env::Env)</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L141-L155">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Instance" href="#Scruff.Instance"><code>Scruff.Instance</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Instance{O}</code></pre><p>An abstract base type for variable and placeholder instances.</p><p>This is instance can have values associated with it in the runtime. O is the output type of the node.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L64-L71">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.InstantNetwork" href="#Scruff.InstantNetwork"><code>Scruff.InstantNetwork</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct InstantNetwork{I,J,O} &lt;: Network{I,Nothing,O}</code></pre><p>A network that only supports initial models.  The <code>Nothing</code> in the supertype shows that there is no transition to another time.</p><p>See <a href="#Scruff.Network"><code>Network</code></a> for the type parameters</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/core.jl#L282-L289">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.InstantRuntime" href="#Scruff.InstantRuntime"><code>Scruff.InstantRuntime</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct InstantRuntime &lt;: Runtime</code></pre><p>A runtime that represents a network whose variables take on a single instance.  As a convenience, the following methods create an <code>InstantRuntime</code>:</p><pre><code class="nohighlight hljs">Runtime()
+clone(env::Env)</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L141-L155">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Instance" href="#Scruff.Instance"><code>Scruff.Instance</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Instance{O}</code></pre><p>An abstract base type for variable and placeholder instances.</p><p>This is instance can have values associated with it in the runtime. O is the output type of the node.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L64-L71">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.InstantNetwork" href="#Scruff.InstantNetwork"><code>Scruff.InstantNetwork</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct InstantNetwork{I,J,O} &lt;: Network{I,Nothing,O}</code></pre><p>A network that only supports initial models.  The <code>Nothing</code> in the supertype shows that there is no transition to another time.</p><p>See <a href="#Scruff.Network"><code>Network</code></a> for the type parameters</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/core.jl#L282-L289">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.InstantRuntime" href="#Scruff.InstantRuntime"><code>Scruff.InstantRuntime</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct InstantRuntime &lt;: Runtime</code></pre><p>A runtime that represents a network whose variables take on a single instance.  As a convenience, the following methods create an <code>InstantRuntime</code>:</p><pre><code class="nohighlight hljs">Runtime()
 Runtime(net :: InstantNetwork)
-Runtime(net :: DynamicNetwork)</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L192-L203">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Model" href="#Scruff.Model"><code>Scruff.Model</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Model{I, J, O} &lt;: ValueTyped{O}</code></pre><p>Supertype for all Scruff models. The model represents a variable that varies over time and has output type <code>O</code>. The model may return an initial sfunc with input type <code>I</code> using <code>make_initial</code>, which takes the current time as argument, and a transition sfunc with input type <code>J</code> using <code>make_transition</code>, which takes both the parent times (a tuple of times of the same length as <code>J</code>) and the current time as arguments. These two functions need to be defined for every sfunc.</p><p><strong>Type parameters</strong></p><ul><li><code>I</code>: the input type to the <code>SFunc</code> returned by the model&#39;s <code>make_initial</code> function </li><li><code>J</code>: the input type to the <code>SFunc</code> used during the <code>make_transition</code> function call</li><li><code>O</code>: the actual type of the variables represented by this model</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/core.jl#L119-L135">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Network" href="#Scruff.Network"><code>Scruff.Network</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type Network{I,J,O}</code></pre><p>Collects variables, with placeholders for inputs, and defined outputs, along with up to two directed graphs for initial and transition.  Must implement <code>get_nodes</code>, <code>get_outputs</code>, <code>get_initial_graph</code>, <code>get_transition_graph</code> (which returns a <code>VariableGraph</code>)</p><p>For the type parameters, see the underlying <a href="#Scruff.Model"><code>Model</code></a> class for the mapped <a href="#Scruff.Variable"><code>Variable</code></a>s.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/core.jl#L194-L204">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Placeholder" href="#Scruff.Placeholder"><code>Scruff.Placeholder</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Placeholder{O} &lt;: ValueTyped{O}</code></pre><p>A type for typing Scruff variables that do not reference models</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/core.jl#L110-L114">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.PlaceholderInstance" href="#Scruff.PlaceholderInstance"><code>Scruff.PlaceholderInstance</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">PlaceholderInstance</code></pre><p>An instance of placeholder <code>node</code> at <code>time</code>.  This instance has no sfunc, but can still take  values in the runtime.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L86-L91">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Runtime" href="#Scruff.Runtime"><code>Scruff.Runtime</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type Runtime</code></pre><p>A struct that contains the state of the compute graph. This code makes the assumption that values are associated with instances but messages are passed between variables and applied to the relevant instances later.  It has to be this way because the receiving instance might not exist at the time the message is sent.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L182-L189">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFunc" href="#Scruff.SFunc"><code>Scruff.SFunc</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type SFunc{I&lt;:Tuple, O}</code></pre><p>A Stochastic Function type with input variables defined by <code>I</code> and output type <code>O</code>.   This is an abstract representation for a collection of operators with the same  input and output types.</p><p>All sfuncs have the following operators defined:</p><ul><li><code>compute_lambda</code></li><li><code>compute_bel</code></li><li><code>send_pi</code></li><li><code>outgoing_pis</code></li><li><code>outgoing_lambdas</code></li></ul><p><code>SFunc</code> <em>also</em> has both the operators <code>cpdf</code> and <code>logcpdf</code> defined in terms of the other.  All sfuncs should implement one or the other of these operators.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/core.jl#L54-L70">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Score" href="#Scruff.Score"><code>Scruff.Score</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Score{I} = SFunc{Tuple{I}, Nothing}</code></pre><p><code>Score</code> supports two (2) operators:  <code>get_score</code> and <code>get_log_score</code>.  <code>get_log_score</code> is defined, by default, using <code>get_score.</code>  Every subtype of <code>Score</code> <em>must</em> implement <code>get_score</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/core.jl#L84-L90">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.ValueTyped" href="#Scruff.ValueTyped"><code>Scruff.ValueTyped</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type ValueTyped{O}</code></pre><p>Supertype for typing all Scruff Variables; <code>O</code> is the  actual type of the variable</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/core.jl#L39-L44">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Variable" href="#Scruff.Variable"><code>Scruff.Variable</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">mutable struct Variable{I,J,O} &lt;: ValueTyped{O}</code></pre><p>A Variable describes the (time-series) of some set of random values. It must be named, described by a model, and references to the model inputs must be defined.</p><p>For the type variables, see <a href="#Scruff.Model"><code>Model</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/core.jl#L156-L163">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.VariableGraph" href="#Scruff.VariableGraph"><code>Scruff.VariableGraph</code></a> — <span class="docstring-category">Type</span></header><section><div><p>VariableGraph = Dict{Node, Vector{Node}}</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/core.jl#L183">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.VariableInstance" href="#Scruff.VariableInstance"><code>Scruff.VariableInstance</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">VariableInstance</code></pre><p>An instance of variable node at <code>time</code>.   <code>sf</code> is an sfunc generated from  the variable&#39;s model.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L74-L79">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.VariableParentTimeOffset" href="#Scruff.VariableParentTimeOffset"><code>Scruff.VariableParentTimeOffset</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">VariableParentTimeOffset = Set{Pair{Node, Node}}</code></pre><p>Represents whether a child-parent pair of nodes is time-offset; if they are time-offset, they will be a set of this type.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/core.jl#L186-L191">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.complete_graph!-Tuple{Vector{&lt;:Variable}, Dict{Node, Vector{Node}}}" href="#Scruff.complete_graph!-Tuple{Vector{&lt;:Variable}, Dict{Node, Vector{Node}}}"><code>Scruff.complete_graph!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">complete_graph!(variables::Vector{&lt;:Variable}, graph::VariableGraph)</code></pre><p>Populate the <code>graph</code> with <code>v=&gt;Node[]</code> for all <code>variables</code> not in the graph. </p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/core.jl#L267-L271">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.current_instance-Tuple{InstantRuntime, Node}" href="#Scruff.current_instance-Tuple{InstantRuntime, Node}"><code>Scruff.current_instance</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">current_instance(runtime::InstantRuntime, node::Node)
-current_instance(runtime::DynamicRuntime, node::Node)</code></pre><p>Returns the current (last) instance for the given runtime and node; this method will throw an exception if there is no current instance for the given node</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L393-L399">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.current_time-Union{Tuple{DynamicRuntime{T}}, Tuple{T}} where T" href="#Scruff.current_time-Union{Tuple{DynamicRuntime{T}}, Tuple{T}} where T"><code>Scruff.current_time</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">current_time(runtime::Runtime) -&gt; T</code></pre><p>Returns the currently set time of the given <code>Runtime</code></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L269-L273">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.delete_value!-Tuple{Runtime, Instance, Symbol}" href="#Scruff.delete_value!-Tuple{Runtime, Instance, Symbol}"><code>Scruff.delete_value!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">delete_value!(runtime::Runtime{T}, instance::Instance, key::Symbol) where {T}</code></pre><p>Deletes the mapping for the given instance and key in the runtime and returns it</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L510-L514">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.ensure_all!" href="#Scruff.ensure_all!"><code>Scruff.ensure_all!</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">ensure_all!(runtime::InstantRuntime, time=0) :: Dict{Symbol, Instance}
-ensure_all!(runtime::DynamicRuntime, time = current_time(runtime)) :: Dict{Symbol, Instance}</code></pre><p>Instantiate all the variables in the network at the given time and returns them as a dict from variable names to their corresponding instance; the default time is the current time of the runtime in unix time.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L351-L358">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.ensure_instance!-Union{Tuple{O}, Tuple{Runtime, Node{O}}, Tuple{Runtime, Node{O}, Any}} where O" href="#Scruff.ensure_instance!-Union{Tuple{O}, Tuple{Runtime, Node{O}}, Tuple{Runtime, Node{O}, Any}} where O"><code>Scruff.ensure_instance!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">ensure_instance!(runtime::Runtime{T}, node::Node{O}, time::T = current_time(runtime))::Instance{O} where {O,T}</code></pre><p>Returns an instance for the given variable at the given time, either by using an existing one or creating a new one.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L380-L384">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_all_instances-Tuple{DynamicRuntime, Variable}" href="#Scruff.get_all_instances-Tuple{DynamicRuntime, Variable}"><code>Scruff.get_all_instances</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_all_instances(runtime::DynamicRuntime, variable::Variable)
-get_all_instances(runtime::InstantRuntime, variable::Variable)</code></pre><p>Returns all instances in the <code>runtime</code> for the given variable, in order, as a <code>Vector{Instance}</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L418-L424">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_belief-Tuple{Runtime, Instance}" href="#Scruff.get_belief-Tuple{Runtime, Instance}"><code>Scruff.get_belief</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_belief(runtime::Runtime, inst::Instance)</code></pre><p>Returns the last posted belief for the given instance; this will return <code>nothing</code> if no belief has been posted</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L583-L588">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_definition-Tuple{VariableInstance}" href="#Scruff.get_definition-Tuple{VariableInstance}"><code>Scruff.get_definition</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_definition(i::VariableInstance)::D where {D&lt;:ValueTyped}</code></pre><p>Get the instance&#39;s variable&#39;s underlying model.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L125-L129">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_evidence-Tuple{Runtime, Instance}" href="#Scruff.get_evidence-Tuple{Runtime, Instance}"><code>Scruff.get_evidence</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_evidence(runtime::Runtime, inst::Instance)</code></pre><p>Returns the last posted evidence for the given instance; this will return <code>nothing</code> if no evidence has been posted</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L622-L627">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_initial_children-Tuple{Network, Node}" href="#Scruff.get_initial_children-Tuple{Network, Node}"><code>Scruff.get_initial_children</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_initial_children(n::Network, var::Node)::Vector{Node}</code></pre><p>Returns a list of the initial child nodes in the network from the network&#39;s initial graph (i.e. the return graph from get<em>initial</em>graph(network)).   </p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/core.jl#L247-L252">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_initial_parents-Tuple{Network, Node}" href="#Scruff.get_initial_parents-Tuple{Network, Node}"><code>Scruff.get_initial_parents</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_initial_parents(n::Network, node::Node)::Vector{Node}</code></pre><p>Returns a list of the initial parent nodes in the network from the network&#39;s initial graph (i.e. the return graph from get<em>initial</em>graph(network)).</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/core.jl#L207-L212">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_instance-Union{Tuple{T}, Tuple{DynamicRuntime{T}, Node, T}} where T" href="#Scruff.get_instance-Union{Tuple{T}, Tuple{DynamicRuntime{T}, Node, T}} where T"><code>Scruff.get_instance</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">function get_instance(runtime::DynamicRuntime{T}, node::Node, t::T)::Instance</code></pre><p>Returns instance for the given variable at time <code>T</code>; throws an error if no such instance exists.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L433-L438">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_intervention-Tuple{Runtime, Instance}" href="#Scruff.get_intervention-Tuple{Runtime, Instance}"><code>Scruff.get_intervention</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_intervention(runtime::Runtime, inst::Instance)</code></pre><p>Returns the last posted intervention for the given instance; this will return <code>nothing</code> if no intervention has been posted</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L657-L662">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_model-Tuple{VariableInstance}" href="#Scruff.get_model-Tuple{VariableInstance}"><code>Scruff.get_model</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_model(i::VariableInstance)::D where {D&lt;:ValueTyped}</code></pre><p>Get the instance&#39;s variable&#39;s underlying model.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L132-L136">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_name-Tuple{Instance}" href="#Scruff.get_name-Tuple{Instance}"><code>Scruff.get_name</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_name(i::Instance)::Symbol</code></pre><p>Get the name of the instance&#39;s node.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L118-L122">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_node-Tuple{Instance}" href="#Scruff.get_node-Tuple{Instance}"><code>Scruff.get_node</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_node(i::Instance)::Node</code></pre><p>Get the instance&#39;s node, whether it is a placeholder or a variable.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L104-L109">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_node-Tuple{Network, Symbol}" href="#Scruff.get_node-Tuple{Network, Symbol}"><code>Scruff.get_node</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_node(n::Network, name::Symbol)::Union{Node, Nothing}</code></pre><p>Returns the node with the given name, or <code>nothing</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/core.jl#L229-L233">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_sfunc-Tuple{VariableInstance}" href="#Scruff.get_sfunc-Tuple{VariableInstance}"><code>Scruff.get_sfunc</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_sfunc(i::VariableInstance)::SFunc</code></pre><p>Get the instance&#39;s sfunc.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L97-L101">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_time-Tuple{Instance}" href="#Scruff.get_time-Tuple{Instance}"><code>Scruff.get_time</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_time(i::Instance)</code></pre><p>Get the instance&#39;s time.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L111-L115">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_transition_children-Tuple{Network, Node}" href="#Scruff.get_transition_children-Tuple{Network, Node}"><code>Scruff.get_transition_children</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_transition_children(n::Network, var::Node)::Vector{Node}</code></pre><p>Returns a list of transitioned child nodes in the network from the network&#39;s  transition graph (i.e. the return graph from get<em>transition</em>graph(network))    </p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/core.jl#L257-L262">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_transition_parents-Tuple{Network, Node}" href="#Scruff.get_transition_parents-Tuple{Network, Node}"><code>Scruff.get_transition_parents</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_transition_parents(n::Network, node::Node)::Vector{Node}</code></pre><p>Returns a list of transitioned parent nodes in the network from the network&#39;s  transition graph (i.e. the return graph from get<em>transition</em>graph(network))</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/core.jl#L218-L223">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_value-Tuple{Runtime, Instance, Symbol}" href="#Scruff.get_value-Tuple{Runtime, Instance, Symbol}"><code>Scruff.get_value</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_value(runtime::Runtime, instance::Instance, key::Symbol)</code></pre><p>Get the value on an instance for the given key; this will throw an exception if the instance does not contain the given key</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L499-L504">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.has_instance" href="#Scruff.has_instance"><code>Scruff.has_instance</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">has_instance(runtime::DynamicRuntime, node::Node, time = current_time(runtime))
-has_instance(runtime::InstantRuntime, node::Node)</code></pre><p>Returns true if the given node has an instance in the given runtime at a time greater than or equal to the given time.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L465-L470">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.has_previous_instance-Tuple{DynamicRuntime, Node}" href="#Scruff.has_previous_instance-Tuple{DynamicRuntime, Node}"><code>Scruff.has_previous_instance</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">has_previous_instance(runtime::DynamicRuntime, node::Node)</code></pre><p>Checks if the specified node has an instance prior to the current one.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L477-L481">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.initialize_algorithm-Tuple{Function, Runtime}" href="#Scruff.initialize_algorithm-Tuple{Function, Runtime}"><code>Scruff.initialize_algorithm</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">initialize_algorithm(alg_fun::Function, runtime::Runtime)</code></pre><p>Initializes the given algorithm&#39;s <a href="#Scruff.Runtime"><code>Runtime</code></a>.  By default, this does nothing.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L674-L678">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.input_type-Union{Tuple{Type{&lt;:SFunc{I, O}}}, Tuple{O}, Tuple{I}} where {I, O}" href="#Scruff.input_type-Union{Tuple{Type{&lt;:SFunc{I, O}}}, Tuple{O}, Tuple{I}} where {I, O}"><code>Scruff.input_type</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">input_type(::Type{&lt;:SFunc{I,O}}) where {I,O}
-input_type(::SFunc{I,O}) where {I,O}</code></pre><p>Return the input type (i.e. <code>I</code>) of the <code>SFunc</code></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/core.jl#L93-L98">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.instantiate!" href="#Scruff.instantiate!"><code>Scruff.instantiate!</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">instantiate!(runtime::InstantRuntime,variable::Variable,time = 0)
+Runtime(net :: DynamicNetwork)</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L192-L203">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Model" href="#Scruff.Model"><code>Scruff.Model</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Model{I, J, O} &lt;: ValueTyped{O}</code></pre><p>Supertype for all Scruff models. The model represents a variable that varies over time and has output type <code>O</code>. The model may return an initial sfunc with input type <code>I</code> using <code>make_initial</code>, which takes the current time as argument, and a transition sfunc with input type <code>J</code> using <code>make_transition</code>, which takes both the parent times (a tuple of times of the same length as <code>J</code>) and the current time as arguments. These two functions need to be defined for every sfunc.</p><p><strong>Type parameters</strong></p><ul><li><code>I</code>: the input type to the <code>SFunc</code> returned by the model&#39;s <code>make_initial</code> function </li><li><code>J</code>: the input type to the <code>SFunc</code> used during the <code>make_transition</code> function call</li><li><code>O</code>: the actual type of the variables represented by this model</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/core.jl#L119-L135">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Network" href="#Scruff.Network"><code>Scruff.Network</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type Network{I,J,O}</code></pre><p>Collects variables, with placeholders for inputs, and defined outputs, along with up to two directed graphs for initial and transition.  Must implement <code>get_nodes</code>, <code>get_outputs</code>, <code>get_initial_graph</code>, <code>get_transition_graph</code> (which returns a <code>VariableGraph</code>)</p><p>For the type parameters, see the underlying <a href="#Scruff.Model"><code>Model</code></a> class for the mapped <a href="#Scruff.Variable"><code>Variable</code></a>s.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/core.jl#L194-L204">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Placeholder" href="#Scruff.Placeholder"><code>Scruff.Placeholder</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Placeholder{O} &lt;: ValueTyped{O}</code></pre><p>A type for typing Scruff variables that do not reference models</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/core.jl#L110-L114">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.PlaceholderInstance" href="#Scruff.PlaceholderInstance"><code>Scruff.PlaceholderInstance</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">PlaceholderInstance</code></pre><p>An instance of placeholder <code>node</code> at <code>time</code>.  This instance has no sfunc, but can still take  values in the runtime.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L86-L91">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Runtime" href="#Scruff.Runtime"><code>Scruff.Runtime</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type Runtime</code></pre><p>A struct that contains the state of the compute graph. This code makes the assumption that values are associated with instances but messages are passed between variables and applied to the relevant instances later.  It has to be this way because the receiving instance might not exist at the time the message is sent.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L182-L189">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFunc" href="#Scruff.SFunc"><code>Scruff.SFunc</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type SFunc{I&lt;:Tuple, O}</code></pre><p>A Stochastic Function type with input variables defined by <code>I</code> and output type <code>O</code>.   This is an abstract representation for a collection of operators with the same  input and output types.</p><p>All sfuncs have the following operators defined:</p><ul><li><code>compute_lambda</code></li><li><code>compute_bel</code></li><li><code>send_pi</code></li><li><code>outgoing_pis</code></li><li><code>outgoing_lambdas</code></li></ul><p><code>SFunc</code> <em>also</em> has both the operators <code>cpdf</code> and <code>logcpdf</code> defined in terms of the other.  All sfuncs should implement one or the other of these operators.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/core.jl#L54-L70">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Score" href="#Scruff.Score"><code>Scruff.Score</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Score{I} = SFunc{Tuple{I}, Nothing}</code></pre><p><code>Score</code> supports two (2) operators:  <code>get_score</code> and <code>get_log_score</code>.  <code>get_log_score</code> is defined, by default, using <code>get_score.</code>  Every subtype of <code>Score</code> <em>must</em> implement <code>get_score</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/core.jl#L84-L90">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.ValueTyped" href="#Scruff.ValueTyped"><code>Scruff.ValueTyped</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type ValueTyped{O}</code></pre><p>Supertype for typing all Scruff Variables; <code>O</code> is the  actual type of the variable</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/core.jl#L39-L44">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Variable" href="#Scruff.Variable"><code>Scruff.Variable</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">mutable struct Variable{I,J,O} &lt;: ValueTyped{O}</code></pre><p>A Variable describes the (time-series) of some set of random values. It must be named, described by a model, and references to the model inputs must be defined.</p><p>For the type variables, see <a href="#Scruff.Model"><code>Model</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/core.jl#L156-L163">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.VariableGraph" href="#Scruff.VariableGraph"><code>Scruff.VariableGraph</code></a> — <span class="docstring-category">Type</span></header><section><div><p>VariableGraph = Dict{Node, Vector{Node}}</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/core.jl#L183">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.VariableInstance" href="#Scruff.VariableInstance"><code>Scruff.VariableInstance</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">VariableInstance</code></pre><p>An instance of variable node at <code>time</code>.   <code>sf</code> is an sfunc generated from  the variable&#39;s model.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L74-L79">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.VariableParentTimeOffset" href="#Scruff.VariableParentTimeOffset"><code>Scruff.VariableParentTimeOffset</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">VariableParentTimeOffset = Set{Pair{Node, Node}}</code></pre><p>Represents whether a child-parent pair of nodes is time-offset; if they are time-offset, they will be a set of this type.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/core.jl#L186-L191">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.complete_graph!-Tuple{Vector{&lt;:Variable}, Dict{Node, Vector{Node}}}" href="#Scruff.complete_graph!-Tuple{Vector{&lt;:Variable}, Dict{Node, Vector{Node}}}"><code>Scruff.complete_graph!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">complete_graph!(variables::Vector{&lt;:Variable}, graph::VariableGraph)</code></pre><p>Populate the <code>graph</code> with <code>v=&gt;Node[]</code> for all <code>variables</code> not in the graph. </p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/core.jl#L267-L271">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.current_instance-Tuple{InstantRuntime, Node}" href="#Scruff.current_instance-Tuple{InstantRuntime, Node}"><code>Scruff.current_instance</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">current_instance(runtime::InstantRuntime, node::Node)
+current_instance(runtime::DynamicRuntime, node::Node)</code></pre><p>Returns the current (last) instance for the given runtime and node; this method will throw an exception if there is no current instance for the given node</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L393-L399">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.current_time-Union{Tuple{DynamicRuntime{T}}, Tuple{T}} where T" href="#Scruff.current_time-Union{Tuple{DynamicRuntime{T}}, Tuple{T}} where T"><code>Scruff.current_time</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">current_time(runtime::Runtime) -&gt; T</code></pre><p>Returns the currently set time of the given <code>Runtime</code></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L269-L273">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.delete_value!-Tuple{Runtime, Instance, Symbol}" href="#Scruff.delete_value!-Tuple{Runtime, Instance, Symbol}"><code>Scruff.delete_value!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">delete_value!(runtime::Runtime{T}, instance::Instance, key::Symbol) where {T}</code></pre><p>Deletes the mapping for the given instance and key in the runtime and returns it</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L510-L514">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.ensure_all!" href="#Scruff.ensure_all!"><code>Scruff.ensure_all!</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">ensure_all!(runtime::InstantRuntime, time=0) :: Dict{Symbol, Instance}
+ensure_all!(runtime::DynamicRuntime, time = current_time(runtime)) :: Dict{Symbol, Instance}</code></pre><p>Instantiate all the variables in the network at the given time and returns them as a dict from variable names to their corresponding instance; the default time is the current time of the runtime in unix time.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L351-L358">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.ensure_instance!-Union{Tuple{O}, Tuple{Runtime, Node{O}}, Tuple{Runtime, Node{O}, Any}} where O" href="#Scruff.ensure_instance!-Union{Tuple{O}, Tuple{Runtime, Node{O}}, Tuple{Runtime, Node{O}, Any}} where O"><code>Scruff.ensure_instance!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">ensure_instance!(runtime::Runtime{T}, node::Node{O}, time::T = current_time(runtime))::Instance{O} where {O,T}</code></pre><p>Returns an instance for the given variable at the given time, either by using an existing one or creating a new one.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L380-L384">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_all_instances-Tuple{DynamicRuntime, Variable}" href="#Scruff.get_all_instances-Tuple{DynamicRuntime, Variable}"><code>Scruff.get_all_instances</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_all_instances(runtime::DynamicRuntime, variable::Variable)
+get_all_instances(runtime::InstantRuntime, variable::Variable)</code></pre><p>Returns all instances in the <code>runtime</code> for the given variable, in order, as a <code>Vector{Instance}</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L418-L424">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_belief-Tuple{Runtime, Instance}" href="#Scruff.get_belief-Tuple{Runtime, Instance}"><code>Scruff.get_belief</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_belief(runtime::Runtime, inst::Instance)</code></pre><p>Returns the last posted belief for the given instance; this will return <code>nothing</code> if no belief has been posted</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L583-L588">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_definition-Tuple{VariableInstance}" href="#Scruff.get_definition-Tuple{VariableInstance}"><code>Scruff.get_definition</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_definition(i::VariableInstance)::D where {D&lt;:ValueTyped}</code></pre><p>Get the instance&#39;s variable&#39;s underlying model.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L125-L129">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_evidence-Tuple{Runtime, Instance}" href="#Scruff.get_evidence-Tuple{Runtime, Instance}"><code>Scruff.get_evidence</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_evidence(runtime::Runtime, inst::Instance)</code></pre><p>Returns the last posted evidence for the given instance; this will return <code>nothing</code> if no evidence has been posted</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L622-L627">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_initial_children-Tuple{Network, Node}" href="#Scruff.get_initial_children-Tuple{Network, Node}"><code>Scruff.get_initial_children</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_initial_children(n::Network, var::Node)::Vector{Node}</code></pre><p>Returns a list of the initial child nodes in the network from the network&#39;s initial graph (i.e. the return graph from get<em>initial</em>graph(network)).   </p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/core.jl#L247-L252">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_initial_parents-Tuple{Network, Node}" href="#Scruff.get_initial_parents-Tuple{Network, Node}"><code>Scruff.get_initial_parents</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_initial_parents(n::Network, node::Node)::Vector{Node}</code></pre><p>Returns a list of the initial parent nodes in the network from the network&#39;s initial graph (i.e. the return graph from get<em>initial</em>graph(network)).</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/core.jl#L207-L212">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_instance-Union{Tuple{T}, Tuple{DynamicRuntime{T}, Node, T}} where T" href="#Scruff.get_instance-Union{Tuple{T}, Tuple{DynamicRuntime{T}, Node, T}} where T"><code>Scruff.get_instance</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">function get_instance(runtime::DynamicRuntime{T}, node::Node, t::T)::Instance</code></pre><p>Returns instance for the given variable at time <code>T</code>; throws an error if no such instance exists.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L433-L438">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_intervention-Tuple{Runtime, Instance}" href="#Scruff.get_intervention-Tuple{Runtime, Instance}"><code>Scruff.get_intervention</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_intervention(runtime::Runtime, inst::Instance)</code></pre><p>Returns the last posted intervention for the given instance; this will return <code>nothing</code> if no intervention has been posted</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L657-L662">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_model-Tuple{VariableInstance}" href="#Scruff.get_model-Tuple{VariableInstance}"><code>Scruff.get_model</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_model(i::VariableInstance)::D where {D&lt;:ValueTyped}</code></pre><p>Get the instance&#39;s variable&#39;s underlying model.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L132-L136">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_name-Tuple{Instance}" href="#Scruff.get_name-Tuple{Instance}"><code>Scruff.get_name</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_name(i::Instance)::Symbol</code></pre><p>Get the name of the instance&#39;s node.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L118-L122">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_node-Tuple{Instance}" href="#Scruff.get_node-Tuple{Instance}"><code>Scruff.get_node</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_node(i::Instance)::Node</code></pre><p>Get the instance&#39;s node, whether it is a placeholder or a variable.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L104-L109">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_node-Tuple{Network, Symbol}" href="#Scruff.get_node-Tuple{Network, Symbol}"><code>Scruff.get_node</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_node(n::Network, name::Symbol)::Union{Node, Nothing}</code></pre><p>Returns the node with the given name, or <code>nothing</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/core.jl#L229-L233">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_sfunc-Tuple{VariableInstance}" href="#Scruff.get_sfunc-Tuple{VariableInstance}"><code>Scruff.get_sfunc</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_sfunc(i::VariableInstance)::SFunc</code></pre><p>Get the instance&#39;s sfunc.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L97-L101">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_time-Tuple{Instance}" href="#Scruff.get_time-Tuple{Instance}"><code>Scruff.get_time</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_time(i::Instance)</code></pre><p>Get the instance&#39;s time.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L111-L115">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_transition_children-Tuple{Network, Node}" href="#Scruff.get_transition_children-Tuple{Network, Node}"><code>Scruff.get_transition_children</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_transition_children(n::Network, var::Node)::Vector{Node}</code></pre><p>Returns a list of transitioned child nodes in the network from the network&#39;s  transition graph (i.e. the return graph from get<em>transition</em>graph(network))    </p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/core.jl#L257-L262">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_transition_parents-Tuple{Network, Node}" href="#Scruff.get_transition_parents-Tuple{Network, Node}"><code>Scruff.get_transition_parents</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_transition_parents(n::Network, node::Node)::Vector{Node}</code></pre><p>Returns a list of transitioned parent nodes in the network from the network&#39;s  transition graph (i.e. the return graph from get<em>transition</em>graph(network))</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/core.jl#L218-L223">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.get_value-Tuple{Runtime, Instance, Symbol}" href="#Scruff.get_value-Tuple{Runtime, Instance, Symbol}"><code>Scruff.get_value</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_value(runtime::Runtime, instance::Instance, key::Symbol)</code></pre><p>Get the value on an instance for the given key; this will throw an exception if the instance does not contain the given key</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L499-L504">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.has_instance" href="#Scruff.has_instance"><code>Scruff.has_instance</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">has_instance(runtime::DynamicRuntime, node::Node, time = current_time(runtime))
+has_instance(runtime::InstantRuntime, node::Node)</code></pre><p>Returns true if the given node has an instance in the given runtime at a time greater than or equal to the given time.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L465-L470">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.has_previous_instance-Tuple{DynamicRuntime, Node}" href="#Scruff.has_previous_instance-Tuple{DynamicRuntime, Node}"><code>Scruff.has_previous_instance</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">has_previous_instance(runtime::DynamicRuntime, node::Node)</code></pre><p>Checks if the specified node has an instance prior to the current one.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L477-L481">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.initialize_algorithm-Tuple{Function, Runtime}" href="#Scruff.initialize_algorithm-Tuple{Function, Runtime}"><code>Scruff.initialize_algorithm</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">initialize_algorithm(alg_fun::Function, runtime::Runtime)</code></pre><p>Initializes the given algorithm&#39;s <a href="#Scruff.Runtime"><code>Runtime</code></a>.  By default, this does nothing.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L674-L678">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.input_type-Union{Tuple{Type{&lt;:SFunc{I, O}}}, Tuple{O}, Tuple{I}} where {I, O}" href="#Scruff.input_type-Union{Tuple{Type{&lt;:SFunc{I, O}}}, Tuple{O}, Tuple{I}} where {I, O}"><code>Scruff.input_type</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">input_type(::Type{&lt;:SFunc{I,O}}) where {I,O}
+input_type(::SFunc{I,O}) where {I,O}</code></pre><p>Return the input type (i.e. <code>I</code>) of the <code>SFunc</code></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/core.jl#L93-L98">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.instantiate!" href="#Scruff.instantiate!"><code>Scruff.instantiate!</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">instantiate!(runtime::InstantRuntime,variable::Variable,time = 0)
 instantiate!(runtime::InstantRuntime,placeholder::Placeholder,time = 0)
-instantiate!(runtime::DynamicRuntime{T}, node::Node,time::T = current_time(runtime))::Instance where {T}</code></pre><p>Instantiate and return an instance for the given runtime at the given time; the default time is the current time of the runtime in unix time (an <code>Int64</code>). For an <code>InstantRuntime</code>,  there is only a single instance for each variable.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L291-L299">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.instantiate-Tuple{Model, Symbol}" href="#Scruff.instantiate-Tuple{Model, Symbol}"><code>Scruff.instantiate</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">instantiate(model::Model, name::Symbol)</code></pre><p>Create a new <code>Variable</code> with the given name for the given model.  Every <code>Model</code> instance is also a function that, given a <code>Symbol</code>, will call  this method.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/core.jl#L145-L151">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.latest_instance_before-Union{Tuple{T}, Tuple{DynamicRuntime{T}, Node, T, Bool}} where T" href="#Scruff.latest_instance_before-Union{Tuple{T}, Tuple{DynamicRuntime{T}, Node, T, Bool}} where T"><code>Scruff.latest_instance_before</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">latest_instance_before(runtime::DynamicRuntime{T}, node::Node, t::T, allow_equal::Bool) :: Union{Instance, Nothing} where T</code></pre><p>Return the latest instance of the node before the given time.  The <code>allow_equal</code> flag indicates  whether instances at a time equal to <code>t</code>` are allowed. </p><p>If there is no such instance, returns <code>nothing</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L443-L451">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.output_type-Union{Tuple{Type{&lt;:SFunc{I, O}}}, Tuple{O}, Tuple{I}} where {I, O}" href="#Scruff.output_type-Union{Tuple{Type{&lt;:SFunc{I, O}}}, Tuple{O}, Tuple{I}} where {I, O}"><code>Scruff.output_type</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">output_type(::Type{&lt;:SFunc{I,O}}) where {I,O}
-output_type(::SFunc{I,O}) where {I,O}</code></pre><p>Return the output type (i.e. <code>O</code>) of the <code>SFunc</code></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/core.jl#L101-L106">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.output_type-Union{Tuple{Variable{I, J, O}}, Tuple{O}, Tuple{J}, Tuple{I}} where {I, J, O}" href="#Scruff.output_type-Union{Tuple{Variable{I, J, O}}, Tuple{O}, Tuple{J}, Tuple{I}} where {I, J, O}"><code>Scruff.output_type</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">output_type(::Variable{I,J,O})
-output_type(::Placeholder{O})</code></pre><p>returns the output type <code>O</code> of the given parameter</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/core.jl#L172-L177">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.post_belief!-Tuple{Runtime, Instance, Any}" href="#Scruff.post_belief!-Tuple{Runtime, Instance, Any}"><code>Scruff.post_belief!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">post_belief!(runtime::Runtime, inst::Instance, belief)</code></pre><p>Posts the given evidence for the given instance.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L574-L578">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.post_evidence!-Tuple{Runtime, Instance, Score}" href="#Scruff.post_evidence!-Tuple{Runtime, Instance, Score}"><code>Scruff.post_evidence!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">post_evidence!(runtime::Runtime, inst::Instance, evidence)</code></pre><p>Posts the given evidence for the given instance.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L613-L617">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.post_intervention!-Tuple{Runtime, Instance, SFunc{Tuple{}}}" href="#Scruff.post_intervention!-Tuple{Runtime, Instance, SFunc{Tuple{}}}"><code>Scruff.post_intervention!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">post_intervention!(runtime::Runtime, inst::Instance, intervention::Dist)</code></pre><p>Posts the given intervention for the given instance.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L648-L652">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.previous_instance-Tuple{DynamicRuntime, Node}" href="#Scruff.previous_instance-Tuple{DynamicRuntime, Node}"><code>Scruff.previous_instance</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">previous_instance(runtime::DynamicRuntime, node::Node)</code></pre><p>Returns the previous instance for the given runtime and node.  This will throw and exception if there is no previous instance.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L406-L411">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.set_time!-Union{Tuple{T}, Tuple{DynamicRuntime{T}, T}} where T" href="#Scruff.set_time!-Union{Tuple{T}, Tuple{DynamicRuntime{T}, T}} where T"><code>Scruff.set_time!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">set_time(runtime::Runtime{T}, newtime::T) -&gt; T</code></pre><p>Sets the current time for the given <code>Runtime</code></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L278-L282">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.set_value!-Tuple{Runtime, Instance, Symbol, Any}" href="#Scruff.set_value!-Tuple{Runtime, Instance, Symbol, Any}"><code>Scruff.set_value!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">set_value!(runtime::Runtime, instance::Instance, key::Symbol, value)</code></pre><p>Set the value on an instance for the given key</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L490-L494">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.start_algorithm-Tuple{Function, Runtime, Vararg{Any}}" href="#Scruff.start_algorithm-Tuple{Function, Runtime, Vararg{Any}}"><code>Scruff.start_algorithm</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">start_algorithm(alg_fun::Function, runtime::Runtime, args...)</code></pre><p>Starts the algorithm in the current thread</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/runtime.jl#L681-L685">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.value_type-Union{Tuple{ValueTyped{O}}, Tuple{O}} where O" href="#Scruff.value_type-Union{Tuple{ValueTyped{O}}, Tuple{O}} where O"><code>Scruff.value_type</code></a> — <span class="docstring-category">Method</span></header><section><div><p>value_type(v::ValueTyped{O}) where {O}</p><p>return the actual type (i.e. <code>O</code>) of the <code>ValueTyped</code></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/core.jl#L47-L51">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../tutorial/examples/">« Examples</a><a class="docs-footer-nextpage" href="../sfuncs/">Stochastic Functions »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Tuesday 7 May 2024 20:00">Tuesday 7 May 2024</span>. Using Julia version 1.7.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+instantiate!(runtime::DynamicRuntime{T}, node::Node,time::T = current_time(runtime))::Instance where {T}</code></pre><p>Instantiate and return an instance for the given runtime at the given time; the default time is the current time of the runtime in unix time (an <code>Int64</code>). For an <code>InstantRuntime</code>,  there is only a single instance for each variable.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L291-L299">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.instantiate-Tuple{Model, Symbol}" href="#Scruff.instantiate-Tuple{Model, Symbol}"><code>Scruff.instantiate</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">instantiate(model::Model, name::Symbol)</code></pre><p>Create a new <code>Variable</code> with the given name for the given model.  Every <code>Model</code> instance is also a function that, given a <code>Symbol</code>, will call  this method.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/core.jl#L145-L151">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.latest_instance_before-Union{Tuple{T}, Tuple{DynamicRuntime{T}, Node, T, Bool}} where T" href="#Scruff.latest_instance_before-Union{Tuple{T}, Tuple{DynamicRuntime{T}, Node, T, Bool}} where T"><code>Scruff.latest_instance_before</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">latest_instance_before(runtime::DynamicRuntime{T}, node::Node, t::T, allow_equal::Bool) :: Union{Instance, Nothing} where T</code></pre><p>Return the latest instance of the node before the given time.  The <code>allow_equal</code> flag indicates  whether instances at a time equal to <code>t</code>` are allowed. </p><p>If there is no such instance, returns <code>nothing</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L443-L451">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.output_type-Union{Tuple{Type{&lt;:SFunc{I, O}}}, Tuple{O}, Tuple{I}} where {I, O}" href="#Scruff.output_type-Union{Tuple{Type{&lt;:SFunc{I, O}}}, Tuple{O}, Tuple{I}} where {I, O}"><code>Scruff.output_type</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">output_type(::Type{&lt;:SFunc{I,O}}) where {I,O}
+output_type(::SFunc{I,O}) where {I,O}</code></pre><p>Return the output type (i.e. <code>O</code>) of the <code>SFunc</code></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/core.jl#L101-L106">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.output_type-Union{Tuple{Variable{I, J, O}}, Tuple{O}, Tuple{J}, Tuple{I}} where {I, J, O}" href="#Scruff.output_type-Union{Tuple{Variable{I, J, O}}, Tuple{O}, Tuple{J}, Tuple{I}} where {I, J, O}"><code>Scruff.output_type</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">output_type(::Variable{I,J,O})
+output_type(::Placeholder{O})</code></pre><p>returns the output type <code>O</code> of the given parameter</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/core.jl#L172-L177">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.post_belief!-Tuple{Runtime, Instance, Any}" href="#Scruff.post_belief!-Tuple{Runtime, Instance, Any}"><code>Scruff.post_belief!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">post_belief!(runtime::Runtime, inst::Instance, belief)</code></pre><p>Posts the given evidence for the given instance.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L574-L578">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.post_evidence!-Tuple{Runtime, Instance, Score}" href="#Scruff.post_evidence!-Tuple{Runtime, Instance, Score}"><code>Scruff.post_evidence!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">post_evidence!(runtime::Runtime, inst::Instance, evidence)</code></pre><p>Posts the given evidence for the given instance.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L613-L617">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.post_intervention!-Tuple{Runtime, Instance, SFunc{Tuple{}}}" href="#Scruff.post_intervention!-Tuple{Runtime, Instance, SFunc{Tuple{}}}"><code>Scruff.post_intervention!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">post_intervention!(runtime::Runtime, inst::Instance, intervention::Dist)</code></pre><p>Posts the given intervention for the given instance.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L648-L652">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.previous_instance-Tuple{DynamicRuntime, Node}" href="#Scruff.previous_instance-Tuple{DynamicRuntime, Node}"><code>Scruff.previous_instance</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">previous_instance(runtime::DynamicRuntime, node::Node)</code></pre><p>Returns the previous instance for the given runtime and node.  This will throw and exception if there is no previous instance.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L406-L411">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.set_time!-Union{Tuple{T}, Tuple{DynamicRuntime{T}, T}} where T" href="#Scruff.set_time!-Union{Tuple{T}, Tuple{DynamicRuntime{T}, T}} where T"><code>Scruff.set_time!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">set_time(runtime::Runtime{T}, newtime::T) -&gt; T</code></pre><p>Sets the current time for the given <code>Runtime</code></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L278-L282">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.set_value!-Tuple{Runtime, Instance, Symbol, Any}" href="#Scruff.set_value!-Tuple{Runtime, Instance, Symbol, Any}"><code>Scruff.set_value!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">set_value!(runtime::Runtime, instance::Instance, key::Symbol, value)</code></pre><p>Set the value on an instance for the given key</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L490-L494">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.start_algorithm-Tuple{Function, Runtime, Vararg{Any}}" href="#Scruff.start_algorithm-Tuple{Function, Runtime, Vararg{Any}}"><code>Scruff.start_algorithm</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">start_algorithm(alg_fun::Function, runtime::Runtime, args...)</code></pre><p>Starts the algorithm in the current thread</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/runtime.jl#L681-L685">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.value_type-Union{Tuple{ValueTyped{O}}, Tuple{O}} where O" href="#Scruff.value_type-Union{Tuple{ValueTyped{O}}, Tuple{O}} where O"><code>Scruff.value_type</code></a> — <span class="docstring-category">Method</span></header><section><div><p>value_type(v::ValueTyped{O}) where {O}</p><p>return the actual type (i.e. <code>O</code>) of the <code>ValueTyped</code></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/core.jl#L47-L51">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../tutorial/examples/">« Examples</a><a class="docs-footer-nextpage" href="../sfuncs/">Stochastic Functions »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Wednesday 15 May 2024 16:16">Wednesday 15 May 2024</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/dev/lib/models/index.html b/dev/lib/models/index.html
index f33f1cb..3ee0c57 100644
--- a/dev/lib/models/index.html
+++ b/dev/lib/models/index.html
@@ -1,2 +1,2 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Models · Scruff.jl</title><script data-outdated-warner src="../../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../../assets/documenter.js"></script><script src="../../siteinfo.js"></script><script src="../../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../../">Scruff.jl</a></span></div><form class="docs-search" action="../../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../../">Getting Started</a></li><li><a class="tocitem" href="../../tutorial/tutorial/">Tutorial</a></li><li><a class="tocitem" href="../../tutorial/examples/">Examples</a></li><li><span class="tocitem">Library</span><ul><li><a class="tocitem" href="../core/">Core</a></li><li><a class="tocitem" href="../sfuncs/">Stochastic Functions</a></li><li><a class="tocitem" href="../operators/">Operators</a></li><li class="is-active"><a class="tocitem" href>Models</a></li><li><a class="tocitem" href="../algorithms/">Algorithms</a></li><li><a class="tocitem" href="../utilities/">Utilities</a></li><li><a class="tocitem" href="../rtutils/">Runtime Utilities</a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Library</a></li><li class="is-active"><a href>Models</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Models</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/charles-river-analytics/Scruff.jl/blob/develop/docs/src/lib/models.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="scruff_models"><a class="docs-heading-anchor" href="#scruff_models">Scruff.Models</a><a id="scruff_models-1"></a><a class="docs-heading-anchor-permalink" href="#scruff_models" title="Permalink"></a></h1><article class="docstring"><header><a class="docstring-binding" id="Scruff.Models.FixedTimeModel" href="#Scruff.Models.FixedTimeModel"><code>Scruff.Models.FixedTimeModel</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type FixedTimeModel{I,O} &lt;: Model{I,O}</code></pre><p>A dynamic model described only for fixed time delta.  Must implement  <code>get_initial</code>, <code>get_transition</code>, and <code>get_dt</code>. These can depend on the current time.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/models/fixedtimemodel.jl#L4-L10">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Models.HomogeneousModel" href="#Scruff.Models.HomogeneousModel"><code>Scruff.Models.HomogeneousModel</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">HomogeneousModel{I,O} &lt;: FixedTimeModel{I,O}</code></pre><p>A dynamic model with a fixed time step and same transition model at every time point.. The constructor is called with the initial sfunc and transition sfuncs. The constructor is also called with an optional dt (defaults to 1).</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/models/homogeneousmodel.jl#L3-L9">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Models.InstantModel" href="#Scruff.Models.InstantModel"><code>Scruff.Models.InstantModel</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type InstantModel{I,O} &lt;: Model{I,Nothing,O}</code></pre><p>A model for a variable with no time dependencies. Since this model has no transitions, it can only called with  <code>make_initial</code> and not <code>make_transition</code>  (i.e. <code>make_transition</code> = <code>make_initial</code>)</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/models/instantmodel.jl#L4-L11">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Models.SimpleModel" href="#Scruff.Models.SimpleModel"><code>Scruff.Models.SimpleModel</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct SimpleModel{I,O} &lt;: TimelessInstantModel{I,O}</code></pre><p>A model that always produces the same SFunc. This is an TimelessInstantModel, so must always be called when the parents are the same time point. The constructor takes the sfunc as argument, which is stored. There is a convencience method to create a SimpleModel for any sfunc by applying the sfunc to zero arguments.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/models/simplemodel.jl#L3-L10">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Models.StaticModel" href="#Scruff.Models.StaticModel"><code>Scruff.Models.StaticModel</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct StaticModel{I,O} &lt;: VariableTimeModel{I,O,O} end</code></pre><p>A static model represents a variable that never changes its value. The value is setup through an sfunc created by make_initial. At any time point, it simply copies its previous value. Because it can be used flexibly, we make it a subtype of VariableTimeModel.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/models/staticmodel.jl#L3-L10">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Models.TimelessFixedTimeModel" href="#Scruff.Models.TimelessFixedTimeModel"><code>Scruff.Models.TimelessFixedTimeModel</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type TimelessFixedTimeModel{I,J,O} &lt;: FixedTimeModel{I,J,O}</code></pre><p>A FixedTimeModel in which the initial and transition models do not depend on the current time. In addition to <code>get_dt</code>, must implement a version of <code>get_initial</code> and <code>get_transition</code> that do not take the current time as an argument.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/models/timelessfixedtimemodel.jl#L3-L9">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Models.VariableTimeModel" href="#Scruff.Models.VariableTimeModel"><code>Scruff.Models.VariableTimeModel</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type VariableTimeModel{I,J,O} &lt;: Model{I,J,O}</code></pre><p>A model that creates sfuncs based on the time delta between the parents and the current instance. In general, the deltas can be different for different parents. This type does not introduce any new functionality over Model. Its purpose is to make explicit the fact that for this type of model, separate time deltas are possible. Must implement &#39;make<em>initial&#39;, which takes the current time, and &#39;make</em>transition&#39;, which takes the current time and parent times. </p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/models/variabletimemodel.jl#L3-L11">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../operators/">« Operators</a><a class="docs-footer-nextpage" href="../algorithms/">Algorithms »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Tuesday 7 May 2024 20:00">Tuesday 7 May 2024</span>. Using Julia version 1.7.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Models · Scruff.jl</title><script data-outdated-warner src="../../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../../assets/documenter.js"></script><script src="../../siteinfo.js"></script><script src="../../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../../">Scruff.jl</a></span></div><form class="docs-search" action="../../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../../">Getting Started</a></li><li><a class="tocitem" href="../../tutorial/tutorial/">Tutorial</a></li><li><a class="tocitem" href="../../tutorial/examples/">Examples</a></li><li><span class="tocitem">Library</span><ul><li><a class="tocitem" href="../core/">Core</a></li><li><a class="tocitem" href="../sfuncs/">Stochastic Functions</a></li><li><a class="tocitem" href="../operators/">Operators</a></li><li class="is-active"><a class="tocitem" href>Models</a></li><li><a class="tocitem" href="../algorithms/">Algorithms</a></li><li><a class="tocitem" href="../utilities/">Utilities</a></li><li><a class="tocitem" href="../rtutils/">Runtime Utilities</a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Library</a></li><li class="is-active"><a href>Models</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Models</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/charles-river-analytics/Scruff.jl/blob/develop/docs/src/lib/models.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="scruff_models"><a class="docs-heading-anchor" href="#scruff_models">Scruff.Models</a><a id="scruff_models-1"></a><a class="docs-heading-anchor-permalink" href="#scruff_models" title="Permalink"></a></h1><article class="docstring"><header><a class="docstring-binding" id="Scruff.Models.FixedTimeModel" href="#Scruff.Models.FixedTimeModel"><code>Scruff.Models.FixedTimeModel</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type FixedTimeModel{I,O} &lt;: Model{I,O}</code></pre><p>A dynamic model described only for fixed time delta.  Must implement  <code>get_initial</code>, <code>get_transition</code>, and <code>get_dt</code>. These can depend on the current time.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/models/fixedtimemodel.jl#L4-L10">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Models.HomogeneousModel" href="#Scruff.Models.HomogeneousModel"><code>Scruff.Models.HomogeneousModel</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">HomogeneousModel{I,O} &lt;: FixedTimeModel{I,O}</code></pre><p>A dynamic model with a fixed time step and same transition model at every time point.. The constructor is called with the initial sfunc and transition sfuncs. The constructor is also called with an optional dt (defaults to 1).</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/models/homogeneousmodel.jl#L3-L9">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Models.InstantModel" href="#Scruff.Models.InstantModel"><code>Scruff.Models.InstantModel</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type InstantModel{I,O} &lt;: Model{I,Nothing,O}</code></pre><p>A model for a variable with no time dependencies. Since this model has no transitions, it can only called with  <code>make_initial</code> and not <code>make_transition</code>  (i.e. <code>make_transition</code> = <code>make_initial</code>)</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/models/instantmodel.jl#L4-L11">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Models.SimpleModel" href="#Scruff.Models.SimpleModel"><code>Scruff.Models.SimpleModel</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct SimpleModel{I,O} &lt;: TimelessInstantModel{I,O}</code></pre><p>A model that always produces the same SFunc. This is an TimelessInstantModel, so must always be called when the parents are the same time point. The constructor takes the sfunc as argument, which is stored. There is a convencience method to create a SimpleModel for any sfunc by applying the sfunc to zero arguments.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/models/simplemodel.jl#L3-L10">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Models.StaticModel" href="#Scruff.Models.StaticModel"><code>Scruff.Models.StaticModel</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct StaticModel{I,O} &lt;: VariableTimeModel{I,O,O} end</code></pre><p>A static model represents a variable that never changes its value. The value is setup through an sfunc created by make_initial. At any time point, it simply copies its previous value. Because it can be used flexibly, we make it a subtype of VariableTimeModel.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/models/staticmodel.jl#L3-L10">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Models.TimelessFixedTimeModel" href="#Scruff.Models.TimelessFixedTimeModel"><code>Scruff.Models.TimelessFixedTimeModel</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type TimelessFixedTimeModel{I,J,O} &lt;: FixedTimeModel{I,J,O}</code></pre><p>A FixedTimeModel in which the initial and transition models do not depend on the current time. In addition to <code>get_dt</code>, must implement a version of <code>get_initial</code> and <code>get_transition</code> that do not take the current time as an argument.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/models/timelessfixedtimemodel.jl#L3-L9">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Models.VariableTimeModel" href="#Scruff.Models.VariableTimeModel"><code>Scruff.Models.VariableTimeModel</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type VariableTimeModel{I,J,O} &lt;: Model{I,J,O}</code></pre><p>A model that creates sfuncs based on the time delta between the parents and the current instance. In general, the deltas can be different for different parents. This type does not introduce any new functionality over Model. Its purpose is to make explicit the fact that for this type of model, separate time deltas are possible. Must implement &#39;make<em>initial&#39;, which takes the current time, and &#39;make</em>transition&#39;, which takes the current time and parent times. </p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/models/variabletimemodel.jl#L3-L11">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../operators/">« Operators</a><a class="docs-footer-nextpage" href="../algorithms/">Algorithms »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Wednesday 15 May 2024 16:16">Wednesday 15 May 2024</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/dev/lib/operators/index.html b/dev/lib/operators/index.html
index e2804be..f58aa70 100644
--- a/dev/lib/operators/index.html
+++ b/dev/lib/operators/index.html
@@ -1,2 +1,2 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Operators · Scruff.jl</title><script data-outdated-warner src="../../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../../assets/documenter.js"></script><script src="../../siteinfo.js"></script><script src="../../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../../">Scruff.jl</a></span></div><form class="docs-search" action="../../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../../">Getting Started</a></li><li><a class="tocitem" href="../../tutorial/tutorial/">Tutorial</a></li><li><a class="tocitem" href="../../tutorial/examples/">Examples</a></li><li><span class="tocitem">Library</span><ul><li><a class="tocitem" href="../core/">Core</a></li><li><a class="tocitem" href="../sfuncs/">Stochastic Functions</a></li><li class="is-active"><a class="tocitem" href>Operators</a></li><li><a class="tocitem" href="../models/">Models</a></li><li><a class="tocitem" href="../algorithms/">Algorithms</a></li><li><a class="tocitem" href="../utilities/">Utilities</a></li><li><a class="tocitem" href="../rtutils/">Runtime Utilities</a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Library</a></li><li class="is-active"><a href>Operators</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Operators</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/charles-river-analytics/Scruff.jl/blob/develop/docs/src/lib/operators.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="scruff_operators"><a class="docs-heading-anchor" href="#scruff_operators">Scruff.Operators</a><a id="scruff_operators-1"></a><a class="docs-heading-anchor-permalink" href="#scruff_operators" title="Permalink"></a></h1><article class="docstring"><header><a class="docstring-binding" id="Scruff.Operators" href="#Scruff.Operators"><code>Scruff.Operators</code></a> — <span class="docstring-category">Module</span></header><section><div><p>The <code>Operators</code> module defines the following interfaces for the following operators:</p><ul><li><code>is_deterministic(sf::SFunc)::Bool</code></li><li><code>sample(sf::SFunc{I,O}, i::I)::O where {I,O}</code></li><li><code>sample_logcpdf(sf::SFunc{I,O}, i::I)::Tuple{O, AbstractFloat} where {I,O}</code></li><li><code>invert(sf::SFunc{I,O}, o::O)::I where {I,O}</code></li><li><code>lambda_msg(sf::SFunc{I,O}, i::SFunc{&lt;:Option{Tuple{}}, O})::SFunc{&lt;:Option{Tuple{}}, I} where {I,O}</code></li><li><code>marginalize(sf::SFunc{I,O}, i::SFunc{&lt;:Option{Tuple{}}, I})::SFunc{&lt;:Option{Tuple{}}, O} where {I,O}</code></li><li><code>logcpdf(sf::SFunc{I,O}, i::I, o::O)::AbstractFloat where {I,O}</code></li><li><code>cpdf(sf::SFunc{I,O}, i::I, o::O)::AbstractFloat where {I,O}</code></li><li><code>log_cond_prob_plus_c(sf::SFunc{I,O}, i::I, o::O)::AbstractFloat where {I,O}</code></li><li><code>f_expectation(sf::SFunc{I,O}, i::I, fn::Function) where {I,O}</code></li><li><code>expectation(sf::SFunc{I,O}, i::I)::O where {I,O}</code></li><li><code>variance(sf::SFunc{I,O}, i::I)::O where {I,O}</code></li><li><code>get_params(sf::SFunc{I,O,P})::P where {I,O,P}</code></li><li><code>set_params!(sf::SFunc{I,O,P}, p::P)::SFunc{I,O,P} where {I,O,P}</code></li><li><code>get_score(sf::SFunc{Tuple{I},O}, i::I)::AbstractFloat where {I,O}</code></li><li><code>get_log_score(sf::SFunc{Tuple{I},O}, i::I)::AbstractFloat where {I,O}</code></li><li><code>support(sf::SFunc{I,O},                        parranges::NTuple{N,Vector},                        size::Integer,                        curr::Vector{&lt;:O}) where {I,O,N}</code></li><li><code>support_quality(sf::SFunc, parranges)</code></li><li><code>bounded_probs(sf::SFunc{I,O},                             range::VectorOption{&lt;:O},                             parranges::NTuple{N,Vector})::Tuple{Vector{&lt;:AbstractFloat}, Vector{&lt;:AbstractFloat}} where {I,O,N}</code></li><li><code>make_factors(sf::SFunc{I,O},                           range::VectorOption{&lt;:O},                            parranges::NTuple{N,Vector},                            id,                            parids::Tuple)::Tuple{Vector{&lt;:Scruff.Utils.Factor}, Vector{&lt;:Scruff.Utils.Factor}} where {I,O,N}</code></li><li><code>initial_stats(sf::SFunc)</code></li><li><code>expected_stats(sf::SFunc{I,O},                             range::VectorOption{&lt;:O},                              parranges::NTuple{N,Vector},                             pis::NTuple{M,Dist},                             child_lambda::Score{&lt;:O}) where {I,O,N,M}</code></li><li><code>accumulate_stats(sf::SFunc, existing_stats, new_stats)</code></li><li><code>maximize_stats(sf::SFunc, stats)</code></li><li><code>compute_bel(sf::SFunc{I,O},                         range::VectorOption{&lt;:O},                          pi::Dist{&lt;:O},                          lambda::Score{&lt;:O})::Dist{&lt;:O} where {I,O}</code></li><li><code>compute_lambda(sf::SFunc, range::VectorOption, lambda_msgs::Vector{&lt;:Score})::Score</code></li><li><code>send_pi(sf::SFunc{I,O},                      range::VectorOption{O},                       bel::Dist{O},                       lambda_msg::Score{O})::Dist{&lt;:O} where {I,O}</code></li><li><code>outgoing_pis(sf::SFunc,                           range::VectorOption,                            bel::Dist,                            incoming_lambdas::VectorOption{&lt;:Score})::Vector{&lt;:Dist}</code></li><li><code>outgoing_lambdas(sf::SFunc{I,O},                     lambda::Score{O},                     range::VectorOption{O},                     parranges::NTuple{N,Vector},                     incoming_pis::Tuple)::Vector{&lt;:Score} where {N,I,O}</code></li><li><code>compute_pi(sf::SFunc{I,O},                        range::VectorOption{O},                         parranges::NTuple{N,Vector},                         incoming_pis::Tuple)::Dist{&lt;:O} where {N,I,O}</code></li><li><code>send_lambda(sf::SFunc{I,O},                          lambda::Score{O},                          range::VectorOption{O},                          parranges::NTuple{N,Vector},                          incoming_pis::Tuple,                          parent_idx::Integer)::Score where {N,I,O}</code></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/operators.jl#L1-L69">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Operators.Option" href="#Scruff.Operators.Option"><code>Scruff.Operators.Option</code></a> — <span class="docstring-category">Type</span></header><section><div><p>Option{T} = Union{Nothing, T}</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/operators.jl#L80">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Operators.VectorOption" href="#Scruff.Operators.VectorOption"><code>Scruff.Operators.VectorOption</code></a> — <span class="docstring-category">Type</span></header><section><div><p>VectorOption{T} = Union{Vector{Union{}}, Vector{T}}</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/operators.jl#L78">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Operators.support_quality_from_rank-Tuple{Int64}" href="#Scruff.Operators.support_quality_from_rank-Tuple{Int64}"><code>Scruff.Operators.support_quality_from_rank</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">support_quality_from_rank(rank::Int)</code></pre><p>Convert the rank back into the support quality.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/operators/op_impls.jl#L24-L28">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Operators.support_quality_rank-Tuple{Symbol}" href="#Scruff.Operators.support_quality_rank-Tuple{Symbol}"><code>Scruff.Operators.support_quality_rank</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">support_quality_rank(sq::Symbol)</code></pre><p>Convert the support quality symbol into an integer for comparison.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/operators/op_impls.jl#L13-L17">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../sfuncs/">« Stochastic Functions</a><a class="docs-footer-nextpage" href="../models/">Models »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Tuesday 7 May 2024 20:00">Tuesday 7 May 2024</span>. Using Julia version 1.7.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Operators · Scruff.jl</title><script data-outdated-warner src="../../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../../assets/documenter.js"></script><script src="../../siteinfo.js"></script><script src="../../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../../">Scruff.jl</a></span></div><form class="docs-search" action="../../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../../">Getting Started</a></li><li><a class="tocitem" href="../../tutorial/tutorial/">Tutorial</a></li><li><a class="tocitem" href="../../tutorial/examples/">Examples</a></li><li><span class="tocitem">Library</span><ul><li><a class="tocitem" href="../core/">Core</a></li><li><a class="tocitem" href="../sfuncs/">Stochastic Functions</a></li><li class="is-active"><a class="tocitem" href>Operators</a></li><li><a class="tocitem" href="../models/">Models</a></li><li><a class="tocitem" href="../algorithms/">Algorithms</a></li><li><a class="tocitem" href="../utilities/">Utilities</a></li><li><a class="tocitem" href="../rtutils/">Runtime Utilities</a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Library</a></li><li class="is-active"><a href>Operators</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Operators</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/charles-river-analytics/Scruff.jl/blob/develop/docs/src/lib/operators.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="scruff_operators"><a class="docs-heading-anchor" href="#scruff_operators">Scruff.Operators</a><a id="scruff_operators-1"></a><a class="docs-heading-anchor-permalink" href="#scruff_operators" title="Permalink"></a></h1><article class="docstring"><header><a class="docstring-binding" id="Scruff.Operators" href="#Scruff.Operators"><code>Scruff.Operators</code></a> — <span class="docstring-category">Module</span></header><section><div><p>The <code>Operators</code> module defines the following interfaces for the following operators:</p><ul><li><code>is_deterministic(sf::SFunc)::Bool</code></li><li><code>sample(sf::SFunc{I,O}, i::I)::O where {I,O}</code></li><li><code>sample_logcpdf(sf::SFunc{I,O}, i::I)::Tuple{O, AbstractFloat} where {I,O}</code></li><li><code>invert(sf::SFunc{I,O}, o::O)::I where {I,O}</code></li><li><code>lambda_msg(sf::SFunc{I,O}, i::SFunc{&lt;:Option{Tuple{}}, O})::SFunc{&lt;:Option{Tuple{}}, I} where {I,O}</code></li><li><code>marginalize(sf::SFunc{I,O}, i::SFunc{&lt;:Option{Tuple{}}, I})::SFunc{&lt;:Option{Tuple{}}, O} where {I,O}</code></li><li><code>logcpdf(sf::SFunc{I,O}, i::I, o::O)::AbstractFloat where {I,O}</code></li><li><code>cpdf(sf::SFunc{I,O}, i::I, o::O)::AbstractFloat where {I,O}</code></li><li><code>log_cond_prob_plus_c(sf::SFunc{I,O}, i::I, o::O)::AbstractFloat where {I,O}</code></li><li><code>f_expectation(sf::SFunc{I,O}, i::I, fn::Function) where {I,O}</code></li><li><code>expectation(sf::SFunc{I,O}, i::I)::O where {I,O}</code></li><li><code>variance(sf::SFunc{I,O}, i::I)::O where {I,O}</code></li><li><code>get_params(sf::SFunc{I,O,P})::P where {I,O,P}</code></li><li><code>set_params!(sf::SFunc{I,O,P}, p::P)::SFunc{I,O,P} where {I,O,P}</code></li><li><code>get_score(sf::SFunc{Tuple{I},O}, i::I)::AbstractFloat where {I,O}</code></li><li><code>get_log_score(sf::SFunc{Tuple{I},O}, i::I)::AbstractFloat where {I,O}</code></li><li><code>support(sf::SFunc{I,O},                        parranges::NTuple{N,Vector},                        size::Integer,                        curr::Vector{&lt;:O}) where {I,O,N}</code></li><li><code>support_quality(sf::SFunc, parranges)</code></li><li><code>bounded_probs(sf::SFunc{I,O},                             range::VectorOption{&lt;:O},                             parranges::NTuple{N,Vector})::Tuple{Vector{&lt;:AbstractFloat}, Vector{&lt;:AbstractFloat}} where {I,O,N}</code></li><li><code>make_factors(sf::SFunc{I,O},                           range::VectorOption{&lt;:O},                            parranges::NTuple{N,Vector},                            id,                            parids::Tuple)::Tuple{Vector{&lt;:Scruff.Utils.Factor}, Vector{&lt;:Scruff.Utils.Factor}} where {I,O,N}</code></li><li><code>initial_stats(sf::SFunc)</code></li><li><code>expected_stats(sf::SFunc{I,O},                             range::VectorOption{&lt;:O},                              parranges::NTuple{N,Vector},                             pis::NTuple{M,Dist},                             child_lambda::Score{&lt;:O}) where {I,O,N,M}</code></li><li><code>accumulate_stats(sf::SFunc, existing_stats, new_stats)</code></li><li><code>maximize_stats(sf::SFunc, stats)</code></li><li><code>compute_bel(sf::SFunc{I,O},                         range::VectorOption{&lt;:O},                          pi::Dist{&lt;:O},                          lambda::Score{&lt;:O})::Dist{&lt;:O} where {I,O}</code></li><li><code>compute_lambda(sf::SFunc, range::VectorOption, lambda_msgs::Vector{&lt;:Score})::Score</code></li><li><code>send_pi(sf::SFunc{I,O},                      range::VectorOption{O},                       bel::Dist{O},                       lambda_msg::Score{O})::Dist{&lt;:O} where {I,O}</code></li><li><code>outgoing_pis(sf::SFunc,                           range::VectorOption,                            bel::Dist,                            incoming_lambdas::VectorOption{&lt;:Score})::Vector{&lt;:Dist}</code></li><li><code>outgoing_lambdas(sf::SFunc{I,O},                     lambda::Score{O},                     range::VectorOption{O},                     parranges::NTuple{N,Vector},                     incoming_pis::Tuple)::Vector{&lt;:Score} where {N,I,O}</code></li><li><code>compute_pi(sf::SFunc{I,O},                        range::VectorOption{O},                         parranges::NTuple{N,Vector},                         incoming_pis::Tuple)::Dist{&lt;:O} where {N,I,O}</code></li><li><code>send_lambda(sf::SFunc{I,O},                          lambda::Score{O},                          range::VectorOption{O},                          parranges::NTuple{N,Vector},                          incoming_pis::Tuple,                          parent_idx::Integer)::Score where {N,I,O}</code></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/operators.jl#L1-L69">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Operators.Option" href="#Scruff.Operators.Option"><code>Scruff.Operators.Option</code></a> — <span class="docstring-category">Type</span></header><section><div><p>Option{T} = Union{Nothing, T}</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/operators.jl#L80">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Operators.VectorOption" href="#Scruff.Operators.VectorOption"><code>Scruff.Operators.VectorOption</code></a> — <span class="docstring-category">Type</span></header><section><div><p>VectorOption{T} = Union{Vector{Union{}}, Vector{T}}</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/operators.jl#L78">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Operators.support_quality_from_rank-Tuple{Int64}" href="#Scruff.Operators.support_quality_from_rank-Tuple{Int64}"><code>Scruff.Operators.support_quality_from_rank</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">support_quality_from_rank(rank::Int)</code></pre><p>Convert the rank back into the support quality.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/operators/op_impls.jl#L24-L28">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Operators.support_quality_rank-Tuple{Symbol}" href="#Scruff.Operators.support_quality_rank-Tuple{Symbol}"><code>Scruff.Operators.support_quality_rank</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">support_quality_rank(sq::Symbol)</code></pre><p>Convert the support quality symbol into an integer for comparison.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/operators/op_impls.jl#L13-L17">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../sfuncs/">« Stochastic Functions</a><a class="docs-footer-nextpage" href="../models/">Models »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Wednesday 15 May 2024 16:16">Wednesday 15 May 2024</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/dev/lib/rtutils/index.html b/dev/lib/rtutils/index.html
index 155cbf7..a8f1bc2 100644
--- a/dev/lib/rtutils/index.html
+++ b/dev/lib/rtutils/index.html
@@ -1,8 +1,8 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Runtime Utilities · Scruff.jl</title><script data-outdated-warner src="../../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../../assets/documenter.js"></script><script src="../../siteinfo.js"></script><script src="../../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../../">Scruff.jl</a></span></div><form class="docs-search" action="../../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../../">Getting Started</a></li><li><a class="tocitem" href="../../tutorial/tutorial/">Tutorial</a></li><li><a class="tocitem" href="../../tutorial/examples/">Examples</a></li><li><span class="tocitem">Library</span><ul><li><a class="tocitem" href="../core/">Core</a></li><li><a class="tocitem" href="../sfuncs/">Stochastic Functions</a></li><li><a class="tocitem" href="../operators/">Operators</a></li><li><a class="tocitem" href="../models/">Models</a></li><li><a class="tocitem" href="../algorithms/">Algorithms</a></li><li><a class="tocitem" href="../utilities/">Utilities</a></li><li class="is-active"><a class="tocitem" href>Runtime Utilities</a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Library</a></li><li class="is-active"><a href>Runtime Utilities</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Runtime Utilities</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/charles-river-analytics/Scruff.jl/blob/develop/docs/src/lib/rtutils.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="scruff_rtutils"><a class="docs-heading-anchor" href="#scruff_rtutils">Scruff.RTUtils</a><a id="scruff_rtutils-1"></a><a class="docs-heading-anchor-permalink" href="#scruff_rtutils" title="Permalink"></a></h1><article class="docstring"><header><a class="docstring-binding" id="Scruff.RTUtils.RANGE" href="#Scruff.RTUtils.RANGE"><code>Scruff.RTUtils.RANGE</code></a> — <span class="docstring-category">Constant</span></header><section><div><pre><code class="language-julia hljs">RANGE</code></pre><p>The constant key used to store the range of a specific variable instance </p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/utils/range_utils.jl#L39-L43">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.RTUtils.default_initializer" href="#Scruff.RTUtils.default_initializer"><code>Scruff.RTUtils.default_initializer</code></a> — <span class="docstring-category">Function</span></header><section><div><p>Deprecated</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/utils/initializer.jl#L6-L8">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.RTUtils.expander_range-Tuple{Runtime, Variable, Int64, Int64}" href="#Scruff.RTUtils.expander_range-Tuple{Runtime, Variable, Int64, Int64}"><code>Scruff.RTUtils.expander_range</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">function expander_range(runtime :: Runtime, v :: Variable,
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Runtime Utilities · Scruff.jl</title><script data-outdated-warner src="../../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../../assets/documenter.js"></script><script src="../../siteinfo.js"></script><script src="../../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../../">Scruff.jl</a></span></div><form class="docs-search" action="../../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../../">Getting Started</a></li><li><a class="tocitem" href="../../tutorial/tutorial/">Tutorial</a></li><li><a class="tocitem" href="../../tutorial/examples/">Examples</a></li><li><span class="tocitem">Library</span><ul><li><a class="tocitem" href="../core/">Core</a></li><li><a class="tocitem" href="../sfuncs/">Stochastic Functions</a></li><li><a class="tocitem" href="../operators/">Operators</a></li><li><a class="tocitem" href="../models/">Models</a></li><li><a class="tocitem" href="../algorithms/">Algorithms</a></li><li><a class="tocitem" href="../utilities/">Utilities</a></li><li class="is-active"><a class="tocitem" href>Runtime Utilities</a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Library</a></li><li class="is-active"><a href>Runtime Utilities</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Runtime Utilities</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/charles-river-analytics/Scruff.jl/blob/develop/docs/src/lib/rtutils.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="scruff_rtutils"><a class="docs-heading-anchor" href="#scruff_rtutils">Scruff.RTUtils</a><a id="scruff_rtutils-1"></a><a class="docs-heading-anchor-permalink" href="#scruff_rtutils" title="Permalink"></a></h1><article class="docstring"><header><a class="docstring-binding" id="Scruff.RTUtils.RANGE" href="#Scruff.RTUtils.RANGE"><code>Scruff.RTUtils.RANGE</code></a> — <span class="docstring-category">Constant</span></header><section><div><pre><code class="language-julia hljs">RANGE</code></pre><p>The constant key used to store the range of a specific variable instance </p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/utils/range_utils.jl#L39-L43">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.RTUtils.default_initializer" href="#Scruff.RTUtils.default_initializer"><code>Scruff.RTUtils.default_initializer</code></a> — <span class="docstring-category">Function</span></header><section><div><p>Deprecated</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/utils/initializer.jl#L6-L8">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.RTUtils.expander_range-Tuple{Runtime, Variable, Int64, Int64}" href="#Scruff.RTUtils.expander_range-Tuple{Runtime, Variable, Int64, Int64}"><code>Scruff.RTUtils.expander_range</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">function expander_range(runtime :: Runtime, v :: Variable,
     target_size :: Int, depth :: Int)
 
-Recursively compute the range of the expander and subnetworks up to the given depth.</code></pre><p>Computing the range of the expander expands enough of the parent           range to reach the desired target size, or expands all the parents fully.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/utils/range_utils.jl#L230-L238">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.RTUtils.get_range" href="#Scruff.RTUtils.get_range"><code>Scruff.RTUtils.get_range</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">get_range(runtime::Runtime, inst::Instance, depth = max_value(Int))</code></pre><p>Returns the range value for the given instance; this will return <code>nothing</code> if no range has been set.</p><p>The depth specifies the maximum depth of range desired.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/utils/range_utils.jl#L78-L85">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.RTUtils.get_range-Union{Tuple{O}, Tuple{InstantRuntime, Node{O}}, Tuple{InstantRuntime, Node{O}, Any}} where O" href="#Scruff.RTUtils.get_range-Union{Tuple{O}, Tuple{InstantRuntime, Node{O}}, Tuple{InstantRuntime, Node{O}, Any}} where O"><code>Scruff.RTUtils.get_range</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_range(runtime::InstantRuntime, v::Node{O}, depth = 1) where O</code></pre><p>Returns the range of the given node.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/utils/range_utils.jl#L127-L131">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.RTUtils.get_range-Union{Tuple{O}, Tuple{J}, Tuple{I}, Tuple{DynamicRuntime, Variable{I, J, O}}, Tuple{DynamicRuntime, Variable{I, J, O}, Any}} where {I, J, O}" href="#Scruff.RTUtils.get_range-Union{Tuple{O}, Tuple{J}, Tuple{I}, Tuple{DynamicRuntime, Variable{I, J, O}}, Tuple{DynamicRuntime, Variable{I, J, O}, Any}} where {I, J, O}"><code>Scruff.RTUtils.get_range</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_range(runtime::DynamicRuntime, v::Variable{I,J,O}, depth = 1) where {I,J,O}</code></pre><p>Returns the range of the most recent instance of the given variable.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/utils/range_utils.jl#L105-L109">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.RTUtils.parent_ranges-Union{Tuple{O}, Tuple{J}, Tuple{I}, Tuple{Runtime, Variable{I, J, O}}, Tuple{Runtime, Variable{I, J, O}, Any}} where {I, J, O}" href="#Scruff.RTUtils.parent_ranges-Union{Tuple{O}, Tuple{J}, Tuple{I}, Tuple{Runtime, Variable{I, J, O}}, Tuple{Runtime, Variable{I, J, O}, Any}} where {I, J, O}"><code>Scruff.RTUtils.parent_ranges</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">parent_ranges(runtime::Runtime, var::Variable{I,J,O}, depth = typemax(Int)) where {I,J,O}</code></pre><p>Returns the ranges of the parents of the given variable.</p><p>See <a href="lib/@ref"><code>Scruff.get_range</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/utils/range_utils.jl#L19-L25">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.RTUtils.set_range!-Union{Tuple{O}, Tuple{Runtime, Instance{O}, Vector{&lt;:O}}, Tuple{Runtime, Instance{O}, Vector{&lt;:O}, Int64}} where O" href="#Scruff.RTUtils.set_range!-Union{Tuple{O}, Tuple{Runtime, Instance{O}, Vector{&lt;:O}}, Tuple{Runtime, Instance{O}, Vector{&lt;:O}, Int64}} where O"><code>Scruff.RTUtils.set_range!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">set_range!(runtime::Runtime, inst::Instance{O}, range::Vector{&lt;:O}, depth::Int = 1) where O</code></pre><p>Sets the range value for the given instance. Defaults to depth of 1.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/utils/range_utils.jl#L46-L50">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.RTUtils.set_ranges!" href="#Scruff.RTUtils.set_ranges!"><code>Scruff.RTUtils.set_ranges!</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">set_ranges!(runtime::InstantRuntime, evidence = Dict{Symbol, Score}(),
+Recursively compute the range of the expander and subnetworks up to the given depth.</code></pre><p>Computing the range of the expander expands enough of the parent           range to reach the desired target size, or expands all the parents fully.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/utils/range_utils.jl#L230-L238">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.RTUtils.get_range" href="#Scruff.RTUtils.get_range"><code>Scruff.RTUtils.get_range</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">get_range(runtime::Runtime, inst::Instance, depth = max_value(Int))</code></pre><p>Returns the range value for the given instance; this will return <code>nothing</code> if no range has been set.</p><p>The depth specifies the maximum depth of range desired.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/utils/range_utils.jl#L78-L85">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.RTUtils.get_range-Union{Tuple{O}, Tuple{InstantRuntime, Node{O}}, Tuple{InstantRuntime, Node{O}, Any}} where O" href="#Scruff.RTUtils.get_range-Union{Tuple{O}, Tuple{InstantRuntime, Node{O}}, Tuple{InstantRuntime, Node{O}, Any}} where O"><code>Scruff.RTUtils.get_range</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_range(runtime::InstantRuntime, v::Node{O}, depth = 1) where O</code></pre><p>Returns the range of the given node.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/utils/range_utils.jl#L127-L131">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.RTUtils.get_range-Union{Tuple{O}, Tuple{J}, Tuple{I}, Tuple{DynamicRuntime, Variable{I, J, O}}, Tuple{DynamicRuntime, Variable{I, J, O}, Any}} where {I, J, O}" href="#Scruff.RTUtils.get_range-Union{Tuple{O}, Tuple{J}, Tuple{I}, Tuple{DynamicRuntime, Variable{I, J, O}}, Tuple{DynamicRuntime, Variable{I, J, O}, Any}} where {I, J, O}"><code>Scruff.RTUtils.get_range</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">get_range(runtime::DynamicRuntime, v::Variable{I,J,O}, depth = 1) where {I,J,O}</code></pre><p>Returns the range of the most recent instance of the given variable.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/utils/range_utils.jl#L105-L109">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.RTUtils.parent_ranges-Union{Tuple{O}, Tuple{J}, Tuple{I}, Tuple{Runtime, Variable{I, J, O}}, Tuple{Runtime, Variable{I, J, O}, Any}} where {I, J, O}" href="#Scruff.RTUtils.parent_ranges-Union{Tuple{O}, Tuple{J}, Tuple{I}, Tuple{Runtime, Variable{I, J, O}}, Tuple{Runtime, Variable{I, J, O}, Any}} where {I, J, O}"><code>Scruff.RTUtils.parent_ranges</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">parent_ranges(runtime::Runtime, var::Variable{I,J,O}, depth = typemax(Int)) where {I,J,O}</code></pre><p>Returns the ranges of the parents of the given variable.</p><p>See <a href="lib/@ref"><code>Scruff.get_range</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/utils/range_utils.jl#L19-L25">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.RTUtils.set_range!-Union{Tuple{O}, Tuple{Runtime, Instance{O}, Vector{&lt;:O}}, Tuple{Runtime, Instance{O}, Vector{&lt;:O}, Int64}} where O" href="#Scruff.RTUtils.set_range!-Union{Tuple{O}, Tuple{Runtime, Instance{O}, Vector{&lt;:O}}, Tuple{Runtime, Instance{O}, Vector{&lt;:O}, Int64}} where O"><code>Scruff.RTUtils.set_range!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">set_range!(runtime::Runtime, inst::Instance{O}, range::Vector{&lt;:O}, depth::Int = 1) where O</code></pre><p>Sets the range value for the given instance. Defaults to depth of 1.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/utils/range_utils.jl#L46-L50">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.RTUtils.set_ranges!" href="#Scruff.RTUtils.set_ranges!"><code>Scruff.RTUtils.set_ranges!</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">set_ranges!(runtime::InstantRuntime, evidence = Dict{Symbol, Score}(),
     size = 10, depth = 1, 
     order = topsort(get_initial_graph(get_network(runtime))),
-    placeholder_beliefs = get_placeholder_beliefs(runtime))</code></pre><p>Set the ranges of all current instances in the runtime.</p><p>This method first checks whether ranges exist for the runtime at the desired depth, with the desired range size, and with the same evidence. If so, it doesn&#39;t do anything. If the depth is less than 1, it doesn&#39;t do anything. Otherwise, it uses the support operator to compute ranges of variables in order. Placeholders should have ranges set already in <code>placeholder_beliefs</code>. For expanders, it recursively sets the ranges of the subnetworks at depth - 1.</p><p>Returns a flag indicating whether any instance has a changed range.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/utils/range_utils.jl#L142-L158">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../utilities/">« Utilities</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Tuesday 7 May 2024 20:00">Tuesday 7 May 2024</span>. Using Julia version 1.7.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+    placeholder_beliefs = get_placeholder_beliefs(runtime))</code></pre><p>Set the ranges of all current instances in the runtime.</p><p>This method first checks whether ranges exist for the runtime at the desired depth, with the desired range size, and with the same evidence. If so, it doesn&#39;t do anything. If the depth is less than 1, it doesn&#39;t do anything. Otherwise, it uses the support operator to compute ranges of variables in order. Placeholders should have ranges set already in <code>placeholder_beliefs</code>. For expanders, it recursively sets the ranges of the subnetworks at depth - 1.</p><p>Returns a flag indicating whether any instance has a changed range.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/utils/range_utils.jl#L142-L158">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../utilities/">« Utilities</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Wednesday 15 May 2024 16:16">Wednesday 15 May 2024</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/dev/lib/sfuncs/index.html b/dev/lib/sfuncs/index.html
index c9a4912..8d443da 100644
--- a/dev/lib/sfuncs/index.html
+++ b/dev/lib/sfuncs/index.html
@@ -1,11 +1,11 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Stochastic Functions · Scruff.jl</title><script data-outdated-warner src="../../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../../assets/documenter.js"></script><script src="../../siteinfo.js"></script><script src="../../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../../">Scruff.jl</a></span></div><form class="docs-search" action="../../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../../">Getting Started</a></li><li><a class="tocitem" href="../../tutorial/tutorial/">Tutorial</a></li><li><a class="tocitem" href="../../tutorial/examples/">Examples</a></li><li><span class="tocitem">Library</span><ul><li><a class="tocitem" href="../core/">Core</a></li><li class="is-active"><a class="tocitem" href>Stochastic Functions</a></li><li><a class="tocitem" href="../operators/">Operators</a></li><li><a class="tocitem" href="../models/">Models</a></li><li><a class="tocitem" href="../algorithms/">Algorithms</a></li><li><a class="tocitem" href="../utilities/">Utilities</a></li><li><a class="tocitem" href="../rtutils/">Runtime Utilities</a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Library</a></li><li class="is-active"><a href>Stochastic Functions</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Stochastic Functions</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/charles-river-analytics/Scruff.jl/blob/develop/docs/src/lib/sfuncs.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="scruff_sfuncs"><a class="docs-heading-anchor" href="#scruff_sfuncs">Scruff.SFuncs</a><a id="scruff_sfuncs-1"></a><a class="docs-heading-anchor-permalink" href="#scruff_sfuncs" title="Permalink"></a></h1><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Apply" href="#Scruff.SFuncs.Apply"><code>Scruff.SFuncs.Apply</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Apply{J, O} &lt;: SFunc{Tuple{SFunc{J, O}, J}, O}</code></pre><p>Apply represents an sfunc that takes two groups of arguments.  The first group is a single argument, which is an sfunc to apply to the second group of arguments.</p><p><strong>Additional supported operators</strong></p><ul><li><code>support</code></li><li><code>support_quality</code></li><li><code>sample</code></li><li><code>logcpdf</code></li><li><code>compute_pi</code></li><li><code>send_lambda</code></li></ul><p><strong>Type parameters</strong></p><ul><li><code>J</code>: the input type of the <em>sfunc</em> that may be applied; that <em>sfunc</em> is the input type of the <code>Apply</code></li><li><code>O</code>: the output type of the <em>sfunc</em> that may be applied, which is also the output type of the <code>Apply</code></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/compound/apply.jl#L3-L20">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Cat" href="#Scruff.SFuncs.Cat"><code>Scruff.SFuncs.Cat</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">mutable struct Cat{O} &lt;: Dist{O, Vector{Real}}</code></pre><p><code>Cat</code> defines an sfunc that represents a set of categorical output values that are not conditioned on any input.  Its parameters are always of type <code>Vector{Real}</code>, which is the probability of each output value.</p><p><strong>Supported operations</strong></p><ul><li><code>support</code></li><li><code>support_quality</code></li><li><code>sample</code></li><li><code>cpdf</code></li><li><code>bounded_probs</code></li><li><code>compute_pi</code></li><li><code>f_expectation</code></li></ul><p><strong>Type parameters</strong></p><ul><li><code>O</code>: the output type of the <code>Cat</code></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/dist/cat.jl#L32-L50">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Chain" href="#Scruff.SFuncs.Chain"><code>Scruff.SFuncs.Chain</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Chain{I, J, K, O} &lt;: Conditional{I, J, K, O, Nothing, Q, SFunc{J, O, Nothing}}</code></pre><p>A <code>Conditional</code> that chains its input <code>I</code> through a given function that returns an  <code>SFunc{J,O}</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/compound/chain.jl#L3-L8">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Conditional" href="#Scruff.SFuncs.Conditional"><code>Scruff.SFuncs.Conditional</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type Conditional{I &lt;: Tuple, J &lt;: Tuple, K &lt;: Tuple, O, S &lt;: SFunc{J, O}} &lt;: SFunc{K, O}</code></pre><p><code>Conditional</code> <em>sfuncs</em> represent the generation of an sfunc depending on the values of parents.  An subtype of <code>Conditional</code> must provide a <code>gensf</code> method that takes an <code>I</code> and returns an  <code>SFunc{J,O}</code> (<strong>important</strong> the generated SFunc must not appear outside the Conditional.  It should not be a parent).</p><p><strong>Additional supported operators</strong></p><ul><li><code>support</code></li><li><code>support_quality</code></li><li><code>sample</code></li><li><code>logcpdf</code></li><li><code>make_factors</code></li><li><code>compute_pi</code></li><li><code>send_lambda</code></li></ul><p><strong>Type parameters</strong></p><ul><li><code>I</code>: the type of data used to generate the <code>Conditional</code>&#39;s <em>sfunc</em></li><li><code>J</code>: a tuple that represents the input types (the <code>I</code>) of the <code>Conditional</code>&#39;s generated <em>sfunc</em></li><li><code>K</code>: the input types of the <code>Conditional</code>; this is a tuple of types constructed from <code>I</code>, </li></ul><p>and <code>J</code> using <code>extend_tuple_types</code></p><ul><li><code>O</code>: the output type(s) of both the <code>Conditional</code> and the <code>Conditional</code>&#39;s generated <em>sfunc</em></li><li><code>S</code>: the type of the <code>Conditional</code>&#39;s generated <em>sfunc</em></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/conddist/conditional.jl#L45-L70">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Constant" href="#Scruff.SFuncs.Constant"><code>Scruff.SFuncs.Constant</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">mutable struct Constant{O} &lt;: Dist{O,Nothing}</code></pre><p><code>Constant</code> represents an sfunc that always produces the same value.  It has no inputs and no parameters.</p><p><strong>Additional supported operators</strong></p><ul><li><code>support</code></li><li><code>support_quality</code></li><li><code>sample</code></li><li><code>logcpdf</code></li><li><code>bounded_probs</code></li><li><code>compute_pi</code></li></ul><p><strong>Type parameters</strong></p><ul><li><code>O</code>: the output type(s) of the <code>Constant</code></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/dist/constant.jl#L4-L20">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Det" href="#Scruff.SFuncs.Det"><code>Scruff.SFuncs.Det</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type Det{I, O} &lt;: SFunc{I, O}</code></pre><p><code>Det</code> defines an <em>sfunc</em> that represents a deterministic function <code>I -&gt; O</code>.  When a <code>Det</code> is subtyped, a function <code>apply(d::Det, i::I)::O</code> or <code>apply(d::Det, i::I...)::O</code> must also be implemented.  It has no parameters.</p><p><strong>Additional supported operators</strong></p><ul><li><code>support</code></li><li><code>support_quality</code></li><li><code>sample</code></li><li><code>logcpdf</code></li><li><code>bounded_probs</code></li><li><code>make_factors</code></li><li><code>compute_pi</code></li><li><code>send_lambda</code></li></ul><p><strong>Type parameters</strong></p><ul><li><code>I</code>: the input type(s) of the <code>Det</code></li><li><code>O</code>: the output type(s) of the <code>Det</code></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/conddist/det.jl#L8-L26">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Expander" href="#Scruff.SFuncs.Expander"><code>Scruff.SFuncs.Expander</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">mutable struct Expander{I,O} &lt;: SFunc{I,O}</code></pre><p>An Expander represents a model defined by a function that returns a network. For a given value of an input, the conditional probability distribution is provided by the network produced by the function on that input.</p><p>For each such network, the expander manages a runtime to reason about it. Expanders are lazy and do not evaluate the function until they have to.</p><p>As a result, there is state associated with Expanders. This is analysis state rather than world state, i.e., it is the state of Scruff&#39;s reasoning about the Expander. In keeping with Scruff design, Expanders are immutable and all state associated with reasoning is stored in the runtime that contains the expander. To support this, a runtime has three fields of global state:</p><ul><li><code>:subnets</code>: the expansions of all Expanders managed by the runtime</li><li><code>:subruntimes</code>: all the subruntimes recursively managed by this runtime through Expanders, keyed by the networks</li><li><code>:depth</code>: the depth to which Expanders in this runtime should be expanded</li></ul><p><strong>Type parameters</strong></p><ul><li><code>I</code>: the input type(s) of the <code>Expander</code></li><li><code>O</code>: the output type(s) of the <code>Expander</code></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/compound/expander.jl#L5-L31">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.ExplicitDet" href="#Scruff.SFuncs.ExplicitDet"><code>Scruff.SFuncs.ExplicitDet</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct ExplicitDet{I, O} &lt;: Det{I, O}</code></pre><p><code>ExplicitDet</code> is a <code>Det</code> that contains a field <code>f::Function</code>.  It also has an <code>apply</code> method that simply delegates to the <code>ExplicitDet</code>&#39;s function:</p><pre><code class="nohighlight hljs">    apply(d::ExplicitDet, i...) = d.f(i...)</code></pre><pre><code class="nohighlight hljs">julia&gt; d = ExplicitDet{Tuple{Vararg{Real}},Real}(sum)
-ExplicitDet{Tuple{Vararg{Real, N} where N}, Real}(sum)</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/conddist/det.jl#L29-L40">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Extend" href="#Scruff.SFuncs.Extend"><code>Scruff.SFuncs.Extend</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Extend{I&lt;:Tuple{Any},J,O} &lt;: SFunc{J,O}</code></pre><p><code>Extend</code> defines an sfunc that extend the input of another sfunc. Useful for defining Separable SFuncs.</p><p><strong>Additional supported operators</strong></p><ul><li><code>support</code></li><li><code>support_quality</code></li><li><code>sample</code></li><li><code>logcpdf</code></li><li><code>bounded_probs</code></li><li><code>make_factors</code></li><li><code>compute_pi</code></li><li><code>send_lambda</code></li></ul><p><strong>Type parameters</strong></p><ul><li><code>I</code>: the input type(s) of the extended <em>sfunc</em>; it must be a tuple of length 1</li><li><code>J</code>: the input type(s) of the <code>Extend</code></li><li><code>O</code>: the output type(s) of both the <code>Extend</code> and the extended <em>sfunc</em> </li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/util/extend.jl#L3-L23">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.FunctionalScore" href="#Scruff.SFuncs.FunctionalScore"><code>Scruff.SFuncs.FunctionalScore</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct FunctionalScore{I} &lt;: Score{I}</code></pre><p>A score defined by a function.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/score/functionalscore.jl#L3-L7">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Generate" href="#Scruff.SFuncs.Generate"><code>Scruff.SFuncs.Generate</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Generate{O} &lt;: SFunc{Tuple{Dist{O}}, O}</code></pre><p>Generate a value from its <code>Dist</code> argument.</p><p>This helps in higher-order programming. A typical pattern will be to create an sfunc that produces a <code>Dist</code>, and then generate many observations from the <code>Dist</code> using <code>Generate</code>.</p><p><strong>Additional supported operators</strong></p><ul><li><code>support</code></li><li><code>support_quality</code></li><li><code>sample</code></li><li><code>logcpdf</code></li><li><code>compute_pi</code></li><li><code>send_lambda</code></li><li><code>make_factors</code></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/compound/generate.jl#L5-L21">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.HardScore" href="#Scruff.SFuncs.HardScore"><code>Scruff.SFuncs.HardScore</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">HardScore{I} &lt;: Score{I}</code></pre><p>A fixed score.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/score/hardscore.jl#L3-L7">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Invertible" href="#Scruff.SFuncs.Invertible"><code>Scruff.SFuncs.Invertible</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Invertible{I,O} &lt;: SFunc{Tuple{I},O}</code></pre><p>An invertible sfunc, with both a <code>forward</code> and a <code>inverse</code> function provided.</p><p><strong>Additional supported operators</strong></p><ul><li><code>support</code></li><li><code>support_quality</code></li><li><code>sample</code></li><li><code>logcpdf</code></li><li><code>bounded_probs</code></li><li><code>make_factors</code></li><li><code>compute_pi</code></li><li><code>send_lambda</code></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/conddist/invertible.jl#L4-L18">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.LinearGaussian" href="#Scruff.SFuncs.LinearGaussian"><code>Scruff.SFuncs.LinearGaussian</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">mutable struct LinearGaussian{I &lt;: Tuple{Vararg{Float64}}} &lt;: 
-    Conditional{I, Tuple{}, I, Float64, Normal}</code></pre><p><code>LinearGaussian</code> defines an sfunc whose mean is a linear function of its parents.  A  <code>LinearGaussian</code>&#39;s output type is a <code>Float</code>, its parameter type is  <code>Tuple{I, Float64, Float64}</code>, and it&#39;s contained <em>sfunc</em> is a <code>Normal</code> mean <code>0.0</code>.</p><p><strong>Type parameters</strong></p><ul><li><code>I</code>: the input type(s) of the <code>LinearGaussian</code></li></ul><p>See also: <a href="#Scruff.SFuncs.Conditional"><code>Conditional</code></a>, <a href="lib/@ref"><code>Normal</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/conddist/lineargaussian.jl#L3-L15">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.LogScore" href="#Scruff.SFuncs.LogScore"><code>Scruff.SFuncs.LogScore</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct LogScore{I} &lt;: Score{I}</code></pre><p>A Log score.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/score/logscore.jl#L3-L7">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Mixture" href="#Scruff.SFuncs.Mixture"><code>Scruff.SFuncs.Mixture</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">mutable struct Mixture{I,O} &lt;: SFunc{I,O}</code></pre><p><code>Mixture</code> defines an <em>sfunc</em> representing mixtures of other <em>sfuncs</em>.  It contains a  vector of <em>sfuncs</em> and a vector of probabilities that those <em>sfuncs</em> are selected,  which indices are keys associating the two.  The output type of a <code>Mixture</code> is defined by the output type of its internal components.  The parameters of a <code>Mixture</code> are its probabilities followed by parameters of all its internal components, in order. </p><p><strong>Additional supported operators</strong></p><ul><li><code>support</code></li><li><code>support_quality</code></li><li><code>sample</code></li><li><code>cpdf</code></li><li><code>expectation</code></li><li><code>compute_pi</code></li><li><code>send_lambda</code></li></ul><p><strong>Type parameters</strong></p><ul><li><code>I</code>: the input type(s) of the <code>Mixture</code></li><li><code>O</code>: the shared output type(s) of its internal components and the output type(s) of the <code>Mixture</code></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/compound/mixture.jl#L3-L24">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.NetworkSFunc" href="#Scruff.SFuncs.NetworkSFunc"><code>Scruff.SFuncs.NetworkSFunc</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct NetworkSFunc{I,O} &lt;: SFunc{I,O}</code></pre><p>An sfunc that combines multiple sfuncs in a network structure.</p><p><strong>Arguments</strong></p><pre><code class="nohighlight hljs">input_placeholders A vector of placeholders indicating the types of network inputs. The type parameter `I` is computed from these.
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Stochastic Functions · Scruff.jl</title><script data-outdated-warner src="../../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../../assets/documenter.js"></script><script src="../../siteinfo.js"></script><script src="../../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../../">Scruff.jl</a></span></div><form class="docs-search" action="../../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../../">Getting Started</a></li><li><a class="tocitem" href="../../tutorial/tutorial/">Tutorial</a></li><li><a class="tocitem" href="../../tutorial/examples/">Examples</a></li><li><span class="tocitem">Library</span><ul><li><a class="tocitem" href="../core/">Core</a></li><li class="is-active"><a class="tocitem" href>Stochastic Functions</a></li><li><a class="tocitem" href="../operators/">Operators</a></li><li><a class="tocitem" href="../models/">Models</a></li><li><a class="tocitem" href="../algorithms/">Algorithms</a></li><li><a class="tocitem" href="../utilities/">Utilities</a></li><li><a class="tocitem" href="../rtutils/">Runtime Utilities</a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Library</a></li><li class="is-active"><a href>Stochastic Functions</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Stochastic Functions</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/charles-river-analytics/Scruff.jl/blob/develop/docs/src/lib/sfuncs.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="scruff_sfuncs"><a class="docs-heading-anchor" href="#scruff_sfuncs">Scruff.SFuncs</a><a id="scruff_sfuncs-1"></a><a class="docs-heading-anchor-permalink" href="#scruff_sfuncs" title="Permalink"></a></h1><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Apply" href="#Scruff.SFuncs.Apply"><code>Scruff.SFuncs.Apply</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Apply{J, O} &lt;: SFunc{Tuple{SFunc{J, O}, J}, O}</code></pre><p>Apply represents an sfunc that takes two groups of arguments.  The first group is a single argument, which is an sfunc to apply to the second group of arguments.</p><p><strong>Additional supported operators</strong></p><ul><li><code>support</code></li><li><code>support_quality</code></li><li><code>sample</code></li><li><code>logcpdf</code></li><li><code>compute_pi</code></li><li><code>send_lambda</code></li></ul><p><strong>Type parameters</strong></p><ul><li><code>J</code>: the input type of the <em>sfunc</em> that may be applied; that <em>sfunc</em> is the input type of the <code>Apply</code></li><li><code>O</code>: the output type of the <em>sfunc</em> that may be applied, which is also the output type of the <code>Apply</code></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/compound/apply.jl#L3-L20">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Cat" href="#Scruff.SFuncs.Cat"><code>Scruff.SFuncs.Cat</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">mutable struct Cat{O} &lt;: Dist{O, Vector{Real}}</code></pre><p><code>Cat</code> defines an sfunc that represents a set of categorical output values that are not conditioned on any input.  Its parameters are always of type <code>Vector{Real}</code>, which is the probability of each output value.</p><p><strong>Supported operations</strong></p><ul><li><code>support</code></li><li><code>support_quality</code></li><li><code>sample</code></li><li><code>cpdf</code></li><li><code>bounded_probs</code></li><li><code>compute_pi</code></li><li><code>f_expectation</code></li></ul><p><strong>Type parameters</strong></p><ul><li><code>O</code>: the output type of the <code>Cat</code></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/dist/cat.jl#L32-L50">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Chain" href="#Scruff.SFuncs.Chain"><code>Scruff.SFuncs.Chain</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Chain{I, J, K, O} &lt;: Conditional{I, J, K, O, Nothing, Q, SFunc{J, O, Nothing}}</code></pre><p>A <code>Conditional</code> that chains its input <code>I</code> through a given function that returns an  <code>SFunc{J,O}</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/compound/chain.jl#L3-L8">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Conditional" href="#Scruff.SFuncs.Conditional"><code>Scruff.SFuncs.Conditional</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type Conditional{I &lt;: Tuple, J &lt;: Tuple, K &lt;: Tuple, O, S &lt;: SFunc{J, O}} &lt;: SFunc{K, O}</code></pre><p><code>Conditional</code> <em>sfuncs</em> represent the generation of an sfunc depending on the values of parents.  An subtype of <code>Conditional</code> must provide a <code>gensf</code> method that takes an <code>I</code> and returns an  <code>SFunc{J,O}</code> (<strong>important</strong> the generated SFunc must not appear outside the Conditional.  It should not be a parent).</p><p><strong>Additional supported operators</strong></p><ul><li><code>support</code></li><li><code>support_quality</code></li><li><code>sample</code></li><li><code>logcpdf</code></li><li><code>make_factors</code></li><li><code>compute_pi</code></li><li><code>send_lambda</code></li></ul><p><strong>Type parameters</strong></p><ul><li><code>I</code>: the type of data used to generate the <code>Conditional</code>&#39;s <em>sfunc</em></li><li><code>J</code>: a tuple that represents the input types (the <code>I</code>) of the <code>Conditional</code>&#39;s generated <em>sfunc</em></li><li><code>K</code>: the input types of the <code>Conditional</code>; this is a tuple of types constructed from <code>I</code>, </li></ul><p>and <code>J</code> using <code>extend_tuple_types</code></p><ul><li><code>O</code>: the output type(s) of both the <code>Conditional</code> and the <code>Conditional</code>&#39;s generated <em>sfunc</em></li><li><code>S</code>: the type of the <code>Conditional</code>&#39;s generated <em>sfunc</em></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/conddist/conditional.jl#L45-L70">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Constant" href="#Scruff.SFuncs.Constant"><code>Scruff.SFuncs.Constant</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">mutable struct Constant{O} &lt;: Dist{O,Nothing}</code></pre><p><code>Constant</code> represents an sfunc that always produces the same value.  It has no inputs and no parameters.</p><p><strong>Additional supported operators</strong></p><ul><li><code>support</code></li><li><code>support_quality</code></li><li><code>sample</code></li><li><code>logcpdf</code></li><li><code>bounded_probs</code></li><li><code>compute_pi</code></li></ul><p><strong>Type parameters</strong></p><ul><li><code>O</code>: the output type(s) of the <code>Constant</code></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/dist/constant.jl#L4-L20">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Det" href="#Scruff.SFuncs.Det"><code>Scruff.SFuncs.Det</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type Det{I, O} &lt;: SFunc{I, O}</code></pre><p><code>Det</code> defines an <em>sfunc</em> that represents a deterministic function <code>I -&gt; O</code>.  When a <code>Det</code> is subtyped, a function <code>apply(d::Det, i::I)::O</code> or <code>apply(d::Det, i::I...)::O</code> must also be implemented.  It has no parameters.</p><p><strong>Additional supported operators</strong></p><ul><li><code>support</code></li><li><code>support_quality</code></li><li><code>sample</code></li><li><code>logcpdf</code></li><li><code>bounded_probs</code></li><li><code>make_factors</code></li><li><code>compute_pi</code></li><li><code>send_lambda</code></li></ul><p><strong>Type parameters</strong></p><ul><li><code>I</code>: the input type(s) of the <code>Det</code></li><li><code>O</code>: the output type(s) of the <code>Det</code></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/conddist/det.jl#L8-L26">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Expander" href="#Scruff.SFuncs.Expander"><code>Scruff.SFuncs.Expander</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">mutable struct Expander{I,O} &lt;: SFunc{I,O}</code></pre><p>An Expander represents a model defined by a function that returns a network. For a given value of an input, the conditional probability distribution is provided by the network produced by the function on that input.</p><p>For each such network, the expander manages a runtime to reason about it. Expanders are lazy and do not evaluate the function until they have to.</p><p>As a result, there is state associated with Expanders. This is analysis state rather than world state, i.e., it is the state of Scruff&#39;s reasoning about the Expander. In keeping with Scruff design, Expanders are immutable and all state associated with reasoning is stored in the runtime that contains the expander. To support this, a runtime has three fields of global state:</p><ul><li><code>:subnets</code>: the expansions of all Expanders managed by the runtime</li><li><code>:subruntimes</code>: all the subruntimes recursively managed by this runtime through Expanders, keyed by the networks</li><li><code>:depth</code>: the depth to which Expanders in this runtime should be expanded</li></ul><p><strong>Type parameters</strong></p><ul><li><code>I</code>: the input type(s) of the <code>Expander</code></li><li><code>O</code>: the output type(s) of the <code>Expander</code></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/compound/expander.jl#L5-L31">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.ExplicitDet" href="#Scruff.SFuncs.ExplicitDet"><code>Scruff.SFuncs.ExplicitDet</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct ExplicitDet{I, O} &lt;: Det{I, O}</code></pre><p><code>ExplicitDet</code> is a <code>Det</code> that contains a field <code>f::Function</code>.  It also has an <code>apply</code> method that simply delegates to the <code>ExplicitDet</code>&#39;s function:</p><pre><code class="nohighlight hljs">    apply(d::ExplicitDet, i...) = d.f(i...)</code></pre><pre><code class="nohighlight hljs">julia&gt; d = ExplicitDet{Tuple{Vararg{Real}},Real}(sum)
+ExplicitDet{Tuple{Vararg{Real, N} where N}, Real}(sum)</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/conddist/det.jl#L29-L40">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Extend" href="#Scruff.SFuncs.Extend"><code>Scruff.SFuncs.Extend</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Extend{I&lt;:Tuple{Any},J,O} &lt;: SFunc{J,O}</code></pre><p><code>Extend</code> defines an sfunc that extend the input of another sfunc. Useful for defining Separable SFuncs.</p><p><strong>Additional supported operators</strong></p><ul><li><code>support</code></li><li><code>support_quality</code></li><li><code>sample</code></li><li><code>logcpdf</code></li><li><code>bounded_probs</code></li><li><code>make_factors</code></li><li><code>compute_pi</code></li><li><code>send_lambda</code></li></ul><p><strong>Type parameters</strong></p><ul><li><code>I</code>: the input type(s) of the extended <em>sfunc</em>; it must be a tuple of length 1</li><li><code>J</code>: the input type(s) of the <code>Extend</code></li><li><code>O</code>: the output type(s) of both the <code>Extend</code> and the extended <em>sfunc</em> </li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/util/extend.jl#L3-L23">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.FunctionalScore" href="#Scruff.SFuncs.FunctionalScore"><code>Scruff.SFuncs.FunctionalScore</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct FunctionalScore{I} &lt;: Score{I}</code></pre><p>A score defined by a function.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/score/functionalscore.jl#L3-L7">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Generate" href="#Scruff.SFuncs.Generate"><code>Scruff.SFuncs.Generate</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">Generate{O} &lt;: SFunc{Tuple{Dist{O}}, O}</code></pre><p>Generate a value from its <code>Dist</code> argument.</p><p>This helps in higher-order programming. A typical pattern will be to create an sfunc that produces a <code>Dist</code>, and then generate many observations from the <code>Dist</code> using <code>Generate</code>.</p><p><strong>Additional supported operators</strong></p><ul><li><code>support</code></li><li><code>support_quality</code></li><li><code>sample</code></li><li><code>logcpdf</code></li><li><code>compute_pi</code></li><li><code>send_lambda</code></li><li><code>make_factors</code></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/compound/generate.jl#L5-L21">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.HardScore" href="#Scruff.SFuncs.HardScore"><code>Scruff.SFuncs.HardScore</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">HardScore{I} &lt;: Score{I}</code></pre><p>A fixed score.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/score/hardscore.jl#L3-L7">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Invertible" href="#Scruff.SFuncs.Invertible"><code>Scruff.SFuncs.Invertible</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Invertible{I,O} &lt;: SFunc{Tuple{I},O}</code></pre><p>An invertible sfunc, with both a <code>forward</code> and a <code>inverse</code> function provided.</p><p><strong>Additional supported operators</strong></p><ul><li><code>support</code></li><li><code>support_quality</code></li><li><code>sample</code></li><li><code>logcpdf</code></li><li><code>bounded_probs</code></li><li><code>make_factors</code></li><li><code>compute_pi</code></li><li><code>send_lambda</code></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/conddist/invertible.jl#L4-L18">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.LinearGaussian" href="#Scruff.SFuncs.LinearGaussian"><code>Scruff.SFuncs.LinearGaussian</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">mutable struct LinearGaussian{I &lt;: Tuple{Vararg{Float64}}} &lt;: 
+    Conditional{I, Tuple{}, I, Float64, Normal}</code></pre><p><code>LinearGaussian</code> defines an sfunc whose mean is a linear function of its parents.  A  <code>LinearGaussian</code>&#39;s output type is a <code>Float</code>, its parameter type is  <code>Tuple{I, Float64, Float64}</code>, and it&#39;s contained <em>sfunc</em> is a <code>Normal</code> mean <code>0.0</code>.</p><p><strong>Type parameters</strong></p><ul><li><code>I</code>: the input type(s) of the <code>LinearGaussian</code></li></ul><p>See also: <a href="#Scruff.SFuncs.Conditional"><code>Conditional</code></a>, <a href="lib/@ref"><code>Normal</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/conddist/lineargaussian.jl#L3-L15">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.LogScore" href="#Scruff.SFuncs.LogScore"><code>Scruff.SFuncs.LogScore</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct LogScore{I} &lt;: Score{I}</code></pre><p>A Log score.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/score/logscore.jl#L3-L7">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Mixture" href="#Scruff.SFuncs.Mixture"><code>Scruff.SFuncs.Mixture</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">mutable struct Mixture{I,O} &lt;: SFunc{I,O}</code></pre><p><code>Mixture</code> defines an <em>sfunc</em> representing mixtures of other <em>sfuncs</em>.  It contains a  vector of <em>sfuncs</em> and a vector of probabilities that those <em>sfuncs</em> are selected,  which indices are keys associating the two.  The output type of a <code>Mixture</code> is defined by the output type of its internal components.  The parameters of a <code>Mixture</code> are its probabilities followed by parameters of all its internal components, in order. </p><p><strong>Additional supported operators</strong></p><ul><li><code>support</code></li><li><code>support_quality</code></li><li><code>sample</code></li><li><code>cpdf</code></li><li><code>expectation</code></li><li><code>compute_pi</code></li><li><code>send_lambda</code></li></ul><p><strong>Type parameters</strong></p><ul><li><code>I</code>: the input type(s) of the <code>Mixture</code></li><li><code>O</code>: the shared output type(s) of its internal components and the output type(s) of the <code>Mixture</code></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/compound/mixture.jl#L3-L24">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.NetworkSFunc" href="#Scruff.SFuncs.NetworkSFunc"><code>Scruff.SFuncs.NetworkSFunc</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct NetworkSFunc{I,O} &lt;: SFunc{I,O}</code></pre><p>An sfunc that combines multiple sfuncs in a network structure.</p><p><strong>Arguments</strong></p><pre><code class="nohighlight hljs">input_placeholders A vector of placeholders indicating the types of network inputs. The type parameter `I` is computed from these.
 sfuncs The sfuncs to combine.
 parents A `Dict` that maps sfuncs to their parent sfuncs. Note that this parallels networks, 
      except that we are mapping sfuncs to lists of sfuncs directly rather than variables to vectors of variables.
-output A vector of output sfuncs, determining the `O` type parameter.</code></pre><p><strong>Additional supported operators</strong></p><ul><li><code>sample</code></li><li><code>sample_logcpdf</code></li><li><code>logcpdf</code></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/compound/network.jl#L12-L28">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.NormalScore" href="#Scruff.SFuncs.NormalScore"><code>Scruff.SFuncs.NormalScore</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct NormalScore &lt;: Score{Float64}</code></pre><p>A score defined by a normal density given the mean and sd of the score.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/score/normalscore.jl#L3-L7">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Parzen" href="#Scruff.SFuncs.Parzen"><code>Scruff.SFuncs.Parzen</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Parzen &lt;: Score{Float64}</code></pre><p>A parzen score.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/score/parzen.jl#L3-L7">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.SepCPTs" href="#Scruff.SFuncs.SepCPTs"><code>Scruff.SFuncs.SepCPTs</code></a> — <span class="docstring-category">Type</span></header><section><div><p>SepCPTs = Array{Dict{I, Array{Float64, 1}} where I}</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/conddist/separable.jl#L5">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Serial" href="#Scruff.SFuncs.Serial"><code>Scruff.SFuncs.Serial</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Serial{I,O} &lt;: SFunc{I,O}</code></pre><p>A sequence of sfuncs in series.</p><p>Although this could be implemented as a special case of NetworkSFunc, the serial composition allows an easier and more efficient implementation of operations. All but the first sfunc in the sequence will have a single input; the output of each sfunc feeds into the input of the next sfunc.</p><p>To work properly, most of the operations on <code>Serial</code> need the support of the intermediate sfuncs, given an input range. Rather than compute this each time, and to avoid having the non-support operations take a size argument, support is memoized, and must be called before other operations like logcpdf are called. The <code>support_memo</code> is a dictionary whose keys are tuples of parent ranges and whose values are the support computed for those parent ranges, along with the target size for which they were computed. Storing the target size enables refinement algorithms that increase the size and improve  the support.</p><p><strong>Additional supported operators</strong></p><ul><li><code>support</code></li><li><code>support_quality</code></li><li><code>sample</code></li><li><code>cpdf</code></li><li><code>bounded_probs</code></li><li><code>make_factors</code></li><li><code>compute_pi</code></li><li><code>send_lambda</code></li></ul><p><strong>Type parameters</strong></p><ul><li>I the input type of the first sfunc</li><li>O the output type of the last sfunc</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/compound/serial.jl#L5-L37">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Switch" href="#Scruff.SFuncs.Switch"><code>Scruff.SFuncs.Switch</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type Switch{N, I, K, O} &lt;: Det{K, O}</code></pre><p><code>Switch</code> defines an sfunc that represents choosing between multiple incoming (parent) Sfuncs  based on a test.  A subtype of <code>Switch</code> must provide a <code>choose</code> function that takes the switch  and an <code>i</code> and returns an integer between <code>1</code> and <code>N</code>.  This is an index into a &#39;parent array&#39;.</p><p><code>K</code> must be a flat tuple type consisting of <code>I</code> and <code>N</code> occurrences of <code>O</code>:  for example, if I is <code>Int</code></p><pre><code class="nohighlight hljs">    K = extend_tuple_type(Tuple{Int}, NTuple{N, O})</code></pre><p>If the subtype&#39;d sfunc is not in the Scruff.SFuncs module, the system must  <code>import Scruff.SFuncs: choose</code>.</p><p><strong>Additional supported operators</strong></p><ul><li><code>support</code></li><li><code>support_quality</code></li><li><code>compute_pi</code></li><li><code>send_lambda</code></li></ul><p><strong>Type parameters</strong></p><ul><li><code>N</code>: the count of <em>sfuncs</em> from which to choose</li><li><code>I</code>: the type of the second argument of the <code>choose</code> function defined for the <code>Switch</code></li><li><code>K</code>: the input type of the <code>Switch</code>; see above</li><li><code>O</code>: the output type of the <code>Switch</code> </li></ul><p>See also:  <a href="#Scruff.SFuncs.choose"><code>choose</code></a>, <a href="#Scruff.SFuncs.extend_tuple_type-Tuple{Any, Any}"><code>extend_tuple_type</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/conddist/switch.jl#L7-L37">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Table" href="#Scruff.SFuncs.Table"><code>Scruff.SFuncs.Table</code></a> — <span class="docstring-category">Type</span></header><section><div><p>mutable struct Table{NumInputs, I &lt;: NTuple{NumInputs, Any}, J, K, O, S &lt;: SFunc{J,O}} &lt;: Conditional{I, J, K, O, S}</p><p><code>Table</code> defines a <code>Conditional</code> whose function is given by a multi-dimensional table of type  <code>Array{Q, NumInputs}</code>, where <code>Q</code> is the output type of the internal <em>sfunc</em> and <code>NumInputs</code> is the count of incoming parent values.</p><p>See also:  <a href="#Scruff.SFuncs.Conditional"><code>Conditional</code></a>, <a href="#Scruff.SFuncs.DiscreteCPT-Union{Tuple{O}, Tuple{I}, Tuple{Vector{O}, Dict{I, Vector{Float64}}}} where {I&lt;:Tuple, O}"><code>DiscreteCPT</code></a>, <a href="#Scruff.SFuncs.CLG-Tuple{Dict}"><code>CLG</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/conddist/table.jl#L4-L12">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.CLG-Tuple{Dict}" href="#Scruff.SFuncs.CLG-Tuple{Dict}"><code>Scruff.SFuncs.CLG</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">CLG(paramdict::Dict)</code></pre><p>Constructs an*sfunc representing a Conditional linear Gaussian.  These sfuncs may have  both discrete and continuous parents.  For each combination of discrete parents, there is  a <code>LinearGaussian</code> that depends on the continuous parents.</p><p><code>CLG</code>s are implemented as a <code>Table</code> with a <code>LinearGaussian</code>.</p><p>The <code>paramdict</code> parameter defines the discrete and continuous parents, and the linear  gaussean values where the length of a key is the count of the discrete inputs, the  length of the tuple in a value is the count of continuous inputs, and the rest of the values are used to build the parameters for <code>CLG</code> itself.  For example,</p><pre><code class="nohighlight hljs">    Dict((:x,1) =&gt; ((-1.0, 1.0, 2.0), 3.0, 1.0), 
+output A vector of output sfuncs, determining the `O` type parameter.</code></pre><p><strong>Additional supported operators</strong></p><ul><li><code>sample</code></li><li><code>sample_logcpdf</code></li><li><code>logcpdf</code></li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/compound/network.jl#L12-L28">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.NormalScore" href="#Scruff.SFuncs.NormalScore"><code>Scruff.SFuncs.NormalScore</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct NormalScore &lt;: Score{Float64}</code></pre><p>A score defined by a normal density given the mean and sd of the score.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/score/normalscore.jl#L3-L7">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Parzen" href="#Scruff.SFuncs.Parzen"><code>Scruff.SFuncs.Parzen</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Parzen &lt;: Score{Float64}</code></pre><p>A parzen score.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/score/parzen.jl#L3-L7">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.SepCPTs" href="#Scruff.SFuncs.SepCPTs"><code>Scruff.SFuncs.SepCPTs</code></a> — <span class="docstring-category">Type</span></header><section><div><p>SepCPTs = Array{Dict{I, Array{Float64, 1}} where I}</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/conddist/separable.jl#L5">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Serial" href="#Scruff.SFuncs.Serial"><code>Scruff.SFuncs.Serial</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Serial{I,O} &lt;: SFunc{I,O}</code></pre><p>A sequence of sfuncs in series.</p><p>Although this could be implemented as a special case of NetworkSFunc, the serial composition allows an easier and more efficient implementation of operations. All but the first sfunc in the sequence will have a single input; the output of each sfunc feeds into the input of the next sfunc.</p><p>To work properly, most of the operations on <code>Serial</code> need the support of the intermediate sfuncs, given an input range. Rather than compute this each time, and to avoid having the non-support operations take a size argument, support is memoized, and must be called before other operations like logcpdf are called. The <code>support_memo</code> is a dictionary whose keys are tuples of parent ranges and whose values are the support computed for those parent ranges, along with the target size for which they were computed. Storing the target size enables refinement algorithms that increase the size and improve  the support.</p><p><strong>Additional supported operators</strong></p><ul><li><code>support</code></li><li><code>support_quality</code></li><li><code>sample</code></li><li><code>cpdf</code></li><li><code>bounded_probs</code></li><li><code>make_factors</code></li><li><code>compute_pi</code></li><li><code>send_lambda</code></li></ul><p><strong>Type parameters</strong></p><ul><li>I the input type of the first sfunc</li><li>O the output type of the last sfunc</li></ul></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/compound/serial.jl#L5-L37">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Switch" href="#Scruff.SFuncs.Switch"><code>Scruff.SFuncs.Switch</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">abstract type Switch{N, I, K, O} &lt;: Det{K, O}</code></pre><p><code>Switch</code> defines an sfunc that represents choosing between multiple incoming (parent) Sfuncs  based on a test.  A subtype of <code>Switch</code> must provide a <code>choose</code> function that takes the switch  and an <code>i</code> and returns an integer between <code>1</code> and <code>N</code>.  This is an index into a &#39;parent array&#39;.</p><p><code>K</code> must be a flat tuple type consisting of <code>I</code> and <code>N</code> occurrences of <code>O</code>:  for example, if I is <code>Int</code></p><pre><code class="nohighlight hljs">    K = extend_tuple_type(Tuple{Int}, NTuple{N, O})</code></pre><p>If the subtype&#39;d sfunc is not in the Scruff.SFuncs module, the system must  <code>import Scruff.SFuncs: choose</code>.</p><p><strong>Additional supported operators</strong></p><ul><li><code>support</code></li><li><code>support_quality</code></li><li><code>compute_pi</code></li><li><code>send_lambda</code></li></ul><p><strong>Type parameters</strong></p><ul><li><code>N</code>: the count of <em>sfuncs</em> from which to choose</li><li><code>I</code>: the type of the second argument of the <code>choose</code> function defined for the <code>Switch</code></li><li><code>K</code>: the input type of the <code>Switch</code>; see above</li><li><code>O</code>: the output type of the <code>Switch</code> </li></ul><p>See also:  <a href="#Scruff.SFuncs.choose"><code>choose</code></a>, <a href="#Scruff.SFuncs.extend_tuple_type-Tuple{Any, Any}"><code>extend_tuple_type</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/conddist/switch.jl#L7-L37">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Table" href="#Scruff.SFuncs.Table"><code>Scruff.SFuncs.Table</code></a> — <span class="docstring-category">Type</span></header><section><div><p>mutable struct Table{NumInputs, I &lt;: NTuple{NumInputs, Any}, J, K, O, S &lt;: SFunc{J,O}} &lt;: Conditional{I, J, K, O, S}</p><p><code>Table</code> defines a <code>Conditional</code> whose function is given by a multi-dimensional table of type  <code>Array{Q, NumInputs}</code>, where <code>Q</code> is the output type of the internal <em>sfunc</em> and <code>NumInputs</code> is the count of incoming parent values.</p><p>See also:  <a href="#Scruff.SFuncs.Conditional"><code>Conditional</code></a>, <a href="#Scruff.SFuncs.DiscreteCPT-Union{Tuple{O}, Tuple{I}, Tuple{Vector{O}, Dict{I, Vector{Float64}}}} where {I&lt;:Tuple, O}"><code>DiscreteCPT</code></a>, <a href="#Scruff.SFuncs.CLG-Tuple{Dict}"><code>CLG</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/conddist/table.jl#L4-L12">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.CLG-Tuple{Dict}" href="#Scruff.SFuncs.CLG-Tuple{Dict}"><code>Scruff.SFuncs.CLG</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">CLG(paramdict::Dict)</code></pre><p>Constructs an*sfunc representing a Conditional linear Gaussian.  These sfuncs may have  both discrete and continuous parents.  For each combination of discrete parents, there is  a <code>LinearGaussian</code> that depends on the continuous parents.</p><p><code>CLG</code>s are implemented as a <code>Table</code> with a <code>LinearGaussian</code>.</p><p>The <code>paramdict</code> parameter defines the discrete and continuous parents, and the linear  gaussean values where the length of a key is the count of the discrete inputs, the  length of the tuple in a value is the count of continuous inputs, and the rest of the values are used to build the parameters for <code>CLG</code> itself.  For example,</p><pre><code class="nohighlight hljs">    Dict((:x,1) =&gt; ((-1.0, 1.0, 2.0), 3.0, 1.0), 
          (:x,2) =&gt; ((-2.0, 4.0, 2.0), 3.0, 1.0),
          (:x,3) =&gt; ((-3.0, 2.0, 2.0), 3.0, 1.0), 
          (:y,1) =&gt; ((-4.0, 5.0, 2.0), 3.0, 1.0),
@@ -13,19 +13,19 @@
          (:y,3) =&gt; ((-6.0, 6.0, 2.0), 3.0, 1.0))</code></pre><pre><code class="nohighlight hljs">- the keys define two(2) discrete parents, with values `[:x,:y]` and `[1,2,3]`
 - in the values, the first tuple defines three(3) continuous parents for each
   underlying `LinearGausian`, with values `-1.0:-6.0`, `1.0:6.0`, and `2.0`
-- the values `3.0` and `1.0` are mean/stddev of the underlying `LinearGaussian`</code></pre><p>See also: <a href="#Scruff.SFuncs.Table"><code>Table</code></a>, <a href="#Scruff.SFuncs.LinearGaussian"><code>LinearGaussian</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/conddist/CLG.jl#L4-L33">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.DiscreteCPT-Union{Tuple{O}, Tuple{I}, Tuple{Vector{O}, Dict{I, Vector{Float64}}}} where {I&lt;:Tuple, O}" href="#Scruff.SFuncs.DiscreteCPT-Union{Tuple{O}, Tuple{I}, Tuple{Vector{O}, Dict{I, Vector{Float64}}}} where {I&lt;:Tuple, O}"><code>Scruff.SFuncs.DiscreteCPT</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">function DiscreteCPT(range::Vector{O}, paramdict::Dict{I, Vector{Float64}}) where {I &lt;: Tuple, O}</code></pre><p>Constructs an sfunc that represents a Discrete Conditional Probability table.</p><p><code>DiscreteCPT</code>s are implemented as a <code>Table</code> with a <code>Cat</code>.</p><p>The <code>range</code> parameter defines all the possible outputs of the <code>DiscreteCPT</code>.  The <code>paramdict</code>  parameter defines the input(s) and the actual CPT.  For example, </p><pre><code class="nohighlight hljs">    range = [1, 2]
+- the values `3.0` and `1.0` are mean/stddev of the underlying `LinearGaussian`</code></pre><p>See also: <a href="#Scruff.SFuncs.Table"><code>Table</code></a>, <a href="#Scruff.SFuncs.LinearGaussian"><code>LinearGaussian</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/conddist/CLG.jl#L4-L33">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.DiscreteCPT-Union{Tuple{O}, Tuple{I}, Tuple{Vector{O}, Dict{I, Vector{Float64}}}} where {I&lt;:Tuple, O}" href="#Scruff.SFuncs.DiscreteCPT-Union{Tuple{O}, Tuple{I}, Tuple{Vector{O}, Dict{I, Vector{Float64}}}} where {I&lt;:Tuple, O}"><code>Scruff.SFuncs.DiscreteCPT</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">function DiscreteCPT(range::Vector{O}, paramdict::Dict{I, Vector{Float64}}) where {I &lt;: Tuple, O}</code></pre><p>Constructs an sfunc that represents a Discrete Conditional Probability table.</p><p><code>DiscreteCPT</code>s are implemented as a <code>Table</code> with a <code>Cat</code>.</p><p>The <code>range</code> parameter defines all the possible outputs of the <code>DiscreteCPT</code>.  The <code>paramdict</code>  parameter defines the input(s) and the actual CPT.  For example, </p><pre><code class="nohighlight hljs">    range = [1, 2]
     paramdict = Dict((1,1) =&gt; [0.3, 0.7], (1,2) =&gt; [0.6, 0.4], (2,1) =&gt;[0.4, 0.6],
-    (2,2) =&gt; [0.7, 0.3], (3,1) =&gt; [0.5, 0.5], (3,2) =&gt; [0.8, 0.2])</code></pre><p>can create a <code>DiscreteCPT</code> which has two(2) inputs (the length of the key) and, given each input as defined by the key, selects either <code>1</code> or <code>2</code> (the range) with the given probability.  So, if the input is <code>(2,1)</code>, <code>1</code> is selected with probability <code>0.4</code> and <code>2</code> is selected with probability <code>0.6</code>.</p><p>See also: <a href="#Scruff.SFuncs.Table"><code>Table</code></a>, <a href="#Scruff.SFuncs.Cat"><code>Cat</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/conddist/discretecpt.jl#L4-L26">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Flip-Tuple{Any}" href="#Scruff.SFuncs.Flip-Tuple{Any}"><code>Scruff.SFuncs.Flip</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">Flip(p)</code></pre><p>Constructs a very simple <em>sfunc</em> corresponding to a Bernoulli distribution,  represented by a <code>Cat</code>.  The output is <code>true</code> with probability <code>p</code>, and <code>false</code> with probability <code>1-p</code>.</p><p>See also: <a href="#Scruff.SFuncs.Cat"><code>Cat</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/dist/flip.jl#L3-L11">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Separable-Union{Tuple{O}, Tuple{Vector{O}, Vector{Float64}, Array{Dict{I, Vector{Float64}} where I}}} where O" href="#Scruff.SFuncs.Separable-Union{Tuple{O}, Tuple{Vector{O}, Vector{Float64}, Array{Dict{I, Vector{Float64}} where I}}} where O"><code>Scruff.SFuncs.Separable</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">function Separable(range::Vector{O}, probabilities :: Vector{Float64}, compparams :: SepCPTs) where O</code></pre><p>Constructs an sfunc representing separable models, defined by additive decompositon of a conditional probability distribution into separate distributions depending on each of the parents.</p><p><code>Separable</code>s are implemented as a <code>Mixture</code> of <code>Extend</code> sfuncs that extend <code>DiscreteCPT</code>s.</p><p>To construct a <code>Separable</code>, this method is passed the <code>range</code> of output values, the <code>probabilities</code> of each of the underlying <code>DiscreteCPT</code> (which are the internal sfuncs of the <code>Mixture</code>), and the parameters for each of the <code>DiscreteCPT</code>s.  For example, </p><pre><code class="nohighlight hljs">alphas = [0.2, 0.3, 0.5]
+    (2,2) =&gt; [0.7, 0.3], (3,1) =&gt; [0.5, 0.5], (3,2) =&gt; [0.8, 0.2])</code></pre><p>can create a <code>DiscreteCPT</code> which has two(2) inputs (the length of the key) and, given each input as defined by the key, selects either <code>1</code> or <code>2</code> (the range) with the given probability.  So, if the input is <code>(2,1)</code>, <code>1</code> is selected with probability <code>0.4</code> and <code>2</code> is selected with probability <code>0.6</code>.</p><p>See also: <a href="#Scruff.SFuncs.Table"><code>Table</code></a>, <a href="#Scruff.SFuncs.Cat"><code>Cat</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/conddist/discretecpt.jl#L4-L26">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Flip-Tuple{Any}" href="#Scruff.SFuncs.Flip-Tuple{Any}"><code>Scruff.SFuncs.Flip</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">Flip(p)</code></pre><p>Constructs a very simple <em>sfunc</em> corresponding to a Bernoulli distribution,  represented by a <code>Cat</code>.  The output is <code>true</code> with probability <code>p</code>, and <code>false</code> with probability <code>1-p</code>.</p><p>See also: <a href="#Scruff.SFuncs.Cat"><code>Cat</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/dist/flip.jl#L3-L11">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.Separable-Union{Tuple{O}, Tuple{Vector{O}, Vector{Float64}, Array{Dict{I, Vector{Float64}} where I}}} where O" href="#Scruff.SFuncs.Separable-Union{Tuple{O}, Tuple{Vector{O}, Vector{Float64}, Array{Dict{I, Vector{Float64}} where I}}} where O"><code>Scruff.SFuncs.Separable</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">function Separable(range::Vector{O}, probabilities :: Vector{Float64}, compparams :: SepCPTs) where O</code></pre><p>Constructs an sfunc representing separable models, defined by additive decompositon of a conditional probability distribution into separate distributions depending on each of the parents.</p><p><code>Separable</code>s are implemented as a <code>Mixture</code> of <code>Extend</code> sfuncs that extend <code>DiscreteCPT</code>s.</p><p>To construct a <code>Separable</code>, this method is passed the <code>range</code> of output values, the <code>probabilities</code> of each of the underlying <code>DiscreteCPT</code> (which are the internal sfuncs of the <code>Mixture</code>), and the parameters for each of the <code>DiscreteCPT</code>s.  For example, </p><pre><code class="nohighlight hljs">alphas = [0.2, 0.3, 0.5]
 cpd1 = Dict((1,) =&gt; [0.1, 0.9], (2,) =&gt; [0.2, 0.8])
 cpd2 = Dict((1,) =&gt; [0.3, 0.7], (2,) =&gt; [0.4, 0.6], (3,) =&gt; [0.5, 0.5])
 cpd3 = Dict((1,) =&gt; [0.6, 0.4], (2,) =&gt; [0.7, 0.3])
 cpds :: Array{Dict{I,Array{Float64,1}} where I,1} = [cpd1, cpd2, cpd3]
-s = Separable([1, 2], alphas, cpds)</code></pre><p>See also:  <a href="#Scruff.SFuncs.Mixture"><code>Mixture</code></a>, <a href="#Scruff.SFuncs.Extend"><code>Extend</code></a>, <a href="#Scruff.SFuncs.DiscreteCPT-Union{Tuple{O}, Tuple{I}, Tuple{Vector{O}, Dict{I, Vector{Float64}}}} where {I&lt;:Tuple, O}"><code>DiscreteCPT</code></a>, <a href="#Scruff.SFuncs.Table"><code>Table</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/conddist/separable.jl#L9-L31">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.SoftScore-Union{Tuple{Dict{I, Float64}}, Tuple{I}} where I" href="#Scruff.SFuncs.SoftScore-Union{Tuple{Dict{I, Float64}}, Tuple{I}} where I"><code>Scruff.SFuncs.SoftScore</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">SoftScore(scores::Dict{I,Float64})</code></pre><p>Return a <code>LogScore</code> of the keys and log values in <code>score</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/score/softscore.jl#L13-L17">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.SoftScore-Union{Tuple{I}, Tuple{Vector{I}, Vector{Float64}}} where I" href="#Scruff.SFuncs.SoftScore-Union{Tuple{I}, Tuple{Vector{I}, Vector{Float64}}} where I"><code>Scruff.SFuncs.SoftScore</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">SoftScore(vs::Vector{I}, ss::Vector{Float64})</code></pre><p>Return a <code>LogScore</code> of the log values in <code>ss</code> vector for  the associated keys in <code>vs</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/score/softscore.jl#L3-L8">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.choose" href="#Scruff.SFuncs.choose"><code>Scruff.SFuncs.choose</code></a> — <span class="docstring-category">Function</span></header><section><div><p><code>choose</code> interface.  For every subtype of <code>Switch</code>, an implementation of this method must be created, whose first parameter is the subtype, and the second parameter is of type <code>I</code> for the parameter type in <code>Switch</code>.</p><p>For example, the definition of the <code>If</code> <em>sfunc</em> is as follows, where <code>choose</code> returns either index <code>1</code> or index <code>2</code>.</p><pre><code class="nohighlight hljs">struct If{O} &lt;: Switch{2, Bool, Tuple{Bool, O, O}, O} end
-choose(::If, b::Bool) = b ? 1 : 2</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/conddist/switch.jl#L40-L52">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.extend_tuple_type-Tuple{Any, Any}" href="#Scruff.SFuncs.extend_tuple_type-Tuple{Any, Any}"><code>Scruff.SFuncs.extend_tuple_type</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">extend_tuple_type(T1, T2)</code></pre><p>Given two types <code>T1</code> and <code>T2</code>, concatenate the types into a single tuple type.  </p><p><strong>Arguments</strong></p><ul><li><code>T1</code>: Any type</li><li><code>T2</code>: A tuple type</li></ul><p><strong>Returns</strong></p><ul><li>If <code>T1</code> is a tuple type, a tuple with the concatenation of the types in <code>T1</code> and <code>T2</code></li><li>If <code>T1</code> is not a tuple type, a tuple with <code>T1</code> prepended to the types in <code>T2</code></li></ul><p><strong>Examples</strong></p><pre><code class="nohighlight hljs">julia&gt; extend_tuple_type(Int64, Tuple{Float64})
+s = Separable([1, 2], alphas, cpds)</code></pre><p>See also:  <a href="#Scruff.SFuncs.Mixture"><code>Mixture</code></a>, <a href="#Scruff.SFuncs.Extend"><code>Extend</code></a>, <a href="#Scruff.SFuncs.DiscreteCPT-Union{Tuple{O}, Tuple{I}, Tuple{Vector{O}, Dict{I, Vector{Float64}}}} where {I&lt;:Tuple, O}"><code>DiscreteCPT</code></a>, <a href="#Scruff.SFuncs.Table"><code>Table</code></a></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/conddist/separable.jl#L9-L31">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.SoftScore-Union{Tuple{Dict{I, Float64}}, Tuple{I}} where I" href="#Scruff.SFuncs.SoftScore-Union{Tuple{Dict{I, Float64}}, Tuple{I}} where I"><code>Scruff.SFuncs.SoftScore</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">SoftScore(scores::Dict{I,Float64})</code></pre><p>Return a <code>LogScore</code> of the keys and log values in <code>score</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/score/softscore.jl#L13-L17">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.SoftScore-Union{Tuple{I}, Tuple{Vector{I}, Vector{Float64}}} where I" href="#Scruff.SFuncs.SoftScore-Union{Tuple{I}, Tuple{Vector{I}, Vector{Float64}}} where I"><code>Scruff.SFuncs.SoftScore</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">SoftScore(vs::Vector{I}, ss::Vector{Float64})</code></pre><p>Return a <code>LogScore</code> of the log values in <code>ss</code> vector for  the associated keys in <code>vs</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/score/softscore.jl#L3-L8">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.choose" href="#Scruff.SFuncs.choose"><code>Scruff.SFuncs.choose</code></a> — <span class="docstring-category">Function</span></header><section><div><p><code>choose</code> interface.  For every subtype of <code>Switch</code>, an implementation of this method must be created, whose first parameter is the subtype, and the second parameter is of type <code>I</code> for the parameter type in <code>Switch</code>.</p><p>For example, the definition of the <code>If</code> <em>sfunc</em> is as follows, where <code>choose</code> returns either index <code>1</code> or index <code>2</code>.</p><pre><code class="nohighlight hljs">struct If{O} &lt;: Switch{2, Bool, Tuple{Bool, O, O}, O} end
+choose(::If, b::Bool) = b ? 1 : 2</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/conddist/switch.jl#L40-L52">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.SFuncs.extend_tuple_type-Tuple{Any, Any}" href="#Scruff.SFuncs.extend_tuple_type-Tuple{Any, Any}"><code>Scruff.SFuncs.extend_tuple_type</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">extend_tuple_type(T1, T2)</code></pre><p>Given two types <code>T1</code> and <code>T2</code>, concatenate the types into a single tuple type.  </p><p><strong>Arguments</strong></p><ul><li><code>T1</code>: Any type</li><li><code>T2</code>: A tuple type</li></ul><p><strong>Returns</strong></p><ul><li>If <code>T1</code> is a tuple type, a tuple with the concatenation of the types in <code>T1</code> and <code>T2</code></li><li>If <code>T1</code> is not a tuple type, a tuple with <code>T1</code> prepended to the types in <code>T2</code></li></ul><p><strong>Examples</strong></p><pre><code class="nohighlight hljs">julia&gt; extend_tuple_type(Int64, Tuple{Float64})
 Tuple{Int64, Float64}
 
 julia&gt; extend_tuple_type(Tuple{Int64}, Tuple{Float64})
 Tuple{Int64, Float64}
 
 julia&gt; extend_tuple_type(Tuple{Vector{Float64}}, Tuple{Symbol,Symbol})     
-Tuple{Vector{Float64}, Symbol, Symbol}</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/sfuncs/conddist/conditional.jl#L11-L36">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../core/">« Core</a><a class="docs-footer-nextpage" href="../operators/">Operators »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Tuesday 7 May 2024 20:00">Tuesday 7 May 2024</span>. Using Julia version 1.7.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+Tuple{Vector{Float64}, Symbol, Symbol}</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/sfuncs/conddist/conditional.jl#L11-L36">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../core/">« Core</a><a class="docs-footer-nextpage" href="../operators/">Operators »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Wednesday 15 May 2024 16:16">Wednesday 15 May 2024</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/dev/lib/utilities/index.html b/dev/lib/utilities/index.html
index 80909fd..92f7e41 100644
--- a/dev/lib/utilities/index.html
+++ b/dev/lib/utilities/index.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Utilities · Scruff.jl</title><script data-outdated-warner src="../../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../../assets/documenter.js"></script><script src="../../siteinfo.js"></script><script src="../../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../../">Scruff.jl</a></span></div><form class="docs-search" action="../../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../../">Getting Started</a></li><li><a class="tocitem" href="../../tutorial/tutorial/">Tutorial</a></li><li><a class="tocitem" href="../../tutorial/examples/">Examples</a></li><li><span class="tocitem">Library</span><ul><li><a class="tocitem" href="../core/">Core</a></li><li><a class="tocitem" href="../sfuncs/">Stochastic Functions</a></li><li><a class="tocitem" href="../operators/">Operators</a></li><li><a class="tocitem" href="../models/">Models</a></li><li><a class="tocitem" href="../algorithms/">Algorithms</a></li><li class="is-active"><a class="tocitem" href>Utilities</a></li><li><a class="tocitem" href="../rtutils/">Runtime Utilities</a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li><a class="is-disabled">Library</a></li><li class="is-active"><a href>Utilities</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Utilities</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/charles-river-analytics/Scruff.jl/blob/develop/docs/src/lib/utilities.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="scruff_utils"><a class="docs-heading-anchor" href="#scruff_utils">Scruff.Utils</a><a id="scruff_utils-1"></a><a class="docs-heading-anchor-permalink" href="#scruff_utils" title="Permalink"></a></h1><article class="docstring"><header><a class="docstring-binding" id="Scruff.Utils.Factor" href="#Scruff.Utils.Factor"><code>Scruff.Utils.Factor</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Factor{N}</code></pre><p>Representation of a factor over <code>N</code> instances.</p><p><strong>arguments</strong></p><pre><code class="nohighlight hljs">dims a tuple of dimensions of the instances
 keys ids of the instances
-entries a vector of factor values</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/utils/factor.jl#L14-L23">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Utils.Graph" href="#Scruff.Utils.Graph"><code>Scruff.Utils.Graph</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Graph</code></pre><p>A simple graph with nodes (Int), edges (outgoing), and a size property for each node</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/utils/simple_graph.jl#L8-L13">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Base.show-Tuple{Scruff.Utils.Factor{0}}" href="#Base.show-Tuple{Scruff.Utils.Factor{0}}"><code>Base.show</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">function show(f::Factor)</code></pre><p>Print the factor in an easy to read format.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/utils/factor.jl#L112-L116">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Utils.bounded_linear_value-Tuple{Any, Any, Any}" href="#Scruff.Utils.bounded_linear_value-Tuple{Any, Any, Any}"><code>Scruff.Utils.bounded_linear_value</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">bounded_linear_value(weights, bias, interval_combo)</code></pre><p>Weight and sum the upper and lower bounds in <code>interval_combo</code> with the given bias</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/utils/cutils.jl#L131-L136">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Utils.cartesian_product-Tuple{Tuple}" href="#Scruff.Utils.cartesian_product-Tuple{Tuple}"><code>Scruff.Utils.cartesian_product</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">cartesian_product(xs::Tuple)
+entries a vector of factor values</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/utils/factor.jl#L14-L23">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Utils.Graph" href="#Scruff.Utils.Graph"><code>Scruff.Utils.Graph</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">struct Graph</code></pre><p>A simple graph with nodes (Int), edges (outgoing), and a size property for each node</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/utils/simple_graph.jl#L8-L13">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Base.show-Tuple{Scruff.Utils.Factor{0}}" href="#Base.show-Tuple{Scruff.Utils.Factor{0}}"><code>Base.show</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">function show(f::Factor)</code></pre><p>Print the factor in an easy to read format.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/utils/factor.jl#L112-L116">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Utils.bounded_linear_value-Tuple{Any, Any, Any}" href="#Scruff.Utils.bounded_linear_value-Tuple{Any, Any, Any}"><code>Scruff.Utils.bounded_linear_value</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">bounded_linear_value(weights, bias, interval_combo)</code></pre><p>Weight and sum the upper and lower bounds in <code>interval_combo</code> with the given bias</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/utils/cutils.jl#L131-L136">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Utils.cartesian_product-Tuple{Tuple}" href="#Scruff.Utils.cartesian_product-Tuple{Tuple}"><code>Scruff.Utils.cartesian_product</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">cartesian_product(xs::Tuple)
 cartesian_product(xs::Array)</code></pre><p>Given an array of arrays, returns the cartesian product of those arrays.</p><p><strong>Examples</strong></p><pre><code class="language-julia-repl hljs">julia&gt; cartesian_product([[1,2],[3,4]])
 4-element Array{Array{Int64,1},1}:
  [1, 3]
@@ -18,4 +18,4 @@
  [2, 3, 5]
  [2, 3, 6]
  [2, 4, 5]
- [2, 4, 6]</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/utils/cutils.jl#L23-L49">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Utils.linear_value-Tuple{Any, Any, Any}" href="#Scruff.Utils.linear_value-Tuple{Any, Any, Any}"><code>Scruff.Utils.linear_value</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">linear_value(weights, bias, continuous_combo)</code></pre><p>Weight and sum the <code>continuous_combo</code> with the given bias</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/utils/cutils.jl#L118-L122">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Utils.make_intervals-Tuple{Any}" href="#Scruff.Utils.make_intervals-Tuple{Any}"><code>Scruff.Utils.make_intervals</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">make_intervals(range)</code></pre><p>Given a range of values of a continuous variable, create interval bins surrounding the values</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/utils/cutils.jl#L98-L103">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Utils.memo-Tuple{Function}" href="#Scruff.Utils.memo-Tuple{Function}"><code>Scruff.Utils.memo</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">memo(f::Function)</code></pre><p>returns a memoized one argument function</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/utils/cutils.jl#L164-L168">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Utils.nextkey" href="#Scruff.Utils.nextkey"><code>Scruff.Utils.nextkey</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">nextkey()::Int</code></pre><p>Produce a fresh instance id that does not conflict with an existing id.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/utils/factor.jl#L47-L51">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Utils.normal_density-Tuple{Any, Any, Any}" href="#Scruff.Utils.normal_density-Tuple{Any, Any, Any}"><code>Scruff.Utils.normal_density</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">normal_density(x, mean, variance)</code></pre><p>Get the normal density of <code>x</code></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/utils/cutils.jl#L153-L157">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Utils.normalize-Tuple{Any}" href="#Scruff.Utils.normalize-Tuple{Any}"><code>Scruff.Utils.normalize</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">normalize(xs)</code></pre><p>Normalize an array of non-negative reals to sum to 1</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/utils.jl#L36-L40">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Utils.normalize-Tuple{Scruff.Utils.Factor}" href="#Scruff.Utils.normalize-Tuple{Scruff.Utils.Factor}"><code>Scruff.Utils.normalize</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">function normalize(f::Factor)</code></pre><p>Return a new factor equal to the given factor except that entries sum to 1</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/utils/factor.jl#L36-L40">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Utils.normalized_product-Tuple{Any, Any}" href="#Scruff.Utils.normalized_product-Tuple{Any, Any}"><code>Scruff.Utils.normalized_product</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">normalized_product(xss, n)</code></pre><p>Compute the product of the given arrays of length n and normalize the result.  Uses log computations to avoid underflow.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/utils/cutils.jl#L75-L80">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Utils.topsort-Union{Tuple{Dict{U, Vector{U}}}, Tuple{U}} where U" href="#Scruff.Utils.topsort-Union{Tuple{Dict{U, Vector{U}}}, Tuple{U}} where U"><code>Scruff.Utils.topsort</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">topsort(graph::Dict{T, Vector{T}}) :: Vector{T} where T</code></pre><p>Performs a topological sort on the given graph. In a cyclic graph, the order of variables in the cycle is arbitrary, but they will be correctly sorted relative to other variables.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/210f982572fe12344b14877b5f19b4d21731f54b/src/utils/cutils.jl#L271-L276">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../algorithms/">« Algorithms</a><a class="docs-footer-nextpage" href="../rtutils/">Runtime Utilities »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Tuesday 7 May 2024 20:00">Tuesday 7 May 2024</span>. Using Julia version 1.7.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+ [2, 4, 6]</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/utils/cutils.jl#L23-L49">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Utils.linear_value-Tuple{Any, Any, Any}" href="#Scruff.Utils.linear_value-Tuple{Any, Any, Any}"><code>Scruff.Utils.linear_value</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">linear_value(weights, bias, continuous_combo)</code></pre><p>Weight and sum the <code>continuous_combo</code> with the given bias</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/utils/cutils.jl#L118-L122">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Utils.make_intervals-Tuple{Any}" href="#Scruff.Utils.make_intervals-Tuple{Any}"><code>Scruff.Utils.make_intervals</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">make_intervals(range)</code></pre><p>Given a range of values of a continuous variable, create interval bins surrounding the values</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/utils/cutils.jl#L98-L103">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Utils.memo-Tuple{Function}" href="#Scruff.Utils.memo-Tuple{Function}"><code>Scruff.Utils.memo</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">memo(f::Function)</code></pre><p>returns a memoized one argument function</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/utils/cutils.jl#L164-L168">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Utils.nextkey" href="#Scruff.Utils.nextkey"><code>Scruff.Utils.nextkey</code></a> — <span class="docstring-category">Function</span></header><section><div><pre><code class="language-julia hljs">nextkey()::Int</code></pre><p>Produce a fresh instance id that does not conflict with an existing id.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/utils/factor.jl#L47-L51">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Utils.normal_density-Tuple{Any, Any, Any}" href="#Scruff.Utils.normal_density-Tuple{Any, Any, Any}"><code>Scruff.Utils.normal_density</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">normal_density(x, mean, variance)</code></pre><p>Get the normal density of <code>x</code></p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/utils/cutils.jl#L153-L157">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Utils.normalize-Tuple{Any}" href="#Scruff.Utils.normalize-Tuple{Any}"><code>Scruff.Utils.normalize</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">normalize(xs)</code></pre><p>Normalize an array of non-negative reals to sum to 1</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/utils.jl#L36-L40">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Utils.normalize-Tuple{Scruff.Utils.Factor}" href="#Scruff.Utils.normalize-Tuple{Scruff.Utils.Factor}"><code>Scruff.Utils.normalize</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">function normalize(f::Factor)</code></pre><p>Return a new factor equal to the given factor except that entries sum to 1</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/utils/factor.jl#L36-L40">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Utils.normalized_product-Tuple{Any, Any}" href="#Scruff.Utils.normalized_product-Tuple{Any, Any}"><code>Scruff.Utils.normalized_product</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">normalized_product(xss, n)</code></pre><p>Compute the product of the given arrays of length n and normalize the result.  Uses log computations to avoid underflow.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/utils/cutils.jl#L75-L80">source</a></section></article><article class="docstring"><header><a class="docstring-binding" id="Scruff.Utils.topsort-Union{Tuple{Dict{U, Vector{U}}}, Tuple{U}} where U" href="#Scruff.Utils.topsort-Union{Tuple{Dict{U, Vector{U}}}, Tuple{U}} where U"><code>Scruff.Utils.topsort</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">topsort(graph::Dict{T, Vector{T}}) :: Vector{T} where T</code></pre><p>Performs a topological sort on the given graph. In a cyclic graph, the order of variables in the cycle is arbitrary, but they will be correctly sorted relative to other variables.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/charles-river-analytics/Scruff.jl/blob/fd60d426aba987ecc4379ed73a7a6399f6e59f7a/src/utils/cutils.jl#L271-L276">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../algorithms/">« Algorithms</a><a class="docs-footer-nextpage" href="../rtutils/">Runtime Utilities »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Wednesday 15 May 2024 16:16">Wednesday 15 May 2024</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/dev/search/index.html b/dev/search/index.html
index 78db331..f24cf34 100644
--- a/dev/search/index.html
+++ b/dev/search/index.html
@@ -1,2 +1,2 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Search · Scruff.jl</title><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">Scruff.jl</a></span></div><form class="docs-search" action><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../">Getting Started</a></li><li><a class="tocitem" href="../tutorial/tutorial/">Tutorial</a></li><li><a class="tocitem" href="../tutorial/examples/">Examples</a></li><li><span class="tocitem">Library</span><ul><li><a class="tocitem" href="../lib/core/">Core</a></li><li><a class="tocitem" href="../lib/sfuncs/">Stochastic Functions</a></li><li><a class="tocitem" href="../lib/operators/">Operators</a></li><li><a class="tocitem" href="../lib/models/">Models</a></li><li><a class="tocitem" href="../lib/algorithms/">Algorithms</a></li><li><a class="tocitem" href="../lib/utilities/">Utilities</a></li><li><a class="tocitem" href="../lib/rtutils/">Runtime Utilities</a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Search</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Search</a></li></ul></nav><div class="docs-right"><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article><p id="documenter-search-info">Loading search...</p><ul id="documenter-search-results"></ul></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Tuesday 7 May 2024 20:00">Tuesday 7 May 2024</span>. Using Julia version 1.7.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body><script src="../search_index.js"></script><script src="../assets/search.js"></script></html>
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Search · Scruff.jl</title><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../">Scruff.jl</a></span></div><form class="docs-search" action><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../">Getting Started</a></li><li><a class="tocitem" href="../tutorial/tutorial/">Tutorial</a></li><li><a class="tocitem" href="../tutorial/examples/">Examples</a></li><li><span class="tocitem">Library</span><ul><li><a class="tocitem" href="../lib/core/">Core</a></li><li><a class="tocitem" href="../lib/sfuncs/">Stochastic Functions</a></li><li><a class="tocitem" href="../lib/operators/">Operators</a></li><li><a class="tocitem" href="../lib/models/">Models</a></li><li><a class="tocitem" href="../lib/algorithms/">Algorithms</a></li><li><a class="tocitem" href="../lib/utilities/">Utilities</a></li><li><a class="tocitem" href="../lib/rtutils/">Runtime Utilities</a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Search</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Search</a></li></ul></nav><div class="docs-right"><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article><p id="documenter-search-info">Loading search...</p><ul id="documenter-search-results"></ul></article><nav class="docs-footer"><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Wednesday 15 May 2024 16:16">Wednesday 15 May 2024</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body><script src="../search_index.js"></script><script src="../assets/search.js"></script></html>
diff --git a/dev/tutorial/examples/index.html b/dev/tutorial/examples/index.html
index da46340..5631056 100644
--- a/dev/tutorial/examples/index.html
+++ b/dev/tutorial/examples/index.html
@@ -1,2 +1,2 @@
 <!DOCTYPE html>
-<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Examples · Scruff.jl</title><script data-outdated-warner src="../../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../../assets/documenter.js"></script><script src="../../siteinfo.js"></script><script src="../../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../../">Scruff.jl</a></span></div><form class="docs-search" action="../../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../../">Getting Started</a></li><li><a class="tocitem" href="../tutorial/">Tutorial</a></li><li class="is-active"><a class="tocitem" href>Examples</a></li><li><span class="tocitem">Library</span><ul><li><a class="tocitem" href="../../lib/core/">Core</a></li><li><a class="tocitem" href="../../lib/sfuncs/">Stochastic Functions</a></li><li><a class="tocitem" href="../../lib/operators/">Operators</a></li><li><a class="tocitem" href="../../lib/models/">Models</a></li><li><a class="tocitem" href="../../lib/algorithms/">Algorithms</a></li><li><a class="tocitem" href="../../lib/utilities/">Utilities</a></li><li><a class="tocitem" href="../../lib/rtutils/">Runtime Utilities</a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Examples</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Examples</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/charles-river-analytics/Scruff.jl/blob/develop/docs/src/tutorial/examples.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="Examples"><a class="docs-heading-anchor" href="#Examples">Examples</a><a id="Examples-1"></a><a class="docs-heading-anchor-permalink" href="#Examples" title="Permalink"></a></h1><ul><li><a href="https://github.com/p2t2/Scruff.jl/tree/main/docs/examples/rembrandt_example.jl">rembrandt_example.jl</a></li><li><a href="https://github.com/p2t2/Scruff.jl/tree/main/docs/examples/novelty_example.jl">novelty_example.jl</a></li><li><a href="https://github.com/p2t2/Scruff.jl/tree/main/docs/examples/novelty_lazy.jl">novelty_lazy.jl</a></li><li><a href="https://github.com/p2t2/Scruff.jl/tree/main/docs/examples/novelty_filtering.jl">novelty_filtering.jl</a></li><li><a href="https://github.com/charles-river-analytics/Scruff.jl/tree/main/docs/examples/soccer_example.jl">soccer_example.jl</a></li></ul></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../tutorial/">« Tutorial</a><a class="docs-footer-nextpage" href="../../lib/core/">Core »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Tuesday 7 May 2024 20:00">Tuesday 7 May 2024</span>. Using Julia version 1.7.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Examples · Scruff.jl</title><script data-outdated-warner src="../../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.045/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.24/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="../.."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../../assets/documenter.js"></script><script src="../../siteinfo.js"></script><script src="../../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href="../../">Scruff.jl</a></span></div><form class="docs-search" action="../../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../../">Getting Started</a></li><li><a class="tocitem" href="../tutorial/">Tutorial</a></li><li class="is-active"><a class="tocitem" href>Examples</a></li><li><span class="tocitem">Library</span><ul><li><a class="tocitem" href="../../lib/core/">Core</a></li><li><a class="tocitem" href="../../lib/sfuncs/">Stochastic Functions</a></li><li><a class="tocitem" href="../../lib/operators/">Operators</a></li><li><a class="tocitem" href="../../lib/models/">Models</a></li><li><a class="tocitem" href="../../lib/algorithms/">Algorithms</a></li><li><a class="tocitem" href="../../lib/utilities/">Utilities</a></li><li><a class="tocitem" href="../../lib/rtutils/">Runtime Utilities</a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Examples</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Examples</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/charles-river-analytics/Scruff.jl/blob/develop/docs/src/tutorial/examples.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="Examples"><a class="docs-heading-anchor" href="#Examples">Examples</a><a id="Examples-1"></a><a class="docs-heading-anchor-permalink" href="#Examples" title="Permalink"></a></h1><ul><li><a href="https://github.com/p2t2/Scruff.jl/tree/main/docs/examples/rembrandt_example.jl">rembrandt_example.jl</a></li><li><a href="https://github.com/p2t2/Scruff.jl/tree/main/docs/examples/novelty_example.jl">novelty_example.jl</a></li><li><a href="https://github.com/p2t2/Scruff.jl/tree/main/docs/examples/novelty_lazy.jl">novelty_lazy.jl</a></li><li><a href="https://github.com/p2t2/Scruff.jl/tree/main/docs/examples/novelty_filtering.jl">novelty_filtering.jl</a></li><li><a href="https://github.com/charles-river-analytics/Scruff.jl/tree/main/docs/examples/soccer_example.jl">soccer_example.jl</a></li></ul></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../tutorial/">« Tutorial</a><a class="docs-footer-nextpage" href="../../lib/core/">Core »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Wednesday 15 May 2024 16:16">Wednesday 15 May 2024</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
diff --git a/dev/tutorial/tutorial/index.html b/dev/tutorial/tutorial/index.html
index a840090..9ee7871 100644
--- a/dev/tutorial/tutorial/index.html
+++ b/dev/tutorial/tutorial/index.html
@@ -223,4 +223,4 @@
 Posterior mean of velocity = 5.898986723263269
 Observing 20.5 at time 3.5
 Probability of novel = 1.0
-Posterior mean of velocity = 5.86994402484129</code></pre><h2 id="Scruff-concepts"><a class="docs-heading-anchor" href="#Scruff-concepts">Scruff concepts</a><a id="Scruff-concepts-1"></a><a class="docs-heading-anchor-permalink" href="#Scruff-concepts" title="Permalink"></a></h2><p>The central concepts of Scruff are:</p><ul><li>Sfuncs, or stochastic functions, which represent mathematical relationships between variables</li><li>Operators, which define and implement computations on sfuncs</li><li>Models, which specify how to create sfuncs in different situations</li><li>Variables, which represent domain entities that may take on different values at different times</li><li>Networks, which consist of variables and the dependencies between them</li><li>Instances, which represent a specific instantiation of a variable at a point in time</li><li>Algorithms, which use operations to perform computations on networks</li><li>Runtimes, which manage instances as well as information used by algorithms</li></ul><h2 id="Sfuncs"><a class="docs-heading-anchor" href="#Sfuncs">Sfuncs</a><a id="Sfuncs-1"></a><a class="docs-heading-anchor-permalink" href="#Sfuncs" title="Permalink"></a></h2><p>An <code>SFunc</code> has an input type, which is a tuple, and an output type. Although the name implies probabilistic relationships, in principle sfuncs can be used to represent any kind of information. The representation of an sfunc is often quite minimal, with most of the detail contained in operators. The general type is <code>SFunc{I &lt;: Tuple, O}</code>.</p><h3 id="Dists"><a class="docs-heading-anchor" href="#Dists">Dists</a><a id="Dists-1"></a><a class="docs-heading-anchor-permalink" href="#Dists" title="Permalink"></a></h3><p>A <code>Dist{O}</code> is an <code>SFunc{Tuple{}, O}</code>. In other words, a <code>Dist</code> represents an unconditional distribution with no parents. Examples of <code>Dist</code> include <code>Constant</code>, <code>Cat</code>, <code>Flip</code>, and <code>Normal</code>.</p><h3 id="Scores"><a class="docs-heading-anchor" href="#Scores">Scores</a><a id="Scores-1"></a><a class="docs-heading-anchor-permalink" href="#Scores" title="Permalink"></a></h3><p>A <code>Score{I}</code> is an <code>SFunc{Tuple{I}, Nothing}</code>. In other words, it takes a single value of  type <code>I</code>, and rather than produce an output, it just associates information (typically a likelihood) with its input. A <code>Score</code> is often used to represent evidence. Examples of <code>Score</code> include <code>HardScore</code> (only a single value allowed),  <code>SoftScore</code> (allows multiple values), <code>LogScore</code> (similar to <code>SoftScore</code> but represented in log form), <code>FunctionalScore</code> (score is computed by applying a function to the input), <code>NormalScore</code> (representing a normal distribution around a value),  and <code>Parzen</code> (mixture of normal scores).</p><h3 id="Conditional-Sfuncs"><a class="docs-heading-anchor" href="#Conditional-Sfuncs">Conditional Sfuncs</a><a id="Conditional-Sfuncs-1"></a><a class="docs-heading-anchor-permalink" href="#Conditional-Sfuncs" title="Permalink"></a></h3><p>Scruff provides a range of ways to construct sfuncs representing conditional distributions. These are organized in a type hierarchy:</p><p>— <code>Invertible</code>: deterministic functions with a deterministic inverse, enabling efficient operator implementations<br/>— <code>Det</code>: deterministic functions without an inverse<br/>   └ <code>Switch</code>: chooses between multiple incoming choices based on first argument<br/>      └ <code>LinearSwitch</code>: first argument is an integer and switch chooses corresponding result<br/>      └ <code>If</code>: first argument is a Boolean and switch chooses appropriate other argument <br/>— <code>Conditional</code>: abstract representation of sfuncs that use first arguments to create sfunc to apply to other arguments<br/>   └ <code>LinearGaussian</code>: sfunc representing normal distribution whose mean is a linear function of the parents<br/>   └ <code>Table</code>: abstract representation of sfuncs that use first arguments to choose sfunc to apply from a table<br/>      └ <code>DiscreteCPT</code>: discrete conditional probability table<br/>      └ <code>CLG</code>: conditional linear Gaussian model: table of linear Gaussians depending on discrete parents<br/>— <code>Separable</code>: Mixture of <code>DiscreteCPT</code> to decompose dependency on many parents, enabling efficient operator implementations<br/></p><h3 id="Compound-Sfuncs"><a class="docs-heading-anchor" href="#Compound-Sfuncs">Compound Sfuncs</a><a id="Compound-Sfuncs-1"></a><a class="docs-heading-anchor-permalink" href="#Compound-Sfuncs" title="Permalink"></a></h3><p>Compound sfuncs can be though of as a construction kit to compose more complex sfuncs out of simpler ones. These also include some higher-order sfuncs.</p><ul><li><code>Generate</code>: generate a value from its sfunc argument</li><li><code>Apply</code>: similar to generate, but the sfunc argument is applied to another argument</li><li><code>Chain</code>: apply a function to the arguments to produce an sfunc, then generate a value from the sfunc</li><li><code>Mixture</code>: choose which sfunc to use to generate values according to a probability distribution</li><li><code>Serial</code>: connect any number of sfuncs in series</li><li><code>NetworkSFunc</code>: connect any number of sfuncs according to a graph</li><li><code>Expander</code>: apply a function to the arguments to produce a network that can be used recursively</li></ul><h2 id="Operators"><a class="docs-heading-anchor" href="#Operators">Operators</a><a id="Operators-1"></a><a class="docs-heading-anchor-permalink" href="#Operators" title="Permalink"></a></h2><p>An operator represents a computation that can be performed on an sfunc. An operator is not just a function or a method.  It is an object that can contain information (such as configuration instructions) and can be reasoned about, for example to specify policies to choose between alternative implementations. Operators consist of definitions, created using <code>@op_def</code>, which specify type information, and implementation, created using <code>@impl</code>.</p><p>Here are some of the most commonly used operators:</p><ul><li><code>cpdf(sf, parent_values, x)</code> returns the conditional probability of <code>x</code> given <code>parent_values</code></li><li><code>logcpdf(sf, parent_values, x)</code></li><li><code>sample(sf, parent_values)</code></li><li><code>get_score(sf, x)</code> returns the score associated with <code>x</code></li><li><code>get_log_score(sf, x)</code></li><li><code>support(sf, parent_ranges, target_size, current)</code> computes a range of values for the sfunc given that the parents have values in <code>parent_ranges</code>. <code>target_size</code> is guidance as to the size of support to produce, which does not need to be obeyed precisely. <code>current</code> is a list of values that should be included in the support, which is useful for iterative refinement.</li></ul><p>The above operators will be implemented specifically for a given sfunc. In general, an sfunc does not need to support all operators. For example, typically only a <code>Score</code> will support <code>get_score</code> and <code>get_log_score</code>.  Some sfuncs will not be able to support sampling or density computation, and that&#39;s okay. For example, if an sfunc doesn&#39;t support <code>sample</code>, but it does support <code>cpdf</code>, and that sfunc is always observed, it can be used in likelihood weighting. If it is not always observed, it won&#39;t be usable in importance sampling but it might be usable in BP. The goal is to enable representations to be used as much as possible, rather than require everything to work uniformly. This is where the scruffiness of Scruff comes in.</p><p>There are a variety of operators useful in BP and related algorithms. Most of these have default implementations that work for sfuncs in general and you don&#39;t need to worry about implementing them for a new sfunc.  The two that need to be implemented specifically are:</p><ul><li><code>compute_pi(sf, range, parent_ranges, parent_pi_messages)</code>, which integrates over the parents to produce a distribution over the value of the instance associated with the sfunc. The <code>parent_pi_messages</code>, as well as the computed distribution, are represented as <code>Dist</code>s, rather than vectors or anything specific, which enables great flexibility in implementation.</li><li><code>send_lambda(sf, lambda, range, parent_ranges, parent_pi_messages, parent_index)</code> computes the lambda message to be sent to the parent specified by <code>parent_index</code>.</li></ul><p>Once these two operators are implemented for an sfunc, the sfunc can participate in any BP algorithm. Furthermore, sfuncs at the leaves of a network do not need to implement <code>compute_pi</code>. For example, <code>send_lambda</code> can be implemented for a feedforward neural network, enabling it to be included in a general BP inference process.</p><h2 id="Models"><a class="docs-heading-anchor" href="#Models">Models</a><a id="Models-1"></a><a class="docs-heading-anchor-permalink" href="#Models" title="Permalink"></a></h2><p>One of Scruff&#39;s key features is the ability to reason flexibly about variables that vary over time, and, in future, space. This is accomplished using models, which specify how to make the sfunc to use for a particular instance of a variable. Currently, Scruff&#39;s <code>models</code> library is relatively small. We plan to expand it in future, for example with learning models that improve their sfuncs based on experience.</p><p>Here is the current type hierarchy of models</p><p>—<code>InstantModel</code>: for a variable with no dependencies on previous time points<br/>  └ <code>TimelessInstantModel</code>: an <code>InstantModel</code> where the sfunc also does not depend on the current time<br/>  └ <code>SimpleModel</code>: a <code>TimelessInstantModel</code> in which the sfunc to use is passed in the definition of the model<br/>— <code>FixedTimeModel</code>: a model for a variable that depends on its own state at the previous time point and other variables at the current time point. The delta between the current and previous time point must be a fixed <code>dt</code>.<br/>  └ <code>TimelessFixedTimeModel</code>: a <code>FixedTimeModel</code> in which the sfunc does not depend on the current time<br/>  └ <code>HomogenousModel</code>: a <code>TimelessFixedTimeModel</code> in which the initial and transition sfuncs are passed in the definition of the model<br/>— <code>VariableTimeModel</code>: a model for a variable whose transition sfunc depends on the time intervals since the instantiations of its parents (which may be at different times)<br/>  └ <code>StaticModel</code>: a model for a variable whose value is set in the initial time point and never changes afterward<br/></p><h2 id="Networks"><a class="docs-heading-anchor" href="#Networks">Networks</a><a id="Networks-1"></a><a class="docs-heading-anchor-permalink" href="#Networks" title="Permalink"></a></h2><p>Networks contains nodes, which are either variables or placeholders. Unlike variables, placeholders are not associated with models. Rather, they are intended to indicate values that should be received from outside the network. They are particularly useful for recursive reasoning, as well as dynamic inference.</p><p>An <code>InstantNetwork</code> is created with two to four arguments:</p><ul><li>A vector of variables</li><li>A variable graph, associating variables with their parents. If a variable has no parents, it can be omitted from the graph.</li><li>(Optional) A vector of placeholders, which defaults to empty</li><li>(Optional) A vector of outputs, which should be a subset of the variables, again defaults to empty. This is intended to support providing an interface to networks that enables internal nodes and embedded networks to be eliminated, but this feature is not used yet.</li></ul><p>A <code>DynamicNetwork</code> is created with three to six arguments</p><ul><li>A vector of variables</li><li>An initial variable graph</li><li>A transition variable graph</li><li>(Optional) A vector of initial placeholders, defaults to empty</li><li>(Optional) A vector of transition placeholders, defaults to empty</li><li>(Optional) A vector of outputs, defaults to empty</li></ul><h2 id="Algorithms"><a class="docs-heading-anchor" href="#Algorithms">Algorithms</a><a id="Algorithms-1"></a><a class="docs-heading-anchor-permalink" href="#Algorithms" title="Permalink"></a></h2><p>Scruff&#39;s algorithms library is structured so that more complex algorithms can be built out of simpler algorithms. The basic algorithms are instances of <code>InstantAlgorithm</code> and run on an <code>InstantNetwork</code>. Scruff currently provides the following hierarchy of instant algorithms. We intend to expand this list over time:</p><p>— <code>InstantAlgorithm</code>: abstract type for which implementations must implement the <code>infer</code> method<br/>  └ <code>Importance</code>: general importance sampling framework<br/>    └ <code>Rejection</code>: rejection sampling<br/>    └ <code>LW</code>: likelihood weighting<br/>    └ Custom proposal: An importance sampling algorithm can be made from a proposal scheme using <code>make_custom_proposal</code>. A proposal scheme specifies alternative sfuncs to use as alternatives to the prior distribution for specific sfuncs<br/>  └ <code>BP</code>: general belief propagation framework<br/>    └ <code>ThreePassBP</code>: non-loopy belief propagation<br/>    └ <code>LoopyBP</code><br/>  └ <code>VE</code>: variable elimination</p><p>Scruff provides iterative algorithms that gradually improve their answers over time. These follow the following hierarchy:</p><p>— <code>IterativeAlgorithm</code>: abstract type for which implementations must implement the <code>prepare</code> and <code>refine</code> methods<br/>  └ <code>IterativeSampler</code>: iterative algorithm that uses a sampler to increase the number of samples each refinement. For example, you can use <code>IterativeSampler(LW(1000))</code> to use a likelihood weighting algorithm that adds 1,000 more samples on each call to <code>refine</code>.<br/>  └ <code>LazyInference</code>: an algorithm that expands the recursion depth and ranges of variables on each call to <code>refine</code> and then invokes an <code>InstantAlgorithm</code><br/>    └ <code>LSFI</code>: a <code>LazyInference</code> algorithm that uses variable elimination as its instant algorithm</p><p>For filtering, Scruff provides the general <code>Filter</code> class, for which implementations must implement the <code>init_filter</code> and <code>filter_step</code> methods. All current filter implementations in Scruff derive from <code>WindowFilter</code>, where, on each call to <code>filter_step</code>, the algorithm first creates an <code>InstantNetwork</code> representing a window and then invokes an <code>InstantAlgorithm</code>. To create a <code>WindowFilter</code>, you choose a windowing method from <code>SyncWindow</code>, <code>AsyncWindow</code>, and <code>CoherentWindow</code>, and specify the instant algorithm to use. For example, Scruff provides the following constructor for asynchronous BP:</p><pre><code class="nohighlight hljs">AsyncBP(range_size = 10, T = Float64) = WindowFilter(AsyncWindow{T}(), ThreePassBP(range_size))</code></pre><p>Once algorithms have been run, queries can be answered using a uniform interface. This includes methods like <code>marginal</code>, <code>joint</code>, <code>probability</code> (which could be the probability of a specific value or the probability of a predicate), <code>expectation</code>, <code>mean</code>, and <code>variance</code>. As usual, not all algorithms need implement all queries.</p><p>When you implement a new algorithm, you can specify how to answer queries using a standard <code>answer</code> method. Take a look at algorithm implementations to see how this works.</p><h2 id="The-runtime"><a class="docs-heading-anchor" href="#The-runtime">The runtime</a><a id="The-runtime-1"></a><a class="docs-heading-anchor-permalink" href="#The-runtime" title="Permalink"></a></h2><p>Unless you are implementing a new algorithm, you can largely ignore details of the runtime after you have created it, as everything happens under the hood. In general, the responsibilities of the runtime are to:</p><ul><li>Instantiate variables and associate them with the correct instance parents and sfunc</li><li>Identify the appropriate instances of variables at different point in time</li><li>Store and retrieve values associated with instances</li><li>Store and retrieve algorithm state across multiple invocations (e.g., using <code>refine</code>)</li><li>Manage passing of messages between variables</li></ul><h2 id="Future-work"><a class="docs-heading-anchor" href="#Future-work">Future work</a><a id="Future-work-1"></a><a class="docs-heading-anchor-permalink" href="#Future-work" title="Permalink"></a></h2><p>Future work in Scruff will follow five main lines:  developing more extensive libraries, including integration of other frameworks; developing a larger suite of algorithms using compositional methods; developing a more flexible framework of networks and recursive models;  creating spatial and spatiotemporal models with the same flexibility as current temporal models; and operators for performance characterization and optimization. We welcome contributions from the user community. If any of these items catches your interest, let us know and we will be happy to help with design and development.</p><h3 id="Larger-libraries-and-integration-of-other-frameworks"><a class="docs-heading-anchor" href="#Larger-libraries-and-integration-of-other-frameworks">Larger libraries and integration of other frameworks</a><a id="Larger-libraries-and-integration-of-other-frameworks-1"></a><a class="docs-heading-anchor-permalink" href="#Larger-libraries-and-integration-of-other-frameworks" title="Permalink"></a></h3><p>Scruff&#39;s current library, particularly of SFuncs, is fairly minimal, and needs to be extended to provide a fully functional probabilistic programming framework. Our intent is not to write sfuncs ourselves, but rather to wrap existing implementations wherever possible. An immediate goal is to wrap <code>Distributions.jl</code>, while will provide a wide range of <code>Dist</code> sfuncs. We also want to integrate with other probabilistic programming frameworks in Julia, such as Gen.</p><p>In addition, the ability to use data-driven models that don&#39;t support sampling but do support inference is central to Scruff. We want to develop a library of such models, again by integrating with existing frameworks and wrapping with appropriate observations. Algorithms also need to be modified to take advantage of such models.</p><h3 id="More-algorithms"><a class="docs-heading-anchor" href="#More-algorithms">More algorithms</a><a id="More-algorithms-1"></a><a class="docs-heading-anchor-permalink" href="#More-algorithms" title="Permalink"></a></h3><p>It is important that algorithms in Scruff are well-structured and compositional. The algorithms developed so far are a starter set that have been carefully designed with this philosophy. Noticable by its absence is MCMC, which is common in many probabilistic programming frameworks. Gibbs sampling can be implemented as a message passing algorithm and fits well with the current framework. Metropolis-Hastings and reversible jump algorithms will take more thought, but experience with other  probabilistic programming languages should show how to implement them in a consistent, compositional way.</p><p>A very natural next step is to generalize our algorithms to use other semirings besides aum-product. Again, this should happen in a compositional way. It should be possible to say something like <code>with_semiring(semiring, algorithm)</code> and have all computations in operators invoked by the algorithm drawn from the appropriate semiring. If we do this, it will be natural to write learning algorithms like EM and decision-making algorithms using maximum  expected utility using our instant algorithms. This will lead to powerful combinations. Would anyone like asynchronous online EM using BP?</p><p>Similarly, BP is just one example of a variational method. We want to expand BP into a more general compositional variational inference library. Finally, we want to generalize our elimination methods to employ conditioning as well as elimination.</p><h3 id="More-flexible-networks-and-recursion"><a class="docs-heading-anchor" href="#More-flexible-networks-and-recursion">More flexible networks and recursion</a><a id="More-flexible-networks-and-recursion-1"></a><a class="docs-heading-anchor-permalink" href="#More-flexible-networks-and-recursion" title="Permalink"></a></h3><p>The ability for networks to contain other networks is critical to structured, modular, representations as well as efficient inference through encapsulation and conditional compilation. In addition, the ability to generate contained networks stochastically supports open universe modeling.  Scruff currently supports these capabilities through Expanders. However, Expanders were an early addition to Scruff and are not integrated all that well in the most recent Scruff development. NetworkSFuncs are better integrated, but do not currently support containment and recursion. We want to align Expanders and NetworkSFuncs to provide more general structured and recursive networks.</p><h3 id="Spatially-flexible-models"><a class="docs-heading-anchor" href="#Spatially-flexible-models">Spatially flexible models</a><a id="Spatially-flexible-models-1"></a><a class="docs-heading-anchor-permalink" href="#Spatially-flexible-models" title="Permalink"></a></h3><p>Scruff currently has a flexible representation of variables that vary over time, but not of variables that vary over space, or space and time together. We want to provide spatiotemporal networks with the same flexibility as current DynamicNetworks. Moving beyond spatial models, we also want to create a framework for reasoning about variables that vary across graphs, such as social networks.</p><h3 id="Performance-Characterization-and-Optimization"><a class="docs-heading-anchor" href="#Performance-Characterization-and-Optimization">Performance Characterization and Optimization</a><a id="Performance-Characterization-and-Optimization-1"></a><a class="docs-heading-anchor-permalink" href="#Performance-Characterization-and-Optimization" title="Permalink"></a></h3><p>Scruff&#39;s design is intended to enable reasoning about performance characteristics of operators and to support algorithms making decisions about which operators to use. Multiple operator implementations can exist side by side for given sfuncs and algorithms can use policies to decide which ones to use. This capability is currently only exercised in very rudimentary ways. We want to take advantage of this capability to provide a wide set of performance characteristics and intelligent algorithms that use them.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../">« Getting Started</a><a class="docs-footer-nextpage" href="../examples/">Examples »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Tuesday 7 May 2024 20:00">Tuesday 7 May 2024</span>. Using Julia version 1.7.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
+Posterior mean of velocity = 5.86994402484129</code></pre><h2 id="Scruff-concepts"><a class="docs-heading-anchor" href="#Scruff-concepts">Scruff concepts</a><a id="Scruff-concepts-1"></a><a class="docs-heading-anchor-permalink" href="#Scruff-concepts" title="Permalink"></a></h2><p>The central concepts of Scruff are:</p><ul><li>Sfuncs, or stochastic functions, which represent mathematical relationships between variables</li><li>Operators, which define and implement computations on sfuncs</li><li>Models, which specify how to create sfuncs in different situations</li><li>Variables, which represent domain entities that may take on different values at different times</li><li>Networks, which consist of variables and the dependencies between them</li><li>Instances, which represent a specific instantiation of a variable at a point in time</li><li>Algorithms, which use operations to perform computations on networks</li><li>Runtimes, which manage instances as well as information used by algorithms</li></ul><h2 id="Sfuncs"><a class="docs-heading-anchor" href="#Sfuncs">Sfuncs</a><a id="Sfuncs-1"></a><a class="docs-heading-anchor-permalink" href="#Sfuncs" title="Permalink"></a></h2><p>An <code>SFunc</code> has an input type, which is a tuple, and an output type. Although the name implies probabilistic relationships, in principle sfuncs can be used to represent any kind of information. The representation of an sfunc is often quite minimal, with most of the detail contained in operators. The general type is <code>SFunc{I &lt;: Tuple, O}</code>.</p><h3 id="Dists"><a class="docs-heading-anchor" href="#Dists">Dists</a><a id="Dists-1"></a><a class="docs-heading-anchor-permalink" href="#Dists" title="Permalink"></a></h3><p>A <code>Dist{O}</code> is an <code>SFunc{Tuple{}, O}</code>. In other words, a <code>Dist</code> represents an unconditional distribution with no parents. Examples of <code>Dist</code> include <code>Constant</code>, <code>Cat</code>, <code>Flip</code>, and <code>Normal</code>.</p><h3 id="Scores"><a class="docs-heading-anchor" href="#Scores">Scores</a><a id="Scores-1"></a><a class="docs-heading-anchor-permalink" href="#Scores" title="Permalink"></a></h3><p>A <code>Score{I}</code> is an <code>SFunc{Tuple{I}, Nothing}</code>. In other words, it takes a single value of  type <code>I</code>, and rather than produce an output, it just associates information (typically a likelihood) with its input. A <code>Score</code> is often used to represent evidence. Examples of <code>Score</code> include <code>HardScore</code> (only a single value allowed),  <code>SoftScore</code> (allows multiple values), <code>LogScore</code> (similar to <code>SoftScore</code> but represented in log form), <code>FunctionalScore</code> (score is computed by applying a function to the input), <code>NormalScore</code> (representing a normal distribution around a value),  and <code>Parzen</code> (mixture of normal scores).</p><h3 id="Conditional-Sfuncs"><a class="docs-heading-anchor" href="#Conditional-Sfuncs">Conditional Sfuncs</a><a id="Conditional-Sfuncs-1"></a><a class="docs-heading-anchor-permalink" href="#Conditional-Sfuncs" title="Permalink"></a></h3><p>Scruff provides a range of ways to construct sfuncs representing conditional distributions. These are organized in a type hierarchy:</p><p>— <code>Invertible</code>: deterministic functions with a deterministic inverse, enabling efficient operator implementations<br/>— <code>Det</code>: deterministic functions without an inverse<br/>   └ <code>Switch</code>: chooses between multiple incoming choices based on first argument<br/>      └ <code>LinearSwitch</code>: first argument is an integer and switch chooses corresponding result<br/>      └ <code>If</code>: first argument is a Boolean and switch chooses appropriate other argument <br/>— <code>Conditional</code>: abstract representation of sfuncs that use first arguments to create sfunc to apply to other arguments<br/>   └ <code>LinearGaussian</code>: sfunc representing normal distribution whose mean is a linear function of the parents<br/>   └ <code>Table</code>: abstract representation of sfuncs that use first arguments to choose sfunc to apply from a table<br/>      └ <code>DiscreteCPT</code>: discrete conditional probability table<br/>      └ <code>CLG</code>: conditional linear Gaussian model: table of linear Gaussians depending on discrete parents<br/>— <code>Separable</code>: Mixture of <code>DiscreteCPT</code> to decompose dependency on many parents, enabling efficient operator implementations<br/></p><h3 id="Compound-Sfuncs"><a class="docs-heading-anchor" href="#Compound-Sfuncs">Compound Sfuncs</a><a id="Compound-Sfuncs-1"></a><a class="docs-heading-anchor-permalink" href="#Compound-Sfuncs" title="Permalink"></a></h3><p>Compound sfuncs can be though of as a construction kit to compose more complex sfuncs out of simpler ones. These also include some higher-order sfuncs.</p><ul><li><code>Generate</code>: generate a value from its sfunc argument</li><li><code>Apply</code>: similar to generate, but the sfunc argument is applied to another argument</li><li><code>Chain</code>: apply a function to the arguments to produce an sfunc, then generate a value from the sfunc</li><li><code>Mixture</code>: choose which sfunc to use to generate values according to a probability distribution</li><li><code>Serial</code>: connect any number of sfuncs in series</li><li><code>NetworkSFunc</code>: connect any number of sfuncs according to a graph</li><li><code>Expander</code>: apply a function to the arguments to produce a network that can be used recursively</li></ul><h2 id="Operators"><a class="docs-heading-anchor" href="#Operators">Operators</a><a id="Operators-1"></a><a class="docs-heading-anchor-permalink" href="#Operators" title="Permalink"></a></h2><p>An operator represents a computation that can be performed on an sfunc. An operator is not just a function or a method.  It is an object that can contain information (such as configuration instructions) and can be reasoned about, for example to specify policies to choose between alternative implementations. Operators consist of definitions, created using <code>@op_def</code>, which specify type information, and implementation, created using <code>@impl</code>.</p><p>Here are some of the most commonly used operators:</p><ul><li><code>cpdf(sf, parent_values, x)</code> returns the conditional probability of <code>x</code> given <code>parent_values</code></li><li><code>logcpdf(sf, parent_values, x)</code></li><li><code>sample(sf, parent_values)</code></li><li><code>get_score(sf, x)</code> returns the score associated with <code>x</code></li><li><code>get_log_score(sf, x)</code></li><li><code>support(sf, parent_ranges, target_size, current)</code> computes a range of values for the sfunc given that the parents have values in <code>parent_ranges</code>. <code>target_size</code> is guidance as to the size of support to produce, which does not need to be obeyed precisely. <code>current</code> is a list of values that should be included in the support, which is useful for iterative refinement.</li></ul><p>The above operators will be implemented specifically for a given sfunc. In general, an sfunc does not need to support all operators. For example, typically only a <code>Score</code> will support <code>get_score</code> and <code>get_log_score</code>.  Some sfuncs will not be able to support sampling or density computation, and that&#39;s okay. For example, if an sfunc doesn&#39;t support <code>sample</code>, but it does support <code>cpdf</code>, and that sfunc is always observed, it can be used in likelihood weighting. If it is not always observed, it won&#39;t be usable in importance sampling but it might be usable in BP. The goal is to enable representations to be used as much as possible, rather than require everything to work uniformly. This is where the scruffiness of Scruff comes in.</p><p>There are a variety of operators useful in BP and related algorithms. Most of these have default implementations that work for sfuncs in general and you don&#39;t need to worry about implementing them for a new sfunc.  The two that need to be implemented specifically are:</p><ul><li><code>compute_pi(sf, range, parent_ranges, parent_pi_messages)</code>, which integrates over the parents to produce a distribution over the value of the instance associated with the sfunc. The <code>parent_pi_messages</code>, as well as the computed distribution, are represented as <code>Dist</code>s, rather than vectors or anything specific, which enables great flexibility in implementation.</li><li><code>send_lambda(sf, lambda, range, parent_ranges, parent_pi_messages, parent_index)</code> computes the lambda message to be sent to the parent specified by <code>parent_index</code>.</li></ul><p>Once these two operators are implemented for an sfunc, the sfunc can participate in any BP algorithm. Furthermore, sfuncs at the leaves of a network do not need to implement <code>compute_pi</code>. For example, <code>send_lambda</code> can be implemented for a feedforward neural network, enabling it to be included in a general BP inference process.</p><h2 id="Models"><a class="docs-heading-anchor" href="#Models">Models</a><a id="Models-1"></a><a class="docs-heading-anchor-permalink" href="#Models" title="Permalink"></a></h2><p>One of Scruff&#39;s key features is the ability to reason flexibly about variables that vary over time, and, in future, space. This is accomplished using models, which specify how to make the sfunc to use for a particular instance of a variable. Currently, Scruff&#39;s <code>models</code> library is relatively small. We plan to expand it in future, for example with learning models that improve their sfuncs based on experience.</p><p>Here is the current type hierarchy of models</p><p>—<code>InstantModel</code>: for a variable with no dependencies on previous time points<br/>  └ <code>TimelessInstantModel</code>: an <code>InstantModel</code> where the sfunc also does not depend on the current time<br/>  └ <code>SimpleModel</code>: a <code>TimelessInstantModel</code> in which the sfunc to use is passed in the definition of the model<br/>— <code>FixedTimeModel</code>: a model for a variable that depends on its own state at the previous time point and other variables at the current time point. The delta between the current and previous time point must be a fixed <code>dt</code>.<br/>  └ <code>TimelessFixedTimeModel</code>: a <code>FixedTimeModel</code> in which the sfunc does not depend on the current time<br/>  └ <code>HomogenousModel</code>: a <code>TimelessFixedTimeModel</code> in which the initial and transition sfuncs are passed in the definition of the model<br/>— <code>VariableTimeModel</code>: a model for a variable whose transition sfunc depends on the time intervals since the instantiations of its parents (which may be at different times)<br/>  └ <code>StaticModel</code>: a model for a variable whose value is set in the initial time point and never changes afterward<br/></p><h2 id="Networks"><a class="docs-heading-anchor" href="#Networks">Networks</a><a id="Networks-1"></a><a class="docs-heading-anchor-permalink" href="#Networks" title="Permalink"></a></h2><p>Networks contains nodes, which are either variables or placeholders. Unlike variables, placeholders are not associated with models. Rather, they are intended to indicate values that should be received from outside the network. They are particularly useful for recursive reasoning, as well as dynamic inference.</p><p>An <code>InstantNetwork</code> is created with two to four arguments:</p><ul><li>A vector of variables</li><li>A variable graph, associating variables with their parents. If a variable has no parents, it can be omitted from the graph.</li><li>(Optional) A vector of placeholders, which defaults to empty</li><li>(Optional) A vector of outputs, which should be a subset of the variables, again defaults to empty. This is intended to support providing an interface to networks that enables internal nodes and embedded networks to be eliminated, but this feature is not used yet.</li></ul><p>A <code>DynamicNetwork</code> is created with three to six arguments</p><ul><li>A vector of variables</li><li>An initial variable graph</li><li>A transition variable graph</li><li>(Optional) A vector of initial placeholders, defaults to empty</li><li>(Optional) A vector of transition placeholders, defaults to empty</li><li>(Optional) A vector of outputs, defaults to empty</li></ul><h2 id="Algorithms"><a class="docs-heading-anchor" href="#Algorithms">Algorithms</a><a id="Algorithms-1"></a><a class="docs-heading-anchor-permalink" href="#Algorithms" title="Permalink"></a></h2><p>Scruff&#39;s algorithms library is structured so that more complex algorithms can be built out of simpler algorithms. The basic algorithms are instances of <code>InstantAlgorithm</code> and run on an <code>InstantNetwork</code>. Scruff currently provides the following hierarchy of instant algorithms. We intend to expand this list over time:</p><p>— <code>InstantAlgorithm</code>: abstract type for which implementations must implement the <code>infer</code> method<br/>  └ <code>Importance</code>: general importance sampling framework<br/>    └ <code>Rejection</code>: rejection sampling<br/>    └ <code>LW</code>: likelihood weighting<br/>    └ Custom proposal: An importance sampling algorithm can be made from a proposal scheme using <code>make_custom_proposal</code>. A proposal scheme specifies alternative sfuncs to use as alternatives to the prior distribution for specific sfuncs<br/>  └ <code>BP</code>: general belief propagation framework<br/>    └ <code>ThreePassBP</code>: non-loopy belief propagation<br/>    └ <code>LoopyBP</code><br/>  └ <code>VE</code>: variable elimination</p><p>Scruff provides iterative algorithms that gradually improve their answers over time. These follow the following hierarchy:</p><p>— <code>IterativeAlgorithm</code>: abstract type for which implementations must implement the <code>prepare</code> and <code>refine</code> methods<br/>  └ <code>IterativeSampler</code>: iterative algorithm that uses a sampler to increase the number of samples each refinement. For example, you can use <code>IterativeSampler(LW(1000))</code> to use a likelihood weighting algorithm that adds 1,000 more samples on each call to <code>refine</code>.<br/>  └ <code>LazyInference</code>: an algorithm that expands the recursion depth and ranges of variables on each call to <code>refine</code> and then invokes an <code>InstantAlgorithm</code><br/>    └ <code>LSFI</code>: a <code>LazyInference</code> algorithm that uses variable elimination as its instant algorithm</p><p>For filtering, Scruff provides the general <code>Filter</code> class, for which implementations must implement the <code>init_filter</code> and <code>filter_step</code> methods. All current filter implementations in Scruff derive from <code>WindowFilter</code>, where, on each call to <code>filter_step</code>, the algorithm first creates an <code>InstantNetwork</code> representing a window and then invokes an <code>InstantAlgorithm</code>. To create a <code>WindowFilter</code>, you choose a windowing method from <code>SyncWindow</code>, <code>AsyncWindow</code>, and <code>CoherentWindow</code>, and specify the instant algorithm to use. For example, Scruff provides the following constructor for asynchronous BP:</p><pre><code class="nohighlight hljs">AsyncBP(range_size = 10, T = Float64) = WindowFilter(AsyncWindow{T}(), ThreePassBP(range_size))</code></pre><p>Once algorithms have been run, queries can be answered using a uniform interface. This includes methods like <code>marginal</code>, <code>joint</code>, <code>probability</code> (which could be the probability of a specific value or the probability of a predicate), <code>expectation</code>, <code>mean</code>, and <code>variance</code>. As usual, not all algorithms need implement all queries.</p><p>When you implement a new algorithm, you can specify how to answer queries using a standard <code>answer</code> method. Take a look at algorithm implementations to see how this works.</p><h2 id="The-runtime"><a class="docs-heading-anchor" href="#The-runtime">The runtime</a><a id="The-runtime-1"></a><a class="docs-heading-anchor-permalink" href="#The-runtime" title="Permalink"></a></h2><p>Unless you are implementing a new algorithm, you can largely ignore details of the runtime after you have created it, as everything happens under the hood. In general, the responsibilities of the runtime are to:</p><ul><li>Instantiate variables and associate them with the correct instance parents and sfunc</li><li>Identify the appropriate instances of variables at different point in time</li><li>Store and retrieve values associated with instances</li><li>Store and retrieve algorithm state across multiple invocations (e.g., using <code>refine</code>)</li><li>Manage passing of messages between variables</li></ul><h2 id="Future-work"><a class="docs-heading-anchor" href="#Future-work">Future work</a><a id="Future-work-1"></a><a class="docs-heading-anchor-permalink" href="#Future-work" title="Permalink"></a></h2><p>Future work in Scruff will follow five main lines:  developing more extensive libraries, including integration of other frameworks; developing a larger suite of algorithms using compositional methods; developing a more flexible framework of networks and recursive models;  creating spatial and spatiotemporal models with the same flexibility as current temporal models; and operators for performance characterization and optimization. We welcome contributions from the user community. If any of these items catches your interest, let us know and we will be happy to help with design and development.</p><h3 id="Larger-libraries-and-integration-of-other-frameworks"><a class="docs-heading-anchor" href="#Larger-libraries-and-integration-of-other-frameworks">Larger libraries and integration of other frameworks</a><a id="Larger-libraries-and-integration-of-other-frameworks-1"></a><a class="docs-heading-anchor-permalink" href="#Larger-libraries-and-integration-of-other-frameworks" title="Permalink"></a></h3><p>Scruff&#39;s current library, particularly of SFuncs, is fairly minimal, and needs to be extended to provide a fully functional probabilistic programming framework. Our intent is not to write sfuncs ourselves, but rather to wrap existing implementations wherever possible. An immediate goal is to wrap <code>Distributions.jl</code>, while will provide a wide range of <code>Dist</code> sfuncs. We also want to integrate with other probabilistic programming frameworks in Julia, such as Gen.</p><p>In addition, the ability to use data-driven models that don&#39;t support sampling but do support inference is central to Scruff. We want to develop a library of such models, again by integrating with existing frameworks and wrapping with appropriate observations. Algorithms also need to be modified to take advantage of such models.</p><h3 id="More-algorithms"><a class="docs-heading-anchor" href="#More-algorithms">More algorithms</a><a id="More-algorithms-1"></a><a class="docs-heading-anchor-permalink" href="#More-algorithms" title="Permalink"></a></h3><p>It is important that algorithms in Scruff are well-structured and compositional. The algorithms developed so far are a starter set that have been carefully designed with this philosophy. Noticable by its absence is MCMC, which is common in many probabilistic programming frameworks. Gibbs sampling can be implemented as a message passing algorithm and fits well with the current framework. Metropolis-Hastings and reversible jump algorithms will take more thought, but experience with other  probabilistic programming languages should show how to implement them in a consistent, compositional way.</p><p>A very natural next step is to generalize our algorithms to use other semirings besides aum-product. Again, this should happen in a compositional way. It should be possible to say something like <code>with_semiring(semiring, algorithm)</code> and have all computations in operators invoked by the algorithm drawn from the appropriate semiring. If we do this, it will be natural to write learning algorithms like EM and decision-making algorithms using maximum  expected utility using our instant algorithms. This will lead to powerful combinations. Would anyone like asynchronous online EM using BP?</p><p>Similarly, BP is just one example of a variational method. We want to expand BP into a more general compositional variational inference library. Finally, we want to generalize our elimination methods to employ conditioning as well as elimination.</p><h3 id="More-flexible-networks-and-recursion"><a class="docs-heading-anchor" href="#More-flexible-networks-and-recursion">More flexible networks and recursion</a><a id="More-flexible-networks-and-recursion-1"></a><a class="docs-heading-anchor-permalink" href="#More-flexible-networks-and-recursion" title="Permalink"></a></h3><p>The ability for networks to contain other networks is critical to structured, modular, representations as well as efficient inference through encapsulation and conditional compilation. In addition, the ability to generate contained networks stochastically supports open universe modeling.  Scruff currently supports these capabilities through Expanders. However, Expanders were an early addition to Scruff and are not integrated all that well in the most recent Scruff development. NetworkSFuncs are better integrated, but do not currently support containment and recursion. We want to align Expanders and NetworkSFuncs to provide more general structured and recursive networks.</p><h3 id="Spatially-flexible-models"><a class="docs-heading-anchor" href="#Spatially-flexible-models">Spatially flexible models</a><a id="Spatially-flexible-models-1"></a><a class="docs-heading-anchor-permalink" href="#Spatially-flexible-models" title="Permalink"></a></h3><p>Scruff currently has a flexible representation of variables that vary over time, but not of variables that vary over space, or space and time together. We want to provide spatiotemporal networks with the same flexibility as current DynamicNetworks. Moving beyond spatial models, we also want to create a framework for reasoning about variables that vary across graphs, such as social networks.</p><h3 id="Performance-Characterization-and-Optimization"><a class="docs-heading-anchor" href="#Performance-Characterization-and-Optimization">Performance Characterization and Optimization</a><a id="Performance-Characterization-and-Optimization-1"></a><a class="docs-heading-anchor-permalink" href="#Performance-Characterization-and-Optimization" title="Permalink"></a></h3><p>Scruff&#39;s design is intended to enable reasoning about performance characteristics of operators and to support algorithms making decisions about which operators to use. Multiple operator implementations can exist side by side for given sfuncs and algorithms can use policies to decide which ones to use. This capability is currently only exercised in very rudimentary ways. We want to take advantage of this capability to provide a wide set of performance characteristics and intelligent algorithms that use them.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../../">« Getting Started</a><a class="docs-footer-nextpage" href="../examples/">Examples »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Wednesday 15 May 2024 16:16">Wednesday 15 May 2024</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>