Esempio n. 1
0
        public void HS(string fileName1, string fileName2)
        {
            List <Observation> observationsList = MOCreator.ReadObsModelFiles(fileName1, fileName2);

            if (observationsList == null || observationsList.Count == 0)
            {
                return;
            }
            FlipFunction       flip     = new FlipFunction();
            TimeSpan           x        = new TimeSpan(0, 5, 0);
            IterativeDeepening salgo    = new IterativeDeepening(flip, x);
            ConesAlgorithm     algo     = new ConesAlgorithm(salgo);
            Stopwatch          stopwtch = new Stopwatch();
            CSVExport          myExport = new CSVExport();

            salgo.agenda = DiagnosesSearcher.Agenda.helthState;
            foreach (Observation obs in observationsList)
            {
                stopwtch.Start();
                DiagnosisSet diagnoses = algo.FindDiagnoses(obs);
                stopwtch.Stop();
                if (diagnoses != null)
                {
                    myExport.AddRow();
                    myExport["System"]      = obs.TheModel.Id;
                    myExport["Observation"] = obs.Id;
                    myExport["# diagnoses"] = diagnoses.Count;
                    myExport["Runtime"]     = stopwtch.Elapsed;
                }
                stopwtch.Reset();
            }
            myExport.ExportToFile(observationsList.First().TheModel.Id + "HS.csv");
        }
Esempio n. 2
0
        private void createNewDiagnoser()
        {
            FlipFunction       flip  = new FlipFunction();
            TimeSpan           x     = new TimeSpan(0, 1, 0);
            IterativeDeepening salgo = new IterativeDeepening(flip, x);
            ConesAlgorithm     algo  = new ConesAlgorithm(salgo);

            this.Diagnoser = algo;
        }
Esempio n. 3
0
        public void CheckMinCard(string fileName1, string fileName2)
        {
            List <Observation> observationsList = MOCreator.ReadObsModelFiles(fileName1, fileName2);

            if (observationsList == null || observationsList.Count == 0)
            {
                return;
            }
            FlipFunction       flip     = new FlipFunction();
            TimeSpan           x        = new TimeSpan(0, 5, 0);
            IterativeDeepening salgo    = new IterativeDeepening(flip, x);
            ConesAlgorithm     algo     = new ConesAlgorithm(salgo);
            CSVExport          myExport = new CSVExport();

            foreach (Observation obs in observationsList)
            {
                algo.CheckMinCard(obs, myExport);
            }
            myExport.ExportToFile(observationsList.First().TheModel.Id + "MinCard.csv");
        }