コード例 #1
0
        internal DiscreteTimeMarkovChain ConvertToMarkovChain(AnalysisConfiguration configuration, LabeledTransitionMarkovChain labeledTransitionMarkovChain)
        {
            var ltmcToMc    = new LtmcToDtmc(labeledTransitionMarkovChain);
            var markovChain = ltmcToMc.MarkovChain;

            if (configuration.WriteGraphvizModels)
            {
                configuration.DefaultTraceOutput.WriteLine("Dtmc Model");
                markovChain.ExportToGv(configuration.DefaultTraceOutput);
            }
            return(markovChain);
        }
コード例 #2
0
        /// <summary>
        ///   Generates a <see cref="DiscreteTimeMarkovChain" /> for the model created by <paramref name="createModel" />.
        /// </summary>
        private DiscreteTimeMarkovChain GenerateMarkovChain(AnalysisModelCreator <TExecutableModel> createModel, Formula terminateEarlyCondition, Formula[] executableStateFormulas)
        {
            using (var checker = new LtmcGenerator <TExecutableModel>(createModel, terminateEarlyCondition, executableStateFormulas, OutputWritten, Configuration))
            {
                PrintStateFormulas(executableStateFormulas);

                var labeledTransitionMarkovChain = checker.GenerateStateGraph();

                if (Configuration.WriteGraphvizModels)
                {
                    Configuration.DefaultTraceOutput.WriteLine("Ltmc Model");
                    labeledTransitionMarkovChain.ExportToGv(Configuration.DefaultTraceOutput);
                }

                var ltmcToMc    = new LtmcToDtmc(labeledTransitionMarkovChain);
                var markovChain = ltmcToMc.MarkovChain;
                if (Configuration.WriteGraphvizModels)
                {
                    Configuration.DefaultTraceOutput.WriteLine("Dtmc Model");
                    markovChain.ExportToGv(Configuration.DefaultTraceOutput);
                }
                return(markovChain);
            }
        }