1classdef StatefulNode < Node
2 % An abstract
class for
nodes that under some
3 % parametrizations can be stateful
5 % Copyright (c) 2012-2026, Imperial College London
16 function self = StatefulNode(name)
17 % SELF = STATEFULNODE(NAME)
24 function prior = getStatePrior(self)
25 % PRIOR = GETSTATEPRIOR()
26 % prior(j) = probability that the initial state
is state(j)
27 prior = self.statePrior;
30 function self = setStatePrior(self, prior)
31 % SELF = SETSTATEPRIOR(PRIOR)
32 % the prior
is marginalized on the station state and thus
33 % assumed independent of the priors
for other stations
34 self.statePrior = prior(:); % we
do not normalize to allow the user to manually run a model
for each point of an external prior
35 if size(self.statePrior,1) ~= size(self.space,1)
36 line_error(mfilename,'The prior probability vector must have the same rows of the station state space.');
40 function self = setState(self, state)
41 % SELF = SETSTATE(STATE)
42 % state can be stacked in a matrix of states, a state space
46 function state = getState(self)
51 function state = getStateSpace(self)
52 % STATE = GETSTATESPACE()
56 function self = setStateSpace(self, space)
57 % SELF = SETSTATESPACE(SPACE)
59 % mState.getHash = memoize(@(x) self.State.getHash(x));
62 function self = resetStateSpace(self)
63 % SELF = RESETSTATESPACE()