diff options
Diffstat (limited to 'Metrics/Metrics-Calculation/metrics_plot/src/metrics_distance_with_selector.ipynb')
-rw-r--r-- | Metrics/Metrics-Calculation/metrics_plot/src/metrics_distance_with_selector.ipynb | 370 |
1 files changed, 321 insertions, 49 deletions
diff --git a/Metrics/Metrics-Calculation/metrics_plot/src/metrics_distance_with_selector.ipynb b/Metrics/Metrics-Calculation/metrics_plot/src/metrics_distance_with_selector.ipynb index e5868da0..8c57a327 100644 --- a/Metrics/Metrics-Calculation/metrics_plot/src/metrics_distance_with_selector.ipynb +++ b/Metrics/Metrics-Calculation/metrics_plot/src/metrics_distance_with_selector.ipynb | |||
@@ -16,7 +16,7 @@ | |||
16 | }, | 16 | }, |
17 | { | 17 | { |
18 | "cell_type": "code", | 18 | "cell_type": "code", |
19 | "execution_count": 2, | 19 | "execution_count": 1, |
20 | "metadata": {}, | 20 | "metadata": {}, |
21 | "outputs": [], | 21 | "outputs": [], |
22 | "source": [ | 22 | "source": [ |
@@ -48,7 +48,7 @@ | |||
48 | }, | 48 | }, |
49 | { | 49 | { |
50 | "cell_type": "code", | 50 | "cell_type": "code", |
51 | "execution_count": 3, | 51 | "execution_count": 2, |
52 | "metadata": {}, | 52 | "metadata": {}, |
53 | "outputs": [], | 53 | "outputs": [], |
54 | "source": [ | 54 | "source": [ |
@@ -78,7 +78,7 @@ | |||
78 | }, | 78 | }, |
79 | { | 79 | { |
80 | "cell_type": "code", | 80 | "cell_type": "code", |
81 | "execution_count": 4, | 81 | "execution_count": 3, |
82 | "metadata": {}, | 82 | "metadata": {}, |
83 | "outputs": [], | 83 | "outputs": [], |
84 | "source": [ | 84 | "source": [ |
@@ -108,7 +108,7 @@ | |||
108 | }, | 108 | }, |
109 | { | 109 | { |
110 | "cell_type": "code", | 110 | "cell_type": "code", |
111 | "execution_count": 5, | 111 | "execution_count": 20, |
112 | "metadata": {}, | 112 | "metadata": {}, |
113 | "outputs": [], | 113 | "outputs": [], |
114 | "source": [ | 114 | "source": [ |
@@ -139,7 +139,7 @@ | |||
139 | }, | 139 | }, |
140 | { | 140 | { |
141 | "cell_type": "code", | 141 | "cell_type": "code", |
142 | "execution_count": 6, | 142 | "execution_count": 5, |
143 | "metadata": {}, | 143 | "metadata": {}, |
144 | "outputs": [], | 144 | "outputs": [], |
145 | "source": [ | 145 | "source": [ |
@@ -149,7 +149,7 @@ | |||
149 | }, | 149 | }, |
150 | { | 150 | { |
151 | "cell_type": "code", | 151 | "cell_type": "code", |
152 | "execution_count": 7, | 152 | "execution_count": 6, |
153 | "metadata": {}, | 153 | "metadata": {}, |
154 | "outputs": [], | 154 | "outputs": [], |
155 | "source": [ | 155 | "source": [ |
@@ -163,7 +163,7 @@ | |||
163 | }, | 163 | }, |
164 | { | 164 | { |
165 | "cell_type": "code", | 165 | "cell_type": "code", |
166 | "execution_count": 8, | 166 | "execution_count": 7, |
167 | "metadata": {}, | 167 | "metadata": {}, |
168 | "outputs": [], | 168 | "outputs": [], |
169 | "source": [ | 169 | "source": [ |
@@ -184,7 +184,7 @@ | |||
184 | }, | 184 | }, |
185 | { | 185 | { |
186 | "cell_type": "code", | 186 | "cell_type": "code", |
187 | "execution_count": 9, | 187 | "execution_count": 8, |
188 | "metadata": {}, | 188 | "metadata": {}, |
189 | "outputs": [], | 189 | "outputs": [], |
190 | "source": [ | 190 | "source": [ |
@@ -200,7 +200,9 @@ | |||
200 | "# Read generated models\n", | 200 | "# Read generated models\n", |
201 | "viatra_no_con_stats = readStats('../statistics/viatra_nocon_output/', 5000)\n", | 201 | "viatra_no_con_stats = readStats('../statistics/viatra_nocon_output/', 5000)\n", |
202 | "viatra_con_stats = readStats('../statistics/viatra_con_output/',5000)\n", | 202 | "viatra_con_stats = readStats('../statistics/viatra_con_output/',5000)\n", |
203 | "random_stats = readStats('../statistics/random_output/',5000)" | 203 | "random_stats = readStats('../statistics/random_output/',5000)\n", |
204 | "real_random_stats = readStats('../statistics/real_random_output/', 10000)\n", | ||
205 | "viatra_500_stats = readStats('../statistics/viatra500nodes/', 10000)" | ||
204 | ] | 206 | ] |
205 | }, | 207 | }, |
206 | { | 208 | { |
@@ -212,18 +214,20 @@ | |||
212 | }, | 214 | }, |
213 | { | 215 | { |
214 | "cell_type": "code", | 216 | "cell_type": "code", |
215 | "execution_count": 10, | 217 | "execution_count": 9, |
216 | "metadata": {}, | 218 | "metadata": {}, |
217 | "outputs": [], | 219 | "outputs": [], |
218 | "source": [ | 220 | "source": [ |
219 | "viatra_no_con_dic = calDistanceDic(viatra_no_con_stats, human_rep)\n", | 221 | "viatra_no_con_dic = calDistanceDic(viatra_no_con_stats, human_rep)\n", |
220 | "viatra_con_dic = calDistanceDic(viatra_con_stats, human_rep)\n", | 222 | "viatra_con_dic = calDistanceDic(viatra_con_stats, human_rep)\n", |
221 | "random_dic = calDistanceDic(random_stats, human_rep)" | 223 | "random_dic = calDistanceDic(random_stats, human_rep)\n", |
224 | "real_random_dic = calDistanceDic(real_random_stats, human_rep)\n", | ||
225 | "viatra_500_dic = calDistanceDic(viatra_500_stats, human_rep)" | ||
222 | ] | 226 | ] |
223 | }, | 227 | }, |
224 | { | 228 | { |
225 | "cell_type": "code", | 229 | "cell_type": "code", |
226 | "execution_count": 11, | 230 | "execution_count": 30, |
227 | "metadata": {}, | 231 | "metadata": {}, |
228 | "outputs": [], | 232 | "outputs": [], |
229 | "source": [ | 233 | "source": [ |
@@ -249,13 +253,13 @@ | |||
249 | }, | 253 | }, |
250 | { | 254 | { |
251 | "cell_type": "code", | 255 | "cell_type": "code", |
252 | "execution_count": 12, | 256 | "execution_count": 31, |
253 | "metadata": {}, | 257 | "metadata": {}, |
254 | "outputs": [ | 258 | "outputs": [ |
255 | { | 259 | { |
256 | "data": { | 260 | "data": { |
257 | "application/vnd.jupyter.widget-view+json": { | 261 | "application/vnd.jupyter.widget-view+json": { |
258 | "model_id": "1bdc31418d894783b36cc79c60251f00", | 262 | "model_id": "cba63d8050a043018a16db6f1a0440f9", |
259 | "version_major": 2, | 263 | "version_major": 2, |
260 | "version_minor": 0 | 264 | "version_minor": 0 |
261 | }, | 265 | }, |
@@ -272,7 +276,7 @@ | |||
272 | "<function __main__.plot_out_degree(lines)>" | 276 | "<function __main__.plot_out_degree(lines)>" |
273 | ] | 277 | ] |
274 | }, | 278 | }, |
275 | "execution_count": 12, | 279 | "execution_count": 31, |
276 | "metadata": {}, | 280 | "metadata": {}, |
277 | "output_type": "execute_result" | 281 | "output_type": "execute_result" |
278 | } | 282 | } |
@@ -285,18 +289,18 @@ | |||
285 | }, | 289 | }, |
286 | { | 290 | { |
287 | "cell_type": "code", | 291 | "cell_type": "code", |
288 | "execution_count": 13, | 292 | "execution_count": 32, |
289 | "metadata": {}, | 293 | "metadata": {}, |
290 | "outputs": [ | 294 | "outputs": [ |
291 | { | 295 | { |
292 | "data": { | 296 | "data": { |
293 | "application/vnd.jupyter.widget-view+json": { | 297 | "application/vnd.jupyter.widget-view+json": { |
294 | "model_id": "78565a0ec3d740908fcea753387cfc3e", | 298 | "model_id": "3c07dab0b6fd4c45b0168d206e99e4ea", |
295 | "version_major": 2, | 299 | "version_major": 2, |
296 | "version_minor": 0 | 300 | "version_minor": 0 |
297 | }, | 301 | }, |
298 | "text/plain": [ | 302 | "text/plain": [ |
299 | "interactive(children=(SelectMultiple(description='Trajectory:', index=(0,), options={'../statistics/viatra_noc…" | 303 | "interactive(children=(SelectMultiple(description='Trajectory:', index=(11,), options={'../statistics/viatra_no…" |
300 | ] | 304 | ] |
301 | }, | 305 | }, |
302 | "metadata": {}, | 306 | "metadata": {}, |
@@ -308,7 +312,7 @@ | |||
308 | "<function __main__.plot_out_na(lines)>" | 312 | "<function __main__.plot_out_na(lines)>" |
309 | ] | 313 | ] |
310 | }, | 314 | }, |
311 | "execution_count": 13, | 315 | "execution_count": 32, |
312 | "metadata": {}, | 316 | "metadata": {}, |
313 | "output_type": "execute_result" | 317 | "output_type": "execute_result" |
314 | } | 318 | } |
@@ -321,18 +325,18 @@ | |||
321 | }, | 325 | }, |
322 | { | 326 | { |
323 | "cell_type": "code", | 327 | "cell_type": "code", |
324 | "execution_count": 14, | 328 | "execution_count": 33, |
325 | "metadata": {}, | 329 | "metadata": {}, |
326 | "outputs": [ | 330 | "outputs": [ |
327 | { | 331 | { |
328 | "data": { | 332 | "data": { |
329 | "application/vnd.jupyter.widget-view+json": { | 333 | "application/vnd.jupyter.widget-view+json": { |
330 | "model_id": "4392eb19fe1844c4affeb62f9ba9163b", | 334 | "model_id": "f3bb86160c964b5383bda7cdee81a1b7", |
331 | "version_major": 2, | 335 | "version_major": 2, |
332 | "version_minor": 0 | 336 | "version_minor": 0 |
333 | }, | 337 | }, |
334 | "text/plain": [ | 338 | "text/plain": [ |
335 | "interactive(children=(SelectMultiple(description='Trajectory:', index=(0,), options={'../statistics/viatra_noc…" | 339 | "interactive(children=(SelectMultiple(description='Trajectory:', index=(11,), options={'../statistics/viatra_no…" |
336 | ] | 340 | ] |
337 | }, | 341 | }, |
338 | "metadata": {}, | 342 | "metadata": {}, |
@@ -344,7 +348,7 @@ | |||
344 | "<function __main__.plot_out_mpc(lines)>" | 348 | "<function __main__.plot_out_mpc(lines)>" |
345 | ] | 349 | ] |
346 | }, | 350 | }, |
347 | "execution_count": 14, | 351 | "execution_count": 33, |
348 | "metadata": {}, | 352 | "metadata": {}, |
349 | "output_type": "execute_result" | 353 | "output_type": "execute_result" |
350 | } | 354 | } |
@@ -357,18 +361,44 @@ | |||
357 | }, | 361 | }, |
358 | { | 362 | { |
359 | "cell_type": "code", | 363 | "cell_type": "code", |
360 | "execution_count": 15, | 364 | "execution_count": 35, |
365 | "metadata": {}, | ||
366 | "outputs": [], | ||
367 | "source": [ | ||
368 | "filenames = reader.readmultiplefiles('../statistics/viatra_con_output/trajectories/', 15, False)\n", | ||
369 | "trajectories = {}\n", | ||
370 | "for name in filenames:\n", | ||
371 | " trajectories[name] = reader.readTrajectory(name)\n", | ||
372 | "\n", | ||
373 | "w = widgets.SelectMultiple(\n", | ||
374 | " options = trajectories,\n", | ||
375 | " value = [trajectories[filenames[0]]],\n", | ||
376 | " description='Trajectory:',\n", | ||
377 | " disabled=False,\n", | ||
378 | ")\n", | ||
379 | "\n", | ||
380 | "#generate random color for each line\n", | ||
381 | "colors = []\n", | ||
382 | "\n", | ||
383 | "for i in range(0, len(trajectories)):\n", | ||
384 | " color = \"#%06x\" % random.randint(0, 0xFFFFFF)\n", | ||
385 | " colors.append(color)" | ||
386 | ] | ||
387 | }, | ||
388 | { | ||
389 | "cell_type": "code", | ||
390 | "execution_count": 36, | ||
361 | "metadata": {}, | 391 | "metadata": {}, |
362 | "outputs": [ | 392 | "outputs": [ |
363 | { | 393 | { |
364 | "data": { | 394 | "data": { |
365 | "application/vnd.jupyter.widget-view+json": { | 395 | "application/vnd.jupyter.widget-view+json": { |
366 | "model_id": "c667f0f9dcd5494f81d95c64ad900612", | 396 | "model_id": "ec10c88d57f14461b160572e0a3f4e0d", |
367 | "version_major": 2, | 397 | "version_major": 2, |
368 | "version_minor": 0 | 398 | "version_minor": 0 |
369 | }, | 399 | }, |
370 | "text/plain": [ | 400 | "text/plain": [ |
371 | "interactive(children=(Dropdown(description='lines', options=([],), value=[]), Output()), _dom_classes=('widget…" | 401 | "interactive(children=(SelectMultiple(description='Trajectory:', index=(0,), options={'../statistics/viatra_con…" |
372 | ] | 402 | ] |
373 | }, | 403 | }, |
374 | "metadata": {}, | 404 | "metadata": {}, |
@@ -380,7 +410,7 @@ | |||
380 | "<function __main__.plot_out_degree(lines)>" | 410 | "<function __main__.plot_out_degree(lines)>" |
381 | ] | 411 | ] |
382 | }, | 412 | }, |
383 | "execution_count": 15, | 413 | "execution_count": 36, |
384 | "metadata": {}, | 414 | "metadata": {}, |
385 | "output_type": "execute_result" | 415 | "output_type": "execute_result" |
386 | } | 416 | } |
@@ -388,23 +418,23 @@ | |||
388 | "source": [ | 418 | "source": [ |
389 | "def plot_out_degree(lines):\n", | 419 | "def plot_out_degree(lines):\n", |
390 | " plot(viatra_con_dic, lines, 0, lambda a: a.out_d_distance, colors, 'out degree')\n", | 420 | " plot(viatra_con_dic, lines, 0, lambda a: a.out_d_distance, colors, 'out degree')\n", |
391 | "interact(plot_out_degree, lines=[[]])" | 421 | "interact(plot_out_degree, lines=w)" |
392 | ] | 422 | ] |
393 | }, | 423 | }, |
394 | { | 424 | { |
395 | "cell_type": "code", | 425 | "cell_type": "code", |
396 | "execution_count": 16, | 426 | "execution_count": 37, |
397 | "metadata": {}, | 427 | "metadata": {}, |
398 | "outputs": [ | 428 | "outputs": [ |
399 | { | 429 | { |
400 | "data": { | 430 | "data": { |
401 | "application/vnd.jupyter.widget-view+json": { | 431 | "application/vnd.jupyter.widget-view+json": { |
402 | "model_id": "991d8d2bfc644c82a9b079615900dc4d", | 432 | "model_id": "bde0cb7466f64699be0159a8404eb821", |
403 | "version_major": 2, | 433 | "version_major": 2, |
404 | "version_minor": 0 | 434 | "version_minor": 0 |
405 | }, | 435 | }, |
406 | "text/plain": [ | 436 | "text/plain": [ |
407 | "interactive(children=(Dropdown(description='lines', options=([],), value=[]), Output()), _dom_classes=('widget…" | 437 | "interactive(children=(SelectMultiple(description='Trajectory:', index=(3,), options={'../statistics/viatra_con…" |
408 | ] | 438 | ] |
409 | }, | 439 | }, |
410 | "metadata": {}, | 440 | "metadata": {}, |
@@ -416,7 +446,7 @@ | |||
416 | "<function __main__.plot_na(lines)>" | 446 | "<function __main__.plot_na(lines)>" |
417 | ] | 447 | ] |
418 | }, | 448 | }, |
419 | "execution_count": 16, | 449 | "execution_count": 37, |
420 | "metadata": {}, | 450 | "metadata": {}, |
421 | "output_type": "execute_result" | 451 | "output_type": "execute_result" |
422 | } | 452 | } |
@@ -424,23 +454,23 @@ | |||
424 | "source": [ | 454 | "source": [ |
425 | "def plot_na(lines):\n", | 455 | "def plot_na(lines):\n", |
426 | " plot(viatra_con_dic, lines, 0, lambda a: a.na_distance, colors, 'node activity')\n", | 456 | " plot(viatra_con_dic, lines, 0, lambda a: a.na_distance, colors, 'node activity')\n", |
427 | "interact(plot_na, lines=[[]])" | 457 | "interact(plot_na, lines=w)" |
428 | ] | 458 | ] |
429 | }, | 459 | }, |
430 | { | 460 | { |
431 | "cell_type": "code", | 461 | "cell_type": "code", |
432 | "execution_count": 17, | 462 | "execution_count": 38, |
433 | "metadata": {}, | 463 | "metadata": {}, |
434 | "outputs": [ | 464 | "outputs": [ |
435 | { | 465 | { |
436 | "data": { | 466 | "data": { |
437 | "application/vnd.jupyter.widget-view+json": { | 467 | "application/vnd.jupyter.widget-view+json": { |
438 | "model_id": "be65f39c2fae4c84a1d6908f3b70a86e", | 468 | "model_id": "9fda08a154104d80aca9d6eef3404bf1", |
439 | "version_major": 2, | 469 | "version_major": 2, |
440 | "version_minor": 0 | 470 | "version_minor": 0 |
441 | }, | 471 | }, |
442 | "text/plain": [ | 472 | "text/plain": [ |
443 | "interactive(children=(Dropdown(description='lines', options=([],), value=[]), Output()), _dom_classes=('widget…" | 473 | "interactive(children=(SelectMultiple(description='Trajectory:', index=(3,), options={'../statistics/viatra_con…" |
444 | ] | 474 | ] |
445 | }, | 475 | }, |
446 | "metadata": {}, | 476 | "metadata": {}, |
@@ -452,7 +482,7 @@ | |||
452 | "<function __main__.plot_mpc(lines)>" | 482 | "<function __main__.plot_mpc(lines)>" |
453 | ] | 483 | ] |
454 | }, | 484 | }, |
455 | "execution_count": 17, | 485 | "execution_count": 38, |
456 | "metadata": {}, | 486 | "metadata": {}, |
457 | "output_type": "execute_result" | 487 | "output_type": "execute_result" |
458 | } | 488 | } |
@@ -460,18 +490,18 @@ | |||
460 | "source": [ | 490 | "source": [ |
461 | "def plot_mpc(lines):\n", | 491 | "def plot_mpc(lines):\n", |
462 | " plot(viatra_con_dic, lines, 0, lambda a: a.mpc_distance, colors, 'MPC')\n", | 492 | " plot(viatra_con_dic, lines, 0, lambda a: a.mpc_distance, colors, 'MPC')\n", |
463 | "interact(plot_mpc, lines=[[]])" | 493 | "interact(plot_mpc, lines=w)" |
464 | ] | 494 | ] |
465 | }, | 495 | }, |
466 | { | 496 | { |
467 | "cell_type": "code", | 497 | "cell_type": "code", |
468 | "execution_count": 18, | 498 | "execution_count": 29, |
469 | "metadata": {}, | 499 | "metadata": {}, |
470 | "outputs": [ | 500 | "outputs": [ |
471 | { | 501 | { |
472 | "data": { | 502 | "data": { |
473 | "application/vnd.jupyter.widget-view+json": { | 503 | "application/vnd.jupyter.widget-view+json": { |
474 | "model_id": "1de0db5b5c8d46de958f6b43144dac54", | 504 | "model_id": "5f4859e7657a4080b8ee0db66ad70b04", |
475 | "version_major": 2, | 505 | "version_major": 2, |
476 | "version_minor": 0 | 506 | "version_minor": 0 |
477 | }, | 507 | }, |
@@ -488,7 +518,7 @@ | |||
488 | "<function __main__.plot_out_degree(lines)>" | 518 | "<function __main__.plot_out_degree(lines)>" |
489 | ] | 519 | ] |
490 | }, | 520 | }, |
491 | "execution_count": 18, | 521 | "execution_count": 29, |
492 | "metadata": {}, | 522 | "metadata": {}, |
493 | "output_type": "execute_result" | 523 | "output_type": "execute_result" |
494 | } | 524 | } |
@@ -501,13 +531,121 @@ | |||
501 | }, | 531 | }, |
502 | { | 532 | { |
503 | "cell_type": "code", | 533 | "cell_type": "code", |
504 | "execution_count": 20, | 534 | "execution_count": 28, |
535 | "metadata": {}, | ||
536 | "outputs": [ | ||
537 | { | ||
538 | "data": { | ||
539 | "application/vnd.jupyter.widget-view+json": { | ||
540 | "model_id": "fd6387994c764904b20975a54b47bf3a", | ||
541 | "version_major": 2, | ||
542 | "version_minor": 0 | ||
543 | }, | ||
544 | "text/plain": [ | ||
545 | "interactive(children=(Dropdown(description='lines', options=([],), value=[]), Output()), _dom_classes=('widget…" | ||
546 | ] | ||
547 | }, | ||
548 | "metadata": {}, | ||
549 | "output_type": "display_data" | ||
550 | }, | ||
551 | { | ||
552 | "data": { | ||
553 | "text/plain": [ | ||
554 | "<function __main__.plot_out_degree(lines)>" | ||
555 | ] | ||
556 | }, | ||
557 | "execution_count": 28, | ||
558 | "metadata": {}, | ||
559 | "output_type": "execute_result" | ||
560 | } | ||
561 | ], | ||
562 | "source": [ | ||
563 | "def plot_out_degree(lines):\n", | ||
564 | " plot(random_dic, lines, 0, lambda a: a.na_distance, colors, 'node activity')\n", | ||
565 | "interact(plot_out_degree, lines=[[]])" | ||
566 | ] | ||
567 | }, | ||
568 | { | ||
569 | "cell_type": "code", | ||
570 | "execution_count": 26, | ||
571 | "metadata": {}, | ||
572 | "outputs": [ | ||
573 | { | ||
574 | "data": { | ||
575 | "application/vnd.jupyter.widget-view+json": { | ||
576 | "model_id": "27e3897451694ffb8af3dd32bc0ece70", | ||
577 | "version_major": 2, | ||
578 | "version_minor": 0 | ||
579 | }, | ||
580 | "text/plain": [ | ||
581 | "interactive(children=(Dropdown(description='lines', options=([],), value=[]), Output()), _dom_classes=('widget…" | ||
582 | ] | ||
583 | }, | ||
584 | "metadata": {}, | ||
585 | "output_type": "display_data" | ||
586 | }, | ||
587 | { | ||
588 | "data": { | ||
589 | "text/plain": [ | ||
590 | "<function __main__.plot_out_degree(lines)>" | ||
591 | ] | ||
592 | }, | ||
593 | "execution_count": 26, | ||
594 | "metadata": {}, | ||
595 | "output_type": "execute_result" | ||
596 | } | ||
597 | ], | ||
598 | "source": [ | ||
599 | "def plot_out_degree(lines):\n", | ||
600 | " plot(random_dic, lines, 0, lambda a: a.mpc_distance, colors, 'MPC')\n", | ||
601 | "interact(plot_out_degree, lines=[[]])" | ||
602 | ] | ||
603 | }, | ||
604 | { | ||
605 | "cell_type": "code", | ||
606 | "execution_count": 25, | ||
607 | "metadata": {}, | ||
608 | "outputs": [ | ||
609 | { | ||
610 | "data": { | ||
611 | "application/vnd.jupyter.widget-view+json": { | ||
612 | "model_id": "f4d0964368254b599c7cb8d6b6f9a0f4", | ||
613 | "version_major": 2, | ||
614 | "version_minor": 0 | ||
615 | }, | ||
616 | "text/plain": [ | ||
617 | "interactive(children=(Dropdown(description='lines', options=([],), value=[]), Output()), _dom_classes=('widget…" | ||
618 | ] | ||
619 | }, | ||
620 | "metadata": {}, | ||
621 | "output_type": "display_data" | ||
622 | }, | ||
623 | { | ||
624 | "data": { | ||
625 | "text/plain": [ | ||
626 | "<function __main__.plot_out_degree(lines)>" | ||
627 | ] | ||
628 | }, | ||
629 | "execution_count": 25, | ||
630 | "metadata": {}, | ||
631 | "output_type": "execute_result" | ||
632 | } | ||
633 | ], | ||
634 | "source": [ | ||
635 | "def plot_out_degree(lines):\n", | ||
636 | " plot(real_random_dic, lines, 0, lambda a: a.out_d_distance, colors, 'out degree')\n", | ||
637 | "interact(plot_out_degree, lines=[[]])" | ||
638 | ] | ||
639 | }, | ||
640 | { | ||
641 | "cell_type": "code", | ||
642 | "execution_count": 24, | ||
505 | "metadata": {}, | 643 | "metadata": {}, |
506 | "outputs": [ | 644 | "outputs": [ |
507 | { | 645 | { |
508 | "data": { | 646 | "data": { |
509 | "application/vnd.jupyter.widget-view+json": { | 647 | "application/vnd.jupyter.widget-view+json": { |
510 | "model_id": "6f8fa855125b4beca603abbf801412ac", | 648 | "model_id": "eca026dd74a945bcbebde5cb69cfe0e2", |
511 | "version_major": 2, | 649 | "version_major": 2, |
512 | "version_minor": 0 | 650 | "version_minor": 0 |
513 | }, | 651 | }, |
@@ -524,26 +662,26 @@ | |||
524 | "<function __main__.plot_out_degree(lines)>" | 662 | "<function __main__.plot_out_degree(lines)>" |
525 | ] | 663 | ] |
526 | }, | 664 | }, |
527 | "execution_count": 20, | 665 | "execution_count": 24, |
528 | "metadata": {}, | 666 | "metadata": {}, |
529 | "output_type": "execute_result" | 667 | "output_type": "execute_result" |
530 | } | 668 | } |
531 | ], | 669 | ], |
532 | "source": [ | 670 | "source": [ |
533 | "def plot_out_degree(lines):\n", | 671 | "def plot_out_degree(lines):\n", |
534 | " plot(random_dic, lines, 0, lambda a: a.na_distance, colors, 'out degree')\n", | 672 | " plot(real_random_dic, lines, 0, lambda a: a.na_distance, colors, 'node activity')\n", |
535 | "interact(plot_out_degree, lines=[[]])" | 673 | "interact(plot_out_degree, lines=[[]])" |
536 | ] | 674 | ] |
537 | }, | 675 | }, |
538 | { | 676 | { |
539 | "cell_type": "code", | 677 | "cell_type": "code", |
540 | "execution_count": 23, | 678 | "execution_count": 27, |
541 | "metadata": {}, | 679 | "metadata": {}, |
542 | "outputs": [ | 680 | "outputs": [ |
543 | { | 681 | { |
544 | "data": { | 682 | "data": { |
545 | "application/vnd.jupyter.widget-view+json": { | 683 | "application/vnd.jupyter.widget-view+json": { |
546 | "model_id": "b4ed2adb29004908a3799bc91bf0662b", | 684 | "model_id": "eff1d3cd5d1a4a85b56024362890759c", |
547 | "version_major": 2, | 685 | "version_major": 2, |
548 | "version_minor": 0 | 686 | "version_minor": 0 |
549 | }, | 687 | }, |
@@ -560,19 +698,153 @@ | |||
560 | "<function __main__.plot_out_degree(lines)>" | 698 | "<function __main__.plot_out_degree(lines)>" |
561 | ] | 699 | ] |
562 | }, | 700 | }, |
563 | "execution_count": 23, | 701 | "execution_count": 27, |
564 | "metadata": {}, | 702 | "metadata": {}, |
565 | "output_type": "execute_result" | 703 | "output_type": "execute_result" |
566 | } | 704 | } |
567 | ], | 705 | ], |
568 | "source": [ | 706 | "source": [ |
569 | "def plot_out_degree(lines):\n", | 707 | "def plot_out_degree(lines):\n", |
570 | " plot(random_dic, lines, 0, lambda a: a.mpc_distance, colors, 'out degree')\n", | 708 | " plot(real_random_dic, lines, 0, lambda a: a.mpc_distance, colors, 'MPC')\n", |
571 | "interact(plot_out_degree, lines=[[]])" | 709 | "interact(plot_out_degree, lines=[[]])" |
572 | ] | 710 | ] |
573 | }, | 711 | }, |
574 | { | 712 | { |
575 | "cell_type": "code", | 713 | "cell_type": "code", |
714 | "execution_count": 11, | ||
715 | "metadata": {}, | ||
716 | "outputs": [], | ||
717 | "source": [ | ||
718 | "filenames = reader.readmultiplefiles('../statistics/viatra500nodes/trajectories/', 15, False)\n", | ||
719 | "trajectories = {}\n", | ||
720 | "for name in filenames:\n", | ||
721 | " trajectories[name] = reader.readTrajectory(name)\n", | ||
722 | "\n", | ||
723 | "w = widgets.SelectMultiple(\n", | ||
724 | " options = trajectories,\n", | ||
725 | " value = [trajectories[filenames[0]]],\n", | ||
726 | " description='Trajectory:',\n", | ||
727 | " disabled=False,\n", | ||
728 | ")\n", | ||
729 | "\n", | ||
730 | "#generate random color for each line\n", | ||
731 | "colors = []\n", | ||
732 | "\n", | ||
733 | "for i in range(0, len(trajectories)):\n", | ||
734 | " color = \"#%06x\" % random.randint(0, 0xFFFFFF)\n", | ||
735 | " colors.append(color)" | ||
736 | ] | ||
737 | }, | ||
738 | { | ||
739 | "cell_type": "code", | ||
740 | "execution_count": 12, | ||
741 | "metadata": {}, | ||
742 | "outputs": [ | ||
743 | { | ||
744 | "data": { | ||
745 | "application/vnd.jupyter.widget-view+json": { | ||
746 | "model_id": "e281415e80684a85ba24ab8cb48ea3fe", | ||
747 | "version_major": 2, | ||
748 | "version_minor": 0 | ||
749 | }, | ||
750 | "text/plain": [ | ||
751 | "interactive(children=(SelectMultiple(description='Trajectory:', index=(0,), options={'../statistics/viatra500n…" | ||
752 | ] | ||
753 | }, | ||
754 | "metadata": {}, | ||
755 | "output_type": "display_data" | ||
756 | }, | ||
757 | { | ||
758 | "data": { | ||
759 | "text/plain": [ | ||
760 | "<function __main__.plot_out_degree(lines)>" | ||
761 | ] | ||
762 | }, | ||
763 | "execution_count": 12, | ||
764 | "metadata": {}, | ||
765 | "output_type": "execute_result" | ||
766 | } | ||
767 | ], | ||
768 | "source": [ | ||
769 | "def plot_out_degree(lines):\n", | ||
770 | " plot(viatra_500_dic, lines, 0, lambda a: a.na_distance, colors, 'node activity')\n", | ||
771 | "interact(plot_out_degree, lines=w)" | ||
772 | ] | ||
773 | }, | ||
774 | { | ||
775 | "cell_type": "code", | ||
776 | "execution_count": 22, | ||
777 | "metadata": {}, | ||
778 | "outputs": [ | ||
779 | { | ||
780 | "data": { | ||
781 | "application/vnd.jupyter.widget-view+json": { | ||
782 | "model_id": "d678fee844e84e2785d50945288f833d", | ||
783 | "version_major": 2, | ||
784 | "version_minor": 0 | ||
785 | }, | ||
786 | "text/plain": [ | ||
787 | "interactive(children=(SelectMultiple(description='Trajectory:', index=(0,), options={'../statistics/viatra500n…" | ||
788 | ] | ||
789 | }, | ||
790 | "metadata": {}, | ||
791 | "output_type": "display_data" | ||
792 | }, | ||
793 | { | ||
794 | "data": { | ||
795 | "text/plain": [ | ||
796 | "<function __main__.plot_out_degree(lines)>" | ||
797 | ] | ||
798 | }, | ||
799 | "execution_count": 22, | ||
800 | "metadata": {}, | ||
801 | "output_type": "execute_result" | ||
802 | } | ||
803 | ], | ||
804 | "source": [ | ||
805 | "def plot_out_degree(lines):\n", | ||
806 | " plot(viatra_500_dic, lines, 0, lambda a: a.out_d_distance, colors, 'out degree')\n", | ||
807 | "interact(plot_out_degree, lines=w)" | ||
808 | ] | ||
809 | }, | ||
810 | { | ||
811 | "cell_type": "code", | ||
812 | "execution_count": 21, | ||
813 | "metadata": {}, | ||
814 | "outputs": [ | ||
815 | { | ||
816 | "data": { | ||
817 | "application/vnd.jupyter.widget-view+json": { | ||
818 | "model_id": "55ca7c3f89224cce8d3a87cf23b20f92", | ||
819 | "version_major": 2, | ||
820 | "version_minor": 0 | ||
821 | }, | ||
822 | "text/plain": [ | ||
823 | "interactive(children=(SelectMultiple(description='Trajectory:', index=(0,), options={'../statistics/viatra500n…" | ||
824 | ] | ||
825 | }, | ||
826 | "metadata": {}, | ||
827 | "output_type": "display_data" | ||
828 | }, | ||
829 | { | ||
830 | "data": { | ||
831 | "text/plain": [ | ||
832 | "<function __main__.plot_out_degree(lines)>" | ||
833 | ] | ||
834 | }, | ||
835 | "execution_count": 21, | ||
836 | "metadata": {}, | ||
837 | "output_type": "execute_result" | ||
838 | } | ||
839 | ], | ||
840 | "source": [ | ||
841 | "def plot_out_degree(lines):\n", | ||
842 | " plot(viatra_500_dic, lines, 0, lambda a: a.mpc_distance, colors, 'mpc')\n", | ||
843 | "interact(plot_out_degree, lines=w)" | ||
844 | ] | ||
845 | }, | ||
846 | { | ||
847 | "cell_type": "code", | ||
576 | "execution_count": null, | 848 | "execution_count": null, |
577 | "metadata": {}, | 849 | "metadata": {}, |
578 | "outputs": [], | 850 | "outputs": [], |