TestProject1.TestMatrixPetriNet.TestPrioritySelection2 C# (CSharp) Method

TestPrioritySelection2() private method

private TestPrioritySelection2 ( ) : void
return void
        public void TestPrioritySelection2()
        {
            var m = new Marking(4, new Dictionary<int, int>
                    {
                        { 0, 1 } ,
                        { 1, 1 } ,
                        { 2, 1 } ,
                        { 3, 1 }
                    });
            var p = new MatrixPetriNet("p",
               new Dictionary<int, string> {
                    {0, "p0"},
                    {1, "p1"},
                    {2, "p2"},
                    {3, "p3"}
                },
               new Dictionary<int, string>
                    {
                        { 0, "t1" },
                        { 1, "t2" },
                        { 2, "t3" }
                    },
               new Dictionary<int, List<InArc>>(){
                    {0, new List<InArc>(){new InArc(0),new InArc(1)}},
                    {1, new List<InArc>(){new InArc(1),new InArc(2)}},
                    {2, new List<InArc>(){new InArc(1),new InArc(2),new InArc(3)}}
                },
               new Dictionary<int, List<OutArc>>() { },
               new Dictionary<int, int>()
               {
                    { 0, 1 } ,
                    { 1, 1 } ,
                    { 2, 4 }
               }); // t0 will be baseline at 0 and t1 will be 1, therefore next enabled transition should always be 1
            int? transId = p.GetNextTransitionToFire(m);
            Assert.IsTrue(transId.HasValue);
            Assert.AreEqual(2, transId.Value);
        }