internal NestedMarkovDecisionProcess ConvertToNmdp(LabeledTransitionMarkovDecisionProcess ltmdp)
        {
            var ltmdpToNmdp = new LtmdpToNmdp(ltmdp);
            var nmdp        = ltmdpToNmdp.NestedMarkovDecisionProcess;

            if (Configuration.WriteGraphvizModels)
            {
                Configuration.DefaultTraceOutput.WriteLine("Nmdp Model");
                nmdp.ExportToGv(Configuration.DefaultTraceOutput);
            }
            return(nmdp);
        }
Exemplo n.º 2
0
        /// <summary>
        ///   Generates a <see cref="MarkovDecisionProcess" /> for the model created by <paramref name="createModel" />.
        /// </summary>
        private NestedMarkovDecisionProcess GenerateMarkovDecisionProcess(AnalysisModelCreator <TExecutableModel> createModel, Formula terminateEarlyCondition, Formula[] executableStateFormulas)
        {
            using (var checker = new LtmdpGenerator <TExecutableModel>(createModel, terminateEarlyCondition, executableStateFormulas, OutputWritten, Configuration))
            {
                PrintStateFormulas(executableStateFormulas);

                var ltmdp = checker.GenerateStateGraph();

                if (Configuration.WriteGraphvizModels)
                {
                    Configuration.DefaultTraceOutput.WriteLine("Ltmdp Model");
                    ltmdp.ExportToGv(Configuration.DefaultTraceOutput);
                }

                var ltmdpToNmdp = new LtmdpToNmdp(ltmdp);
                var nmdp        = ltmdpToNmdp.NestedMarkovDecisionProcess;
                if (Configuration.WriteGraphvizModels)
                {
                    Configuration.DefaultTraceOutput.WriteLine("Nmdp Model");
                    nmdp.ExportToGv(Configuration.DefaultTraceOutput);
                }
                return(nmdp);
            }
        }