internal static IEnumerable <SeriesTerm <T> > Evolve <T>(TimeSeries <T> series) where T : struct { if (States.TryGetValue(series.Id, out IPolyrand random)) { while (true) { var term = Term(series.Observed.Index + 1, random.Next <T>(series.Domain)); series.Witnessed(term); yield return(term); } } }
public static SeriesTerm <T> NextTerm <T>(TimeSeries <T> series) where T : struct { if (States.TryGetValue(series.Id, out IPolyrand random)) { var term = Term(series.Observed.Index + 1, random.Next <T>(series.Domain)); series.Witnessed(term); return(term); } else { return(series.Observed); } }