Exemple #1
0
        public PMReplay()
        {
            InitializeComponent();

            TokenReplayResult replayResult = TokenReplayAlgorithm.Replay((PetriNet)Viewer.CurrentField.ProcessModel, Viewer.CurrentField.EventLog);

            ReplayResultsView.ItemsSource = replayResult.ToDictionary();
            NotFoundView.ItemsSource      = replayResult.GetTransitionsNotFoundAsDictionary();
            NotEnabledView.ItemsSource    = replayResult.GetTransitionsNotEnabledAsDictionary();
        }
Exemple #2
0
        public void ToDictionaryTest()
        {
            var result = new TokenReplayResult
            {
                FailedCasesTransitionNotEnabled = new List <Case> {
                    new Case(), new Case()
                },
                FailedCasesTransitionNotFound = new List <Case> {
                    new Case()
                },
                NumberOfCases     = 5,
                SuccessfulReplays = 2
            };

            var dict = (Dictionary <string, string>)result.ToDictionary();

            Assert.AreEqual("2", dict["Successful Replays"]);
            Assert.AreEqual("40%", dict["Success Rate"]);
            Assert.AreEqual("2", dict["Transitions not enabled"]);
            Assert.AreEqual("1", dict["Transitions not found"]);
        }