Skip to content

Commit f581f5c

Browse files
committed
Add more reference files
- Align components for all examples of package DisTest
1 parent f25060d commit f581f5c

29 files changed

+261
-134
lines changed

PNlib/Examples/DisTest/ConflictPrio.mo

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,30 @@ within PNlib.Examples.DisTest;
22
model ConflictPrio
33
extends Modelica.Icons.Example;
44

5-
PNlib.PD P1(nIn = 1, startTokens = 2, nOut = 2) annotation(Placement(transformation(extent = {{-60, -10}, {-40, 10}})));
6-
PNlib.TD T1(nIn = 1, nOut = 1) annotation(Placement(transformation(extent = {{-6, 40}, {14, 60}})));
7-
PNlib.TD T2(nIn = 1, nOut = 1) annotation(Placement(transformation(extent = {{-6, -40}, {14, -20}})));
8-
PNlib.PD P2(nIn = 1) annotation(Placement(transformation(extent = {{40, 40}, {60, 60}})));
9-
PNlib.PD P3(nIn = 1) annotation(Placement(transformation(extent = {{40, -40}, {60, -20}})));
10-
PNlib.TD T3(nOut = 1) annotation(Placement(transformation(extent = {{-102, -10}, {-82, 10}})));
11-
inner PNlib.Settings settings1 annotation(Placement(transformation(extent = {{-82, 54}, {-62, 74}})));
5+
PNlib.PD P1(nIn = 1, startTokens = 2, nOut = 2) annotation(Placement(transformation(extent={{-30,-10},
6+
{-10,10}})));
7+
PNlib.TD T1(nIn = 1, nOut = 1) annotation(Placement(transformation(extent={{0,10},{
8+
20,30}})));
9+
PNlib.TD T2(nIn = 1, nOut = 1) annotation(Placement(transformation(extent={{0,-30},
10+
{20,-10}})));
11+
PNlib.PD P2(nIn = 1) annotation(Placement(transformation(extent={{30,10},{50,30}})));
12+
PNlib.PD P3(nIn = 1) annotation(Placement(transformation(extent={{30,-30},{50,
13+
-10}})));
14+
PNlib.TD T3(nOut = 1) annotation(Placement(transformation(extent={{-60,-10},{-40,
15+
10}})));
16+
inner PNlib.Settings settings1 annotation(Placement(transformation(extent={{-60,20},
17+
{-40,40}})));
1218
equation
13-
connect(T3.outPlaces[1], P1.inTransition[1]) annotation(Line(points = {{-87.2, 0}, {-60.8, 0}}, color = {0, 0, 0}, smooth = Smooth.None));
14-
connect(P1.outTransition[1], T1.inPlaces[1]) annotation(Line(points = {{-39.2, -0.5}, {-20, -0.5}, {-20, 50}, {-0.8, 50}}, color = {0, 0, 0}, smooth = Smooth.None));
15-
connect(T1.outPlaces[1], P2.inTransition[1]) annotation(Line(points = {{8.8, 50}, {39.2, 50}}, color = {0, 0, 0}, smooth = Smooth.None));
16-
connect(T2.inPlaces[1], P1.outTransition[2]) annotation(Line(points = {{-0.8, -30}, {-20.4, -30}, {-20.4, 0.5}, {-39.2, 0.5}}, color = {0, 0, 0}, smooth = Smooth.None));
17-
connect(T2.outPlaces[1], P3.inTransition[1]) annotation(Line(points = {{8.8, -30}, {39.2, -30}}, color = {0, 0, 0}, smooth = Smooth.None));
18-
annotation(Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}), graphics), experiment(StartTime=0.0, StopTime=10.0));
19+
connect(T3.outPlaces[1], P1.inTransition[1]) annotation(Line(points={{-45.2,0},
20+
{-30.8,0}}, color = {0, 0, 0}, smooth = Smooth.None));
21+
connect(P1.outTransition[1], T1.inPlaces[1]) annotation(Line(points={{-9.2,-0.5},
22+
{0,-0.5},{0,20},{5.2,20}}, color = {0, 0, 0}, smooth = Smooth.None));
23+
connect(T1.outPlaces[1], P2.inTransition[1]) annotation(Line(points={{14.8,20},
24+
{29.2,20}}, color = {0, 0, 0}, smooth = Smooth.None));
25+
connect(T2.inPlaces[1], P1.outTransition[2]) annotation(Line(points={{5.2,-20},
26+
{-0.4,-20},{-0.4,0.5},{-9.2,0.5}}, color = {0, 0, 0}, smooth = Smooth.None));
27+
connect(T2.outPlaces[1], P3.inTransition[1]) annotation(Line(points={{14.8,-20},
28+
{29.2,-20}}, color = {0, 0, 0}, smooth = Smooth.None));
29+
annotation(Diagram(coordinateSystem(preserveAspectRatio = false, extent={{-60,-40},
30+
{60,40}}), graphics), experiment(StartTime=0.0, StopTime=10.0));
1931
end ConflictPrio;

PNlib/Examples/DisTest/ConflictProb.mo

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,30 @@ within PNlib.Examples.DisTest;
22
model ConflictProb
33
extends Modelica.Icons.Example;
44

5-
PNlib.PD P1(nIn = 1, startTokens = 2, nOut = 2, enablingType = 2, enablingProbOut = {0.5, 0.5}) annotation(Placement(transformation(extent = {{-50, 0}, {-30, 20}})));
6-
PNlib.TD T1(nIn = 1, nOut = 1) annotation(Placement(transformation(extent = {{4, 50}, {24, 70}})));
7-
PNlib.TD T2(nIn = 1, nOut = 1) annotation(Placement(transformation(extent = {{4, -30}, {24, -10}})));
8-
PNlib.PD P2(nIn = 1) annotation(Placement(transformation(extent = {{50, 50}, {70, 70}})));
9-
PNlib.PD P3(nIn = 1) annotation(Placement(transformation(extent = {{50, -30}, {70, -10}})));
10-
PNlib.TD T3(nOut = 1) annotation(Placement(transformation(extent = {{-92, 0}, {-72, 20}})));
11-
inner PNlib.Settings settings1 annotation(Placement(transformation(extent = {{-70, 52}, {-50, 72}})));
5+
PNlib.PD P1(nIn = 1, startTokens = 2, nOut = 2, enablingType = 2, enablingProbOut = {0.5, 0.5}) annotation(Placement(transformation(extent={{-30,-10},
6+
{-10,10}})));
7+
PNlib.TD T1(nIn = 1, nOut = 1) annotation(Placement(transformation(extent={{0,10},{
8+
20,30}})));
9+
PNlib.TD T2(nIn = 1, nOut = 1) annotation(Placement(transformation(extent={{0,-30},
10+
{20,-10}})));
11+
PNlib.PD P2(nIn = 1) annotation(Placement(transformation(extent={{30,10},{50,30}})));
12+
PNlib.PD P3(nIn = 1) annotation(Placement(transformation(extent={{30,-30},{50,
13+
-10}})));
14+
PNlib.TD T3(nOut = 1) annotation(Placement(transformation(extent={{-60,-10},{-40,
15+
10}})));
16+
inner PNlib.Settings settings1 annotation(Placement(transformation(extent={{-60,20},
17+
{-40,40}})));
1218
equation
13-
connect(T3.outPlaces[1], P1.inTransition[1]) annotation(Line(points = {{-77.2, 10}, {-50.8, 10}}, color = {0, 0, 0}, smooth = Smooth.None));
14-
connect(P1.outTransition[1], T1.inPlaces[1]) annotation(Line(points = {{-29.2, 9.5}, {-10, 9.5}, {-10, 60}, {9.2, 60}}, color = {0, 0, 0}, smooth = Smooth.None));
15-
connect(T1.outPlaces[1], P2.inTransition[1]) annotation(Line(points = {{18.8, 60}, {49.2, 60}}, color = {0, 0, 0}, smooth = Smooth.None));
16-
connect(T2.inPlaces[1], P1.outTransition[2]) annotation(Line(points = {{9.2, -20}, {-10.4, -20}, {-10.4, 10.5}, {-29.2, 10.5}}, color = {0, 0, 0}, smooth = Smooth.None));
17-
connect(T2.outPlaces[1], P3.inTransition[1]) annotation(Line(points = {{18.8, -20}, {49.2, -20}}, color = {0, 0, 0}, smooth = Smooth.None));
18-
annotation(experiment(StartTime=0.0, StopTime=10.0));
19+
connect(T3.outPlaces[1], P1.inTransition[1]) annotation(Line(points={{-45.2,0},
20+
{-30.8,0}}, color = {0, 0, 0}, smooth = Smooth.None));
21+
connect(P1.outTransition[1], T1.inPlaces[1]) annotation(Line(points={{-9.2,-0.5},
22+
{0,-0.5},{0,20},{5.2,20}}, color = {0, 0, 0}, smooth = Smooth.None));
23+
connect(T1.outPlaces[1], P2.inTransition[1]) annotation(Line(points={{14.8,20},
24+
{29.2,20}}, color = {0, 0, 0}, smooth = Smooth.None));
25+
connect(T2.inPlaces[1], P1.outTransition[2]) annotation(Line(points={{5.2,-20},
26+
{-0.4,-20},{-0.4,0.5},{-9.2,0.5}}, color = {0, 0, 0}, smooth = Smooth.None));
27+
connect(T2.outPlaces[1], P3.inTransition[1]) annotation(Line(points={{14.8,-20},
28+
{29.2,-20}}, color = {0, 0, 0}, smooth = Smooth.None));
29+
annotation(experiment(StartTime=0.0, StopTime=10.0),
30+
Diagram(coordinateSystem(extent={{-60,-40},{60,40}})));
1931
end ConflictProb;

PNlib/Examples/DisTest/DisLoopAndArcweight.mo

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@ within PNlib.Examples.DisTest;
22
model DisLoopAndArcweight
33
extends Modelica.Icons.Example;
44

5-
PNlib.PD P1(nOut = 1, nIn = 1, startTokens = 2) annotation(Placement(transformation(extent = {{-10, -26}, {10, -6}})));
6-
PNlib.TD T1(nIn = 1, nOut = 1, arcWeightIn = {2}, arcWeightOut = {3}) annotation(Placement(transformation(extent = {{10, 26}, {-10, 46}})));
7-
inner PNlib.Settings settings1 annotation(Placement(transformation(extent = {{42, 68}, {62, 88}})));
5+
PNlib.PD P1(nOut = 1, nIn = 1, startTokens = 2) annotation(Placement(transformation(extent={{-10,-30},
6+
{10,-10}})));
7+
PNlib.TD T1(nIn = 1, nOut = 1, arcWeightIn = {2}, arcWeightOut = {3}) annotation(Placement(transformation(extent={{8,10},{
8+
-12,30}})));
9+
inner PNlib.Settings settings1 annotation(Placement(transformation(extent={{20,40},
10+
{40,60}})));
811
equation
9-
connect(P1.outTransition[1], T1.inPlaces[1]) annotation(Line(points = {{10.8, -16}, {46, -16}, {46, 36}, {4.8, 36}}, color = {0, 0, 0}, smooth = Smooth.None));
10-
connect(T1.outPlaces[1], P1.inTransition[1]) annotation(Line(points = {{-4.8, 36}, {-42, 36}, {-42, -16}, {-10.8, -16}}, color = {0, 0, 0}, smooth = Smooth.None));
11-
annotation(Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}), graphics), experiment(StartTime=0.0, StopTime=10.0));
12+
connect(P1.outTransition[1], T1.inPlaces[1]) annotation(Line(points={{10.8,-20},
13+
{20,-20},{20,20},{2.8,20}}, color = {0, 0, 0}, smooth = Smooth.None));
14+
connect(T1.outPlaces[1], P1.inTransition[1]) annotation(Line(points={{-6.8,20},
15+
{-20,20},{-20,-20},{-10.8,-20}}, color = {0, 0, 0}, smooth = Smooth.None));
16+
annotation(Diagram(coordinateSystem(preserveAspectRatio = false, extent={{-40,-40},
17+
{40,60}}), graphics), experiment(StartTime=0.0, StopTime=10.0));
1218
end DisLoopAndArcweight;

PNlib/Examples/DisTest/EightConflictProb.mo

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,38 @@ within PNlib.Examples.DisTest;
22
model EightConflictProb
33
extends Modelica.Icons.Example;
44

5-
PNlib.PD P1(startTokens = 1, enablingType = 2, nOut = 8) annotation(Placement(transformation(extent = {{-90, -4}, {-70, 16}})));
6-
PNlib.TD T1(nIn = 1) annotation(Placement(transformation(extent = {{2, 76}, {22, 96}})));
7-
PNlib.TD T2(nIn = 1) annotation(Placement(transformation(extent = {{30, 60}, {50, 80}})));
8-
PNlib.TD T3(nIn = 1) annotation(Placement(transformation(extent = {{52, 36}, {72, 56}})));
9-
PNlib.TD T4(nIn = 1) annotation(Placement(transformation(extent = {{72, 8}, {92, 28}})));
10-
PNlib.TD T5(nIn = 1) annotation(Placement(transformation(extent = {{72, -24}, {92, -4}})));
11-
PNlib.TD T6(nIn = 1) annotation(Placement(transformation(extent = {{52, -50}, {72, -30}})));
12-
PNlib.TD T7(nIn = 1) annotation(Placement(transformation(extent = {{30, -76}, {50, -56}})));
13-
PNlib.TD T8(nIn = 1) annotation(Placement(transformation(extent = {{8, -94}, {28, -74}})));
5+
PNlib.PD P1(startTokens = 1, enablingType = 2, nOut = 8) annotation(Placement(transformation(extent={{-50,-10},
6+
{-30,10}})));
7+
PNlib.TD T1(nIn = 1) annotation(Placement(transformation(extent={{-20,30},{0,50}})));
8+
PNlib.TD T2(nIn = 1) annotation(Placement(transformation(extent={{0,10},{20,30}})));
9+
PNlib.TD T3(nIn = 1) annotation(Placement(transformation(extent={{20,20},{40,40}})));
10+
PNlib.TD T4(nIn = 1) annotation(Placement(transformation(extent={{40,10},{60,30}})));
11+
PNlib.TD T5(nIn = 1) annotation(Placement(transformation(extent={{40,-30},{60,
12+
-10}})));
13+
PNlib.TD T6(nIn = 1) annotation(Placement(transformation(extent={{-20,-50},{0,
14+
-30}})));
15+
PNlib.TD T7(nIn = 1) annotation(Placement(transformation(extent={{20,-40},{40,
16+
-20}})));
17+
PNlib.TD T8(nIn = 1) annotation(Placement(transformation(extent={{0,-30},{20,-10}})));
1418
inner PNlib.Settings settings1
15-
annotation (Placement(transformation(extent={{-60,46},{-40,66}})));
19+
annotation (Placement(transformation(extent={{-60,40},{-40,60}})));
1620
equation
17-
connect(P1.outTransition[1], T1.inPlaces[1]) annotation(Line(points = {{-69.2, 5.125}, {-4, 5.125}, {-4, 86}, {7.2, 86}}, color = {0, 0, 0}, smooth = Smooth.None));
18-
connect(T2.inPlaces[1], P1.outTransition[2]) annotation(Line(points = {{35.2, 70}, {-2, 70}, {-2, 5.375}, {-69.2, 5.375}}, color = {0, 0, 0}, smooth = Smooth.None));
19-
connect(T3.inPlaces[1], P1.outTransition[3]) annotation(Line(points = {{57.2, 46}, {2, 46}, {2, 5.625}, {-69.2, 5.625}}, color = {0, 0, 0}, smooth = Smooth.None));
20-
connect(T4.inPlaces[1], P1.outTransition[4]) annotation(Line(points = {{77.2, 18}, {0, 18}, {0, 5.875}, {-69.2, 5.875}}, color = {0, 0, 0}, smooth = Smooth.None));
21-
connect(T5.inPlaces[1], P1.outTransition[5]) annotation(Line(points = {{77.2, -14}, {-2, -14}, {-2, 6.125}, {-69.2, 6.125}}, color = {0, 0, 0}, smooth = Smooth.None));
22-
connect(T6.inPlaces[1], P1.outTransition[6]) annotation(Line(points = {{57.2, -40}, {-22, -40}, {-22, 6.375}, {-69.2, 6.375}}, color = {0, 0, 0}, smooth = Smooth.None));
23-
connect(T7.inPlaces[1], P1.outTransition[7]) annotation(Line(points = {{35.2, -66}, {26, -66}, {26, 6.625}, {-69.2, 6.625}}, color = {0, 0, 0}, smooth = Smooth.None));
24-
connect(T8.inPlaces[1], P1.outTransition[8]) annotation(Line(points = {{13.2, -84}, {9.6, -84}, {9.6, 6.875}, {-69.2, 6.875}}, color = {0, 0, 0}, smooth = Smooth.None));
25-
annotation(Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}), graphics));
21+
connect(P1.outTransition[1], T1.inPlaces[1]) annotation(Line(points={{-29.2,-0.875},
22+
{-20,-0.875},{-20,40},{-14.8,40}}, color = {0, 0, 0}, smooth = Smooth.None));
23+
connect(T2.inPlaces[1], P1.outTransition[2]) annotation(Line(points={{5.2,20},
24+
{0,20},{0,-0.625},{-29.2,-0.625}}, color = {0, 0, 0}, smooth = Smooth.None));
25+
connect(T3.inPlaces[1], P1.outTransition[3]) annotation(Line(points={{25.2,30},
26+
{20,30},{20,-0.375},{-29.2,-0.375}}, color = {0, 0, 0}, smooth = Smooth.None));
27+
connect(T4.inPlaces[1], P1.outTransition[4]) annotation(Line(points={{45.2,20},
28+
{40,20},{40,-0.125},{-29.2,-0.125}}, color = {0, 0, 0}, smooth = Smooth.None));
29+
connect(T5.inPlaces[1], P1.outTransition[5]) annotation(Line(points={{45.2,-20},
30+
{40,-20},{40,0.125},{-29.2,0.125}}, color = {0, 0, 0}, smooth = Smooth.None));
31+
connect(T6.inPlaces[1], P1.outTransition[6]) annotation(Line(points={{-14.8,-40},
32+
{-20,-40},{-20,0.375},{-29.2,0.375}}, color = {0, 0, 0}, smooth = Smooth.None));
33+
connect(T7.inPlaces[1], P1.outTransition[7]) annotation(Line(points={{25.2,-30},
34+
{20,-30},{20,0.625},{-29.2,0.625}}, color = {0, 0, 0}, smooth = Smooth.None));
35+
connect(T8.inPlaces[1], P1.outTransition[8]) annotation(Line(points={{5.2,-20},
36+
{-0.4,-20},{-0.4,0.875},{-29.2,0.875}}, color = {0, 0, 0}, smooth = Smooth.None));
37+
annotation(Diagram(coordinateSystem(preserveAspectRatio = false, extent={{-60,-60},
38+
{60,60}}), graphics));
2639
end EightConflictProb;

PNlib/Examples/DisTest/InputConflictPrio.mo

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,31 @@ within PNlib.Examples.DisTest;
22
model InputConflictPrio
33
extends Modelica.Icons.Example;
44

5-
PNlib.PD P1(maxTokens = 2, nIn = 2, nOut = 1) annotation(Placement(transformation(extent = {{24, -6}, {44, 14}})));
6-
PNlib.TD T1(nIn = 1) annotation(Placement(transformation(extent = {{68, -6}, {88, 14}})));
7-
PNlib.TD T2(nIn = 1, nOut = 1) annotation(Placement(transformation(extent = {{-26, 36}, {-6, 56}})));
8-
PNlib.TD T3(nIn = 1, nOut = 1) annotation(Placement(transformation(extent = {{-26, -36}, {-6, -16}})));
9-
PNlib.PD P2(startTokens = 5, nOut = 1) annotation(Placement(transformation(extent = {{-70, 36}, {-50, 56}})));
10-
PNlib.PD P3(startTokens = 5, enablingType = 1, nOut = 1) annotation(Placement(transformation(extent = {{-70, -36}, {-50, -16}})));
11-
inner PNlib.Settings settings1 annotation(Placement(transformation(extent = {{46, 40}, {66, 60}})));
5+
PNlib.PD P1(maxTokens = 2, nIn = 2, nOut = 1) annotation(Placement(transformation(extent={{10,-10},
6+
{30,10}})));
7+
PNlib.TD T1(nIn = 1) annotation(Placement(transformation(extent={{40,-10},{60,
8+
10}})));
9+
PNlib.TD T2(nIn = 1, nOut = 1) annotation(Placement(transformation(extent={{-20,10},
10+
{0,30}})));
11+
PNlib.TD T3(nIn = 1, nOut = 1) annotation(Placement(transformation(extent={{-20,-30},
12+
{0,-10}})));
13+
PNlib.PD P2(startTokens = 5, nOut = 1) annotation(Placement(transformation(extent={{-50,10},
14+
{-30,30}})));
15+
PNlib.PD P3(startTokens = 5, enablingType = 1, nOut = 1) annotation(Placement(transformation(extent={{-50,-30},
16+
{-30,-10}})));
17+
inner PNlib.Settings settings1 annotation(Placement(transformation(extent={{40,20},
18+
{60,40}})));
1219
equation
13-
connect(P2.outTransition[1], T2.inPlaces[1]) annotation(Line(points = {{-49.2, 46}, {-20.8, 46}}, color = {0, 0, 0}, smooth = Smooth.None));
14-
connect(P3.outTransition[1], T3.inPlaces[1]) annotation(Line(points = {{-49.2, -26}, {-20.8, -26}}, color = {0, 0, 0}, smooth = Smooth.None));
15-
connect(T2.outPlaces[1], P1.inTransition[1]) annotation(Line(points = {{-11.2, 46}, {8, 46}, {8, 3.5}, {23.2, 3.5}}, color = {0, 0, 0}, smooth = Smooth.None));
16-
connect(T3.outPlaces[1], P1.inTransition[2]) annotation(Line(points = {{-11.2, -26}, {10, -26}, {10, 4.5}, {23.2, 4.5}}, color = {0, 0, 0}, smooth = Smooth.None));
17-
connect(T1.inPlaces[1], P1.outTransition[1]) annotation(Line(points = {{73.2, 4}, {44.8, 4}}, color = {0, 0, 0}, smooth = Smooth.None));
18-
annotation(Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}), graphics), experiment(StartTime=0.0, StopTime=10.0));
20+
connect(P2.outTransition[1], T2.inPlaces[1]) annotation(Line(points={{-29.2,20},
21+
{-14.8,20}}, color = {0, 0, 0}, smooth = Smooth.None));
22+
connect(P3.outTransition[1], T3.inPlaces[1]) annotation(Line(points={{-29.2,-20},
23+
{-14.8,-20}}, color = {0, 0, 0}, smooth = Smooth.None));
24+
connect(T2.outPlaces[1], P1.inTransition[1]) annotation(Line(points={{-5.2,20},
25+
{0,20},{0,-0.5},{9.2,-0.5}}, color = {0, 0, 0}, smooth = Smooth.None));
26+
connect(T3.outPlaces[1], P1.inTransition[2]) annotation(Line(points={{-5.2,-20},
27+
{0,-20},{0,0.5},{9.2,0.5}}, color = {0, 0, 0}, smooth = Smooth.None));
28+
connect(T1.inPlaces[1], P1.outTransition[1]) annotation(Line(points={{45.2,0},
29+
{30.8,0}}, color = {0, 0, 0}, smooth = Smooth.None));
30+
annotation(Diagram(coordinateSystem(preserveAspectRatio = false, extent={{-60,-40},
31+
{60,40}}), graphics), experiment(StartTime=0.0, StopTime=10.0));
1932
end InputConflictPrio;

0 commit comments

Comments
 (0)