Esempio n. 1
0
 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);
         }
     }
 }
Esempio n. 2
0
 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);
     }
 }