예제 #1
0
 private void RefreshRate()
 {
     foreach (RouteItem r in routes)
     {
         double npv = Npv.CalculateNpv(root, r, DiscountRate / 100);
         r.Npv = npv;
     }
 }
예제 #2
0
        private void CalculateNpv()
        {
            // Doan nay de test
            List <RouteItem> routes;

            try
            {
                routes = Npv.ListAllPaths(root);
            }
            catch (Exception)
            {
                MessageBox.Show("Lỗi", "Cây quyết định không hợp lệ");
                return;
            }
            Routes.Clear();
            foreach (RouteItem r in routes)
            {
                double npv = Npv.CalculateNpv(root, r, DiscountRate / 100);
                Console.WriteLine(r.ToString() + ": " + npv);
                r.Npv = npv;
                Routes.Add(r);
            }
        }