public void TestPrioritySelection()
{
var m = new Marking(3, new Dictionary<int, int>
{
{ 0, 1 } ,
{ 1, 1 } ,
{ 2, 1 }
});
var p = new MatrixPetriNet("p",
new Dictionary<int, string> {
{0, "p0"},
{1, "p1"},
{2, "p2"}
},
new Dictionary<int, string>
{
{ 0, "t1" },
{ 1, "t2" }
},
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)}}
},
new Dictionary<int, List<OutArc>>() { },
new Dictionary<int, int>() { { 1, 1 } }); // 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(1, transId.Value);
}