public void StepwiseProbablityOfNotLabel1UntilLabel2ForExample4()
        {
            var example = new Example4();
            var dtmc    = example.MarkovChain;

            var results = new List <Probability>();

            using (var prismChecker = new BuiltinDtmcModelChecker(dtmc, Output.TextWriterAdapter()))
            {
                for (var i = 0; i <= 10; i++)
                {
                    var boundedStepi       = new BoundedBinaryFormula(new UnaryFormula(MarkovChainExample.Label1Formula, UnaryOperator.Not), BinaryOperator.Until, MarkovChainExample.Label2Formula, i);
                    var resultBoundedStepi = prismChecker.CalculateProbability(boundedStepi);
                    Output.Log($"Result {i}:\t{resultBoundedStepi}");
                    results.Add(resultBoundedStepi);
                }

                var boundedStep200       = new BoundedBinaryFormula(new UnaryFormula(MarkovChainExample.Label1Formula, UnaryOperator.Not), BinaryOperator.Until, MarkovChainExample.Label2Formula, 200);
                var resultBoundedStep200 = prismChecker.CalculateProbability(boundedStep200);
                Output.Log($"Result {200}:\t{resultBoundedStep200}");

                /*
                 * var inf = new BinaryFormula(new UnaryFormula(MarkovChainExample.Label1Formula, UnaryOperator.Not), BinaryOperator.Until, MarkovChainExample.Label2Formula);
                 * var resultInf = prismChecker.CalculateProbability(inf);
                 * Output.Log($"Result inf:\t{resultInf}");
                 */
            }
        }
        public void StepwiseProbablityOfLabel2ForExample4()
        {
            var example = new Example4();
            var ltmc    = example.Ltmc;

            var results = new List <Probability>();

            using (var prismChecker = new BuiltinLtmcModelChecker(ltmc, Output.TextWriterAdapter()))
            {
                for (var i = 0; i <= 10; i++)
                {
                    var boundedStepi       = new BoundedUnaryFormula(LabeledTransitionMarkovChainExample.Label2Formula, UnaryOperator.Finally, i);
                    var resultBoundedStepi = prismChecker.CalculateProbability(boundedStepi);
                    Output.Log($"Result {i}:\t{resultBoundedStepi}");
                    results.Add(resultBoundedStepi);
                }

                var boundedStep200       = new BoundedUnaryFormula(LabeledTransitionMarkovChainExample.Label2Formula, UnaryOperator.Finally, 200);
                var resultBoundedStep200 = prismChecker.CalculateProbability(boundedStep200);
                Output.Log($"Result {200}:\t{resultBoundedStep200}");

                /*
                 * var inf = new UnaryFormula(LabeledTransitionMarkovChainExample.Label2Formula, UnaryOperator.Finally);
                 * var resultInf = prismChecker.CalculateProbability(inf);
                 * Output.Log($"Result inf:\t{resultInf}");
                 */
            }
        }
示例#3
0
文件: Program.cs 项目: wzchua/docs
 static void Main(string[] args)
 {
     Example.Main();
     Example2.Main();
     Example3.Main();
     Example4.Main();
     ExampleDiscard.Main();
     ExampleClassDeconstruction.Main();
     ExampleExtension.Main();
 }
示例#4
0
 static void Main(string[] args)
 {
     Example.Main();
     Example2.Main();
     Example3.Main();
     Example4.Main();
     ExampleDiscard.Main();
     ExampleClassDeconstruction.Main();
     ExampleExtension.Main();
     ExampleNullableEx.Main();
     ExampleSystem.KeyValuePair();
 }
        public void Example4Test()
        {
            Example4 example;

            example           = new Example4();
            example.Property1 = "aAa";
            example.Property2 = "bBb";
            example.Transform();

            Assert.AreEqual("aaa", example.Property1);
            Assert.AreEqual("bbb", example.Property2);
        }
示例#6
0
        static void Main(string[] args)
        {
            bool print = args.Contains("--print");

            Check("Example  1", Example1.Run(print));
            Check("Example  2", Example2.Run(print));
            Check("Example  3", Example3.Run(print));
            Check("Example  4", Example4.Run(print));
            Check("Example  5", Example5.Run(print));
            Check("Example  6", Example6.Run(print));
            Check("Example  7", Example7.Run(print));
            Check("Example  8", Example8.Run(print));
            Check("Example  9", Example9.Run());
            Check("Example 10", Example10.Run(print));
            Check("Example 11", Example11.Run(print));
        }
示例#7
0
        static void Main()
        {
            Example1 example1 = new Example1();

            example1.ShowExample();

            Example2 example2 = new Example2();

            example2.ShowExample();

            Example3 example3 = new Example3();

            example3.ShowExample();

            Example4 example4 = new Example4();

            example4.ShowExample();

            Example5 example5 = new Example5();

            example5.ShowExample();

            Console.ReadKey();
        }
示例#8
0
    static void Main(string[] args)
    {
        int sel = -1;

        if (args != null && args.Count() > 0)
        {
            if (!Int32.TryParse(args[0], out sel))
            {
                sel = -1;
            }
        }
        switch (sel)
        {
        case 0:
            Console.WriteLine("Example 0: GET ACCOUNTS AND TINTERFACES");
            Example0.Main0(args);
            break;

        case 1:
            Console.WriteLine("Example 1: PRICE STREAMING");
            Example1.Main1(args);
            break;

        case 2:
            Console.WriteLine("Example 2: PRICE POLLING");
            Example2.Main2(args);
            break;

        case 3:
            Console.WriteLine("Example 3: POSITION STREAMING");
            Example3.Main3(args);
            break;

        case 4:
            Console.WriteLine("Example 4: POSITION POLLING");
            Example4.Main4(args);
            break;

        case 5:
            Console.WriteLine("Example 5: ORDER STREAMING");
            Example5.Main5(args);
            break;

        case 6:
            Console.WriteLine("Example 6: ORDER POLLING");
            Example6.Main6(args);
            break;

        case 7:
            Console.WriteLine("Example 7: ORDER CREATION");
            Example7.Main7(args);
            break;

        case 8:
            Console.WriteLine("Example 8: CANCEL PENDING ORDER WITH ORDER POLLING");
            Example8.Main8(args);
            break;

        case 9:
            Console.WriteLine("Example 9: MODIFY PENDING ORDER WITH ORDER POLLING");
            Example9.Main9(args);
            break;

        case 10:
            Console.WriteLine("Example 10: CANCEL PENDING ORDER WITH ORDER STREAMING");
            Example10.Main10(args);
            break;

        case 11:
            Console.WriteLine("Example 11: MODIFY PENDING ORDER WITH ORDER STREAMING");
            Example11.Main11(args);
            break;

        case 12:
            Console.WriteLine("Example 12: STRATEGY");
            Example12.Main12(args);
            break;

        case 13:
            Console.WriteLine("Example 13: MULTIPLE ORDER CREATION");
            Example13.Main13(args);
            break;

        case 14:
            Console.WriteLine("Example 14: GET HISTORICAL PRICE");
            Example14.Main14(args);
            break;

        default:
            Console.WriteLine("Choose option: ");
            Console.WriteLine("-1: EXIT");
            Console.WriteLine(" 0: GET ACCOUNTS AND TINTERFACES");
            Console.WriteLine(" 1: PRICE STREAMING");
            Console.WriteLine(" 2: PRICE POLLING");
            Console.WriteLine(" 3: POSITION STREAMING");
            Console.WriteLine(" 4: POSITION POLLING");
            Console.WriteLine(" 5: ORDER STREAMING");
            Console.WriteLine(" 6: ORDER POLLING");
            Console.WriteLine(" 7: ORDER CREATION");
            Console.WriteLine(" 8: CANCEL PENDING ORDER WITH ORDER POLLING");
            Console.WriteLine(" 9: MODIFY PENDING ORDER WITH ORDER POLLING");
            Console.WriteLine("10: CANCEL PENDING ORDER WITH ORDER STREAMING");
            Console.WriteLine("11: MODIFY PENDING ORDER WITH ORDER STREAMING");
            Console.WriteLine("12: STRATEGY");
            Console.WriteLine("13: MULTIPLE ORDER CREATION");
            Console.WriteLine("14: GET HISTORICAL PRICE");
            string input = Console.ReadLine();
            if (input.Equals("-1"))
            {
                Console.WriteLine("Exit");
                return;
            }
            string[] newargs = new string[1];
            newargs[0] = input;
            Main(newargs);
            break;
        }
    }