Example #1
0
        public void GenerateCasesLarge()
        {
            var dtRaw = new DataTable("allData");

            dtRaw.Columns.Add("Facteur", typeof(double));
            dtRaw.Columns.Add("Dommage", typeof(double));
            dtRaw.Columns.Add("Frais", typeof(double));
            dtRaw.Columns.Add("Depens", typeof(double));
            dtRaw.Columns.Add("Honoraires", typeof(double));
            dtRaw.Columns.Add("ProbaGain", typeof(double));

            foreach (var m in multipliersLarge)
            {
                for (int i = 1; i <= N; i++)
                {
                    var l = new Litige(Math.Round(1 * m));
                    l.decidePremiereInstance();
                    dtRaw.Rows.Add(
                        m,
                        l.dommage,
                        l.fraisJudiciaires,
                        l.depens,
                        l.honoraireAvocats,
                        l.calculeProbabiliteMinimum()
                        );
                }
            }
            Csv.Write(dtRaw, foDataLarge);
        }
Example #2
0
        public void CalculTauxProcedure()
        {
            var dt = new DataTable("choice");

            dt.Columns.Add("Facteur", typeof(double));
            dt.Columns.Add("TauxProces", typeof(double));
            dt.Columns.Add("Type", typeof(string));

            foreach (var m in multipliersTaux)
            {
                int count = 0, countSans = 0, countAvec = 0, countDemi = 0;
                for (int i = 1; i <= N; i++)
                {
                    count++;
                    var l = new Litige(m);
                    if (l.decidePremiereInstance())
                    {
                        countAvec++;
                    }
                    if (l.decidePremiereInstanceSansAvocat())
                    {
                        countSans++;
                    }
                    if (l.decidePremiereInstanceDemiAvance())
                    {
                        countDemi++;
                    }
                }
                System.Console.WriteLine("Finished set {0} ; total {1} simulations", m, count);
                dt.Rows.Add(m, ((double)countSans) / N, "CPC sans avocat");
                dt.Rows.Add(m, ((double)countAvec) / N, "CPC avec avocat");
                dt.Rows.Add(m, ((double)countDemi) / N, "P-CPC avec avocat");
            }
            var foTaux = new FileInfo(Path.Combine(doBase.FullName, "results-taux.csv"));

            Csv.Write(dt, foTaux);
        }