Skip to content
Snippets Groups Projects
Commit 4f65acb9 authored by Zizhe Wang's avatar Zizhe Wang
Browse files

Upload New File

parent c32fe59f
Branches
No related tags found
No related merge requests found
model CarSharing
PNlib.Components.PD PSCii(nIn = 1, nOut = 1) annotation(
Placement(transformation(origin = {-306, 90}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
PNlib.Components.TES TCRi(nIn = 1, nOut = 1) annotation(
Placement(transformation(origin = {-278, 54}, extent = {{-10, -10}, {10, 10}})));
PNlib.Components.PD PSRi(nIn = 1, nOut = 1) annotation(
Placement(transformation(origin = {-242, 82}, extent = {{-10, -10}, {10, 10}})));
PNlib.Components.PD PSCi(nIn = 1, nOut = 1, startTokens = 6) annotation(
Placement(transformation(origin = {-240, 116}, extent = {{10, -10}, {-10, 10}})));
PNlib.Components.T TUSi(nIn = 2, nOut = 2) annotation(
Placement(transformation(origin = {-202, 82}, extent = {{-14, -14}, {14, 14}})));
PNlib.Components.PD PCU(nIn = 3, nOut = 4, startTokens = 5) annotation(
Placement(transformation(origin = {26, 36}, extent = {{20, -20}, {-20, 20}}, rotation = -90)));
PNlib.Components.PD PSDi(nIn = 1, nOut = 2, startTokens = 1) annotation(
Placement(transformation(origin = {-270, 10}, extent = {{-10, -10}, {10, 10}})));
PNlib.Components.TD TUNi(nIn = 1) annotation(
Placement(transformation(origin = {-180, 10}, extent = {{-10, -10}, {10, 10}})));
PNlib.Components.TES TUDi(nOut = 1) annotation(
Placement(transformation(origin = {-314, 10}, extent = {{-10, -10}, {10, 10}})));
PNlib.Components.TES TCCi(nIn = 2, nOut = 1) annotation(
Placement(transformation(origin = {-272, 144}, extent = {{10, -10}, {-10, 10}})));
PNlib.Components.PD PSCii1(nIn = 1, nOut = 1) annotation(
Placement(transformation(origin = {-132, -56}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
PNlib.Components.TES TCRi1(nIn = 1, nOut = 1) annotation(
Placement(transformation(origin = {-104, -92}, extent = {{-10, -10}, {10, 10}})));
PNlib.Components.PD PSRi1(nIn = 1, nOut = 1) annotation(
Placement(transformation(origin = {-68, -64}, extent = {{-10, -10}, {10, 10}})));
PNlib.Components.PD PSCi1(nIn = 1, nOut = 1, startTokens = 6) annotation(
Placement(transformation(origin = {-66, -30}, extent = {{10, -10}, {-10, 10}})));
PNlib.Components.T TUSi1(nIn = 2, nOut = 2) annotation(
Placement(transformation(origin = {-28, -64}, extent = {{-14, -14}, {14, 14}})));
PNlib.Components.PD PSDi1(nIn = 1, nOut = 2, startTokens = 1) annotation(
Placement(transformation(origin = {-96, -136}, extent = {{-10, -10}, {10, 10}})));
PNlib.Components.TD TUNi1(nIn = 1) annotation(
Placement(transformation(origin = {-6, -136}, extent = {{-10, -10}, {10, 10}})));
PNlib.Components.TES TUDi1(nOut = 1) annotation(
Placement(transformation(origin = {-140, -136}, extent = {{-10, -10}, {10, 10}})));
PNlib.Components.TES TCCi1(nIn = 2, nOut = 1) annotation(
Placement(transformation(origin = {-104, -2}, extent = {{10, -10}, {-10, 10}})));
PNlib.Components.TES TCM(nIn = 1, nOut = 1) annotation(
Placement(transformation(origin = {216, 142}, extent = {{-10, -10}, {10, 10}})));
PNlib.Components.PD PCM(nIn = 1, nOut = 1, startTokens = 2) annotation(
Placement(transformation(origin = {382, 178}, extent = {{-10, -10}, {10, 10}})));
PNlib.Components.TES TMPR(nIn = 1, nOut = 1) annotation(
Placement(transformation(origin = {384, 74}, extent = {{-10, -10}, {10, 10}})));
PNlib.Components.PD PCU_1(nIn = 2, nOut = 1, startTokens = 3) annotation(
Placement(transformation(origin = {392, -8}, extent = {{10, -10}, {-10, 10}})));
PNlib.Components.TES TCPR(nIn = 1, nOut = 1) annotation(
Placement(transformation(origin = {342, -94}, extent = {{-10, -10}, {10, 10}})));
PNlib.Components.PD PCU_2(nIn = 1, nOut = 1, startTokens = 1) annotation(
Placement(transformation(origin = {252, -130}, extent = {{-10, -10}, {10, 10}})));
PNlib.Components.TES TCPc(nIn = 1, nOut = 1) annotation(
Placement(transformation(origin = {166, -92}, extent = {{-10, -10}, {10, 10}})));
PNlib.Components.T TUSp(nIn = 2, nOut = 1) annotation(
Placement(transformation(origin = {117, -7}, extent = {{21, -21}, {-21, 21}})));
PNlib.Components.TES TUDp(nIn = 0, nOut = 1) annotation(
Placement(transformation(origin = {336, 72}, extent = {{10, -10}, {-10, 10}})));
PNlib.Components.PD P1(nIn = 1, nOut = 2) annotation(
Placement(transformation(origin = {278, 74}, extent = {{10, -10}, {-10, 10}})));
PNlib.Components.TDS TUNp(nIn = 1) annotation(
Placement(transformation(origin = {144, 82}, extent = {{10, -10}, {-10, 10}})));
inner PNlib.Components.Settings settings(showTokenFlow = true) annotation(
Placement(transformation(origin = {-356, 208}, extent = {{-10, -10}, {10, 10}})));
equation
connect(TUDi.outPlaces, PSDi.inTransition) annotation(
Line(points = {{-309.2, 10}, {-279.2, 10}}, thickness = 0.5));
connect(TUSi.outPlaces[1], PCU.inTransition[1]) annotation(
Line(points = {{-195.28, 82}, {-77.92, 82}, {-77.92, 14}, {26, 14}}, thickness = 0.5));
connect(TUSi.outPlaces[2], PSCi.inTransition[1]) annotation(
Line(points = {{-195.28, 82}, {-185.28, 82}, {-185.28, 115}, {-229.28, 115}, {-229.28, 116}}, thickness = 0.5));
connect(PSRi.outTransition[1], TUSi.inPlaces[1]) annotation(
Line(points = {{-231.2, 82}, {-207.2, 82}}, thickness = 0.5));
connect(PSDi.outTransition[1], TUSi.inPlaces[2]) annotation(
Line(points = {{-259.2, 10}, {-213.2, 10}, {-213.2, 82}, {-207.2, 82}}, thickness = 0.5));
connect(PSDi.outTransition[2], TUNi.inPlaces[1]) annotation(
Line(points = {{-259.2, 10}, {-183.2, 10}}, thickness = 0.5));
connect(PSCi.outTransition[1], TCCi.inPlaces[1]) annotation(
Line(points = {{-250.8, 116}, {-267, 116}, {-267, 144}}, thickness = 0.5));
connect(PCU.outTransition[1], TCCi.inPlaces[2]) annotation(
Line(points = {{26, 58}, {26, 143.2}, {-132, 143.2}, {-132, 144.2}, {-267, 144.2}, {-267, 143.6}}, thickness = 0.5));
connect(TCCi.outPlaces[1], PSCii.inTransition[1]) annotation(
Line(points = {{-276.8, 144}, {-306.6, 144}, {-306.6, 100}}, thickness = 0.5));
connect(PSCii.outTransition[1], TCRi.inPlaces[1]) annotation(
Line(points = {{-306, 79.2}, {-282, 79.2}, {-282, 53.2}}, thickness = 0.5));
connect(TCRi.outPlaces[1], PSRi.inTransition[1]) annotation(
Line(points = {{-273.2, 54}, {-251.2, 54}, {-251.2, 82}}, thickness = 0.5));
connect(TUDi1.outPlaces, PSDi1.inTransition) annotation(
Line(points = {{-135.2, -136}, {-107.2, -136}}, thickness = 0.5));
connect(PSRi1.outTransition[1], TUSi1.inPlaces[1]) annotation(
Line(points = {{-57.2, -64}, {-35.2, -64}}, thickness = 0.5));
connect(PSDi1.outTransition[1], TUSi1.inPlaces[2]) annotation(
Line(points = {{-85.2, -136}, {-45.4, -136}, {-45.4, -64}, {-35.2, -64}}, thickness = 0.5));
connect(PSDi1.outTransition[2], TUNi1.inPlaces[1]) annotation(
Line(points = {{-85.2, -136}, {-11.2, -136}}, thickness = 0.5));
connect(PSCi1.outTransition[1], TCCi1.inPlaces[1]) annotation(
Line(points = {{-76.8, -30}, {-98.8, -30}, {-98.8, -2}}, thickness = 0.5));
connect(TCCi1.outPlaces[1], PSCii1.inTransition[1]) annotation(
Line(points = {{-108.8, -2}, {-131.8, -2}, {-131.8, -45}}, thickness = 0.5));
connect(PSCii1.outTransition[1], TCRi1.inPlaces[1]) annotation(
Line(points = {{-132, -66.8}, {-109, -66.8}, {-109, -91.8}}, thickness = 0.5));
connect(TCRi1.outPlaces[1], PSRi1.inTransition[1]) annotation(
Line(points = {{-99.2, -92}, {-79.2, -92}, {-79.2, -64}}, thickness = 0.5));
connect(PCU.outTransition[2], TCCi1.inPlaces[2]) annotation(
Line(points = {{26, 58}, {-4, 58}, {-4, 117.2}, {-99, 117.2}, {-99, -2.4}}, thickness = 0.5));
connect(TCM.outPlaces[1], PCM.inTransition[1]) annotation(
Line(points = {{221, 142}, {261, 142}, {261, 178}, {371, 178}}, thickness = 0.5));
connect(PCM.outTransition[1], TMPR.inPlaces[1]) annotation(
Line(points = {{393, 178}, {407, 178}, {407, 80.5}, {379, 80.5}, {379, 74}}, thickness = 0.5));
connect(TMPR.outPlaces[1], PCU_1.inTransition[1]) annotation(
Line(points = {{389, 74}, {450, 74}, {450, -8}, {403, -8}}, thickness = 0.5));
connect(TCPR.outPlaces[1], PCU_1.inTransition[2]) annotation(
Line(points = {{347, -94}, {347, -51}, {403, -51}, {403, -8}}, thickness = 0.5));
connect(PCU_2.outTransition[1], TCPR.inPlaces[1]) annotation(
Line(points = {{263, -130}, {337, -130}, {337, -94}}, thickness = 0.5));
connect(TCPc.outPlaces[1], PCU_2.inTransition[1]) annotation(
Line(points = {{171, -92}, {241, -92}, {241, -130}}, thickness = 0.5));
connect(PCU_1.outTransition[1], TUSp.inPlaces[1]) annotation(
Line(points = {{381, -8}, {127, -8}, {127, -7}}, thickness = 0.5));
connect(TUDp.outPlaces[1], P1.inTransition[1]) annotation(
Line(points = {{331, 72}, {326, 72}, {326, 74}, {289, 74}}, thickness = 0.5));
connect(P1.outTransition[1], TUNp.inPlaces[1]) annotation(
Line(points = {{267, 74}, {149, 74}, {149, 82}}, thickness = 0.5));
connect(P1.outTransition[2], TUSp.inPlaces[2]) annotation(
Line(points = {{267, 74}, {242, 74}, {242, 22}, {127, 22}, {127, -7}}, thickness = 0.5));
connect(TUSp.outPlaces[1], PCU.inTransition[3]) annotation(
Line(points = {{107, -7}, {90, -7}, {90, 14}, {26, 14}}, thickness = 0.5));
connect(PCU.outTransition[3], TCM.inPlaces[1]) annotation(
Line(points = {{26, 58}, {211, 58}, {211, 142}}, thickness = 0.5));
connect(PCU.outTransition[4], TCPc.inPlaces[1]) annotation(
Line(points = {{26, 58}, {70, 58}, {70, -85.5}, {71, -85.5}, {71, -91.75}, {161, -91.75}, {161, -92}}, thickness = 0.5));
connect(TUSi1.outPlaces[2], PCU.inTransition[2]) annotation(
Line(points = {{-22, -64}, {26, -64}, {26, 14}}, thickness = 0.5));
connect(TUSi1.outPlaces[1], PSCi1.inTransition[1]) annotation(
Line(points = {{-22, -64}, {-39, -64}, {-39, -46}, {-56, -46}, {-56, -30}}, thickness = 0.5));
annotation(
uses(PNlib(version = "3.0.0")),
Diagram(graphics = {Text(origin = {-337, -14}, extent = {{3, 0}, {-3, 0}}, textString = "text"), Text(origin = {-115, -90}, extent = {{3, 0}, {-3, 0}}, textString = "text"), Text(origin = {-304, 192}, extent = {{42, -20}, {-42, 0}}, textString = "Station subnet"), Rectangle(origin = {-245, 103}, lineColor = {0, 0, 255}, lineThickness = 0.5, extent = {{-103, 71}, {103, -71}}), Rectangle(origin = {-257, 5}, lineColor = {0, 255, 0}, lineThickness = 0.5, extent = {{-91, 23}, {91, -23}}), Text(origin = {-304, -20}, extent = {{42, -20}, {-42, 0}}, textString = "User demand subnet"), Rectangle(origin = {224, 30}, lineColor = {0, 170, 255}, lineThickness = 0.5, extent = {{-132, 72}, {132, -72}}), Text(origin = {121, 136}, extent = {{57, -48}, {-57, 0}}, textString = "User Demand (park) subnet"), Polygon(origin = {342, 55}, lineColor = {255, 85, 255}, lineThickness = 0.5, points = {{-154, 111}, {-154, 57}, {32, 57}, {32, -139}, {142, -139}, {142, 137}, {-154, 137}, {-154, 127}, {-154, 111}}), Text(origin = {273, 201}, extent = {{-81, 25}, {81, -25}}, textString = "Car Maintenance (Center) subnet"), Rectangle(origin = {293, -77}, lineColor = {85, 85, 0}, lineThickness = 0.5, extent = {{-145, 87}, {145, -87}}), Text(origin = {227, -176}, extent = {{-73, 20}, {73, -20}}, textString = "Car-Sharing Park (Center) subnet"), Text(extent = {{-16, 40}, {-16, 40}}, textString = "text"), Text(origin = {-20, 48}, extent = {{-26, 16}, {26, -16}}, textString = "Cars in use"), Text(origin = {-339, 67}, extent = {{-37, 35}, {37, -35}}, textString = "Charging of cars"), Text(origin = {-204, 63}, extent = {{-32, 7}, {32, -7}}, textString = "Cars are ready")}, coordinateSystem(extent = {{-380, 240}, {500, -200}})),
version = "");
end CarSharing;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment