Пример #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;
     });
 }
Пример #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;
     }
 }