Ejemplo n.º 1
0
 static void UpdatePredictionsParallel(AccountRepository accounts)
 {
     Parallel.ForEach(accounts.AllAccounts, account =>
     {
         Trend trend           = SampleUtilities.Fit(account.Balance);
         double prediction     = trend.Predict(account.Balance.Length + NumberOfMonths);
         account.ParPrediction = prediction;
         account.ParWarning    = prediction < account.Overdraft;
     });
 }
Ejemplo n.º 2
0
 static void UpdatePredictionsSequential(AccountRepository accounts)
 {
     foreach (Account account in accounts.AllAccounts)
     {
         Trend  trend      = SampleUtilities.Fit(account.Balance);
         double prediction = trend.Predict(account.Balance.Length + NumberOfMonths);
         account.SeqPrediction = prediction;
         account.SeqWarning    = prediction < account.Overdraft;
     }
 }