Ejemplo n.º 1
0
        public static void RunTest()
        {
            ModelObservationCreator cc           = new ModelObservationCreator();
            List <Observation>      a            = cc.ReadObsModelFiles("111.txt", "111_obs.txt");
            Observation             bObservation = a[0];

            List <Gate> allComponents = bObservation.TheModel.Components;

            // 11 , 22 , 33
            // 44 , 22 , 55

            Conflict c1 = new Conflict(new List <Gate>()
            {
                allComponents[0], allComponents[2], allComponents[3]
            });
            Conflict c2 = new Conflict(new List <Gate>()
            {
                allComponents[1], allComponents[2], allComponents[4]
            });

            ConflictSet cs = new ConflictSet();

            cs.Conflicts = new List <Conflict>()
            {
                c1, c2
            };

            MicC_Diagnosis minCDiagnosis = A_MinCAlgorithm.FindMinC(cs);

            foreach (Gate g in minCDiagnosis.TheDiagnosis)
            {
                Console.WriteLine("Gate = " + g.Id);
            }
            Console.WriteLine("A_MinC Unit test 1. minc = " + minCDiagnosis.cardinality);

            int x = 0;
        }
Ejemplo n.º 2
0
        public static void RunTest()
        {
            Gate g1 = new OneInputComponent(1, Gate.Type.and);
            Gate g2 = new OneInputComponent(2, Gate.Type.and);
            Gate g3 = new OneInputComponent(3, Gate.Type.and);
            Gate g4 = new OneInputComponent(4, Gate.Type.and);
            Gate g5 = new OneInputComponent(5, Gate.Type.and);
            Gate g6 = new OneInputComponent(6, Gate.Type.and);

            Conflict c1 = new Conflict(new List <Gate>()
            {
                g1, g2, g3, g4
            });
            Conflict c2 = new Conflict(new List <Gate>()
            {
                g1, g5, g6
            });
            Conflict c3 = new Conflict(new List <Gate>()
            {
                g5, g6
            });

            ConflictSet cs = new ConflictSet();

            cs.Conflicts = new List <Conflict>()
            {
                c1, c2, c3
            };

            MicC_Diagnosis minCDiagnosis = A_MinCAlgorithm.FindMinC(cs);

            foreach (Gate g in minCDiagnosis.TheDiagnosis)
            {
                Console.WriteLine("Gate = " + g.Id);
            }
            Console.WriteLine("A_MinC Unit test 1. minc = " + minCDiagnosis.cardinality);
        }