public void TestMarkingFlowInBifurcatedTransition()
{
var m = new Marking(3);
var p = new MatrixPetriNet("p",
new Dictionary<int, string> {
{(int)Places.p1, "p1"},
{(int)Places.p2, "p2"},
{(int)Places.p3, "p3"}
},
new Dictionary<int, string>
{
{ (int)Transitions.t1, "t1" }
},
new Dictionary<int, List<InArc>>(){
{(int)Transitions.t1, new List<InArc>(){new InArc((int)Places.p1)}}
},
new Dictionary<int, List<OutArc>>(){
{(int)Transitions.t1, new List<OutArc>(){new OutArc((int)Places.p2),
new OutArc((int)Places.p3)}}
});
AssertMarkings(m, new Dictionary<Places, double>{
{ Places.p1, 0 },
{ Places.p2, 0 },
{ Places.p3, 0 } });
m[(int)Places.p1] = 1;
AssertMarkings(m, new Dictionary<Places, double>{
{ Places.p1, 1 },
{ Places.p2, 0 },
{ Places.p3, 0 } });
m = p.Fire(m);
AssertMarkings(m, new Dictionary<Places, double>{
{ Places.p1, 0 },
{ Places.p2, 1 },
{ Places.p3, 1 } });
}