|
93 | 93 | "\n", |
94 | 94 | "```mermaid\n", |
95 | 95 | "graph LR;\n", |
96 | | - " %% Definiamo i nodi con i loro dettagli\n", |
97 | 96 | " rqs1[\"<b>RqsGenerator</b><br/>id: rqs-1\"]\n", |
98 | 97 | " client1[\"<b>Client</b><br/>id: client-1\"]\n", |
99 | 98 | " app1[\"<b>Server</b><br/>id: app-1<br/>Endpoint: /api\"]\n", |
100 | 99 | "\n", |
101 | | - " %% Definiamo le connessioni (edge) con latenza\n", |
102 | 100 | " rqs1 -- \"Edge: gen-client<br/>Latency: 0.0001\" --> client1;\n", |
103 | 101 | " client1 -- \"Request<br/>Edge: client-app<br/>Latency: 0.0001\" --> app1;\n", |
104 | 102 | " app1 -- \"Response<br/>Edge: app-client<br/>Latency: 0.0001\" --> client1;" |
105 | 103 | ] |
106 | 104 | }, |
107 | 105 | { |
108 | 106 | "cell_type": "code", |
109 | | - "execution_count": 3, |
| 107 | + "execution_count": null, |
110 | 108 | "metadata": { |
111 | 109 | "tags": [ |
112 | 110 | "build" |
|
148 | 146 | " e_app_client = Edge(id=\"app-client\", source=\"app-1\", target=\"client-1\", latency=0.0001, dropout_rate=0.0)\n", |
149 | 147 | "\n", |
150 | 148 | " settings = SimulationSettings(\n", |
151 | | - " total_simulation_time=900,\n", |
| 149 | + " total_simulation_time=2400,\n", |
152 | 150 | " sample_period_s=0.05,\n", |
153 | 151 | " )\n", |
154 | 152 | "\n", |
|
160 | 158 | " .add_edges(e_gen_client, e_client_app, e_app_client)\n", |
161 | 159 | " .add_simulation_settings(settings)\n", |
162 | 160 | " ).build_payload()\n", |
163 | | - " return payload\n", |
164 | | - "\n", |
165 | | - "payload = build_payload()\n" |
| 161 | + " return payload\n" |
166 | 162 | ] |
167 | 163 | }, |
168 | 164 | { |
|
174 | 170 | }, |
175 | 171 | { |
176 | 172 | "cell_type": "code", |
177 | | - "execution_count": 21, |
| 173 | + "execution_count": null, |
178 | 174 | "metadata": { |
179 | 175 | "tags": [ |
180 | 176 | "run" |
|
190 | 186 | } |
191 | 187 | ], |
192 | 188 | "source": [ |
| 189 | + "payload = build_payload()\n", |
193 | 190 | "env = simpy.Environment()\n", |
194 | 191 | "runner = SimulationRunner(env=env, simulation_input=payload)\n", |
195 | 192 | "results: ResultsAnalyzer = runner.run()\n", |
|
306 | 303 | }, |
307 | 304 | { |
308 | 305 | "cell_type": "code", |
309 | | - "execution_count": 22, |
| 306 | + "execution_count": 28, |
310 | 307 | "metadata": { |
311 | 308 | "tags": [ |
312 | 309 | "mm1" |
|
322 | 319 | "--------------------------------------------------------------------\n", |
323 | 320 | "sym metric theory observed abs rel%\n", |
324 | 321 | "--------------------------------------------------------------------\n", |
325 | | - "λ Arrival rate (1/s) 33.333333 33.204444 -0.128889 -0.39\n", |
326 | | - "μ Service rate (1/s) 66.666667 66.638004 -0.028663 -0.04\n", |
327 | | - "rho Utilization 0.500000 0.498281 -0.001719 -0.34\n", |
328 | | - "L Mean items in system 1.000000 1.034536 0.034536 3.45\n", |
329 | | - "Lq Mean items in queue 0.500000 0.526294 0.026294 5.26\n", |
330 | | - "W Mean time in system (s) 0.030000 0.031157 0.001157 3.86\n", |
331 | | - "Wq Mean waiting time (s) 0.015000 0.015850 0.000850 5.67\n", |
| 322 | + "λ Arrival rate (1/s) 33.333333 33.150833 -0.182500 -0.55\n", |
| 323 | + "μ Service rate (1/s) 66.666667 66.556885 -0.109782 -0.16\n", |
| 324 | + "rho Utilization 0.500000 0.498083 -0.001917 -0.38\n", |
| 325 | + "L Mean items in system 1.000000 1.012994 0.012994 1.30\n", |
| 326 | + "Lq Mean items in queue 0.500000 0.504967 0.004967 0.99\n", |
| 327 | + "W Mean time in system (s) 0.030000 0.030557 0.000557 1.86\n", |
| 328 | + "Wq Mean waiting time (s) 0.015000 0.015232 0.000232 1.55\n", |
332 | 329 | "====================================================================\n" |
333 | 330 | ] |
334 | 331 | } |
|
0 commit comments