/// <summary>
        /// Interface for calculating Casual Footprint fitness
        /// </summary>
        /// <param name="pathToLogToBeMined">Path to the log file, from which we will mine the model using Petri net</param>
        /// <param name="pathToLogFile"></param>
        /// <returns>fitness E [0,1]</returns>
        public static double CalculateCasualFootprintFitness(string pathToLogToBeMined, string pathToLogFile)
        {
            Dictionary <List <string>, int> log      = FileParser.ParseXES(pathToLogToBeMined);
            Dictionary <List <string>, int> logNoisy = FileParser.ParseXES(pathToLogFile);

            PetriNet minedModel = AlphaMiner.mine(log);

            return((double)CasualFootprints.CalculateCasualFootprintFitness(minedModel, logNoisy));
        }
        /// <summary>
        /// Token replay technique
        /// </summary>
        /// <param name="pathToLogToBeMined"></param>
        /// <param name="pathToLogFile">path to the log file</param>
        /// <returns>Fitness E [0;1]</returns>
        public static double TokenReplayFitness(string pathToLogToBeMined, string pathToLogFile)
        {
            Dictionary <List <string>, int> log      = FileParser.ParseXES(pathToLogToBeMined);
            Dictionary <List <string>, int> logNoisy = FileParser.ParseXES(pathToLogFile);

            PetriNet minedModel = AlphaMiner.mine(log);

            return((double)TokenReplayFitness(minedModel, logNoisy));
        }
        /// <summary>
        /// Test
        /// </summary>
        public static void TestConformanceChecking()
        {
            Dictionary <List <string>, int> log = FileParser.ParseXES(
                @"D:\New folder\conformance-checking-c-\ProcessMiningC#\ProcessMining\extension-log.xes");
            Dictionary <List <string>, int> log_noisy =
                FileParser.ParseXES(
                    @"D:\New folder\conformance-checking-c-\ProcessMiningC#\ProcessMining\extension-log-noisy.xes");

            PetriNet minedModel = AlphaMiner.mine(log);

            var casualFitness      = CasualFootprints.CalculateCasualFootprintFitness(minedModel, log);
            var casualFitnessNoisy = CasualFootprints.CalculateCasualFootprintFitness(minedModel, log_noisy);

            Console.WriteLine($"CasualFootprint fitness of the same logs and model: {casualFitness}");
            Console.WriteLine($"CasualFootprint fitness of the model and noisy logs: {casualFitnessNoisy}");

            Console.WriteLine(ConformanceChecking.TokenReplayFitness(minedModel, log));
            Console.WriteLine(ConformanceChecking.TokenReplayFitness(minedModel, log_noisy));

            Console.ReadLine();
        }
Exemple #4
0
        public static void test_alpha_miner(string pathToLog)
        {
            var minedModel = AlphaMiner.mine(FileParser.ParseXES(pathToLog));



            List <string> trace = new List <string>()
            {
                "record issue", "inspection", "intervention authorization", "work mandate", "work completion", "issue completion"
            };

            //var cost = minedModel.GetShortestPath(minedModel.TransitionNameToId("inspection"),
            //    minedModel.TransitionNameToId("issue completion"), null);

            //Console.WriteLine(cost);

            foreach (var a in trace)
            {
                check_enabled(minedModel);
                minedModel.FireTransition(minedModel.TransitionNameToId(a));
            }
        }
        /// <summary>
        /// Interface for calculating Casual Footprint fitness
        /// </summary>
        /// <param name="net">Petri net representing the model</param>
        /// <param name="pathToLogFile"></param>
        /// <returns>fitness E [0,1]</returns>
        public static double CalculateCasualFootprintFitness(PetriNet net, string pathToLogFile)
        {
            Dictionary <List <string>, int> log = FileParser.ParseXES(pathToLogFile);

            return((double)CasualFootprints.CalculateCasualFootprintFitness(net, log));
        }
        /// <summary>
        /// Token replay technique
        /// </summary>
        /// <param name="minedNet">Mined model</param>
        /// <param name="pathToLogFile">path to the log file</param>
        /// <returns>Fitness E [0;1]</returns>
        public static double TokenReplayFitness(PetriNet minedNet, string pathToLogFile)
        {
            Dictionary <List <string>, int> log = FileParser.ParseXES(pathToLogFile);

            return(TokenReplayFitness(minedNet, log));
        }