|
69 | 69 | },
|
70 | 70 | {
|
71 | 71 | "cell_type": "code",
|
72 |
| - "execution_count": 31, |
| 72 | + "execution_count": 3, |
73 | 73 | "id": "1ecf0429-f03f-4ad2-abb4-46692a74e559",
|
74 | 74 | "metadata": {},
|
75 | 75 | "outputs": [],
|
|
95 | 95 | " \"mode\": \"fixed\",\n",
|
96 | 96 | " \"fixed\": 8,\n",
|
97 | 97 | " \"rnd\": {\n",
|
98 |
| - " \"values\":[6, 7, 8, 9, 10, 11],\n", |
99 |
| - " \"freq\":[0.25, 0.25, 0.2, 0.1, 0.1, 0.1]\n", |
| 98 | + " \"values\":[8, 9, 10, 11, 12, 13],\n", |
| 99 | + " \"freq\":[25, 25, 2, 1, 1, 1]\n", |
100 | 100 | " }\n",
|
101 | 101 | "}\n",
|
102 | 102 | " \n",
|
|
354 | 354 | },
|
355 | 355 | {
|
356 | 356 | "cell_type": "code",
|
357 |
| - "execution_count": 35, |
| 357 | + "execution_count": 8, |
358 | 358 | "id": "b3e686ce-5371-4471-a052-b9d43309bc85",
|
359 | 359 | "metadata": {},
|
360 | 360 | "outputs": [],
|
|
381 | 381 | "\n",
|
382 | 382 | " args.results[\"n_arrivals\"] += 1\n",
|
383 | 383 | " \n",
|
384 |
| - " trace(f\"{env.now:.2f}: Stroke arrival.\")\n", |
| 384 | + " trace(f\"{env.now:.2f}: Patient {patient_id}. Stroke arrival.\")\n", |
385 | 385 | "\n",
|
386 | 386 | " # patient enters pathway\n",
|
387 | 387 | " env.process(acute_stroke_pathway(patient_id, env, args))"
|
388 | 388 | ]
|
389 | 389 | },
|
390 | 390 | {
|
391 | 391 | "cell_type": "code",
|
392 |
| - "execution_count": 12, |
| 392 | + "execution_count": 9, |
393 | 393 | "id": "ca37c9cd-158c-416b-8490-b4c5c2e63412",
|
394 | 394 | "metadata": {},
|
395 | 395 | "outputs": [],
|
|
434 | 434 | },
|
435 | 435 | {
|
436 | 436 | "cell_type": "code",
|
437 |
| - "execution_count": 13, |
| 437 | + "execution_count": 10, |
438 | 438 | "id": "0d0ea6cf-7d95-4d2c-9690-fcdbdae35d84",
|
439 | 439 | "metadata": {},
|
440 | 440 | "outputs": [],
|
|
501 | 501 | },
|
502 | 502 | {
|
503 | 503 | "cell_type": "code",
|
504 |
| - "execution_count": 34, |
| 504 | + "execution_count": 11, |
505 | 505 | "id": "caf52390-5455-4fa1-bb22-60b5b91ad8d0",
|
506 | 506 | "metadata": {},
|
507 | 507 | "outputs": [
|
|
517 | 517 | "0.00: Patient -6 loaded into queue\n",
|
518 | 518 | "0.00: Patient -7 loaded into queue\n",
|
519 | 519 | "0.00: Patient -8 loaded into queue\n",
|
| 520 | + "0.00: Patient -9 loaded into queue\n", |
| 521 | + "0.00: Patient -10 loaded into queue\n", |
520 | 522 | "0.00: Patient -1 admitted to acute ward.(waited 0.00 days)\n",
|
521 | 523 | "0.00: Patient -2 admitted to acute ward.(waited 0.00 days)\n",
|
522 | 524 | "0.00: Patient -3 admitted to acute ward.(waited 0.00 days)\n",
|
|
525 | 527 | "0.00: Patient -6 admitted to acute ward.(waited 0.00 days)\n",
|
526 | 528 | "0.00: Patient -7 admitted to acute ward.(waited 0.00 days)\n",
|
527 | 529 | "0.00: Patient -8 admitted to acute ward.(waited 0.00 days)\n",
|
528 |
| - "3.29: Stroke arrival.\n", |
529 |
| - "3.29: Patient 1 admitted to acute ward.(waited 0.00 days)\n", |
530 |
| - "4.06: Stroke arrival.\n", |
531 |
| - "4.22: Patient -3 discharged.\n", |
532 |
| - "4.22: Patient 2 admitted to acute ward.(waited 0.16 days)\n", |
533 |
| - "5.00: 🥵 Warm up complete.\n", |
534 |
| - "5.28: Patient -2 discharged.\n", |
535 |
| - "5.31: Stroke arrival.\n", |
536 |
| - "5.31: Patient 3 admitted to acute ward.(waited 0.00 days)\n", |
537 |
| - "5.53: Stroke arrival.\n", |
538 |
| - "5.76: Stroke arrival.\n", |
539 |
| - "5.98: Patient -8 discharged.\n", |
540 |
| - "5.98: Patient 4 admitted to acute ward.(waited 0.44 days)\n", |
541 |
| - "6.60: Patient -6 discharged.\n", |
542 |
| - "6.60: Patient 5 admitted to acute ward.(waited 0.84 days)\n", |
543 |
| - "7.25: Patient -7 discharged.\n", |
544 |
| - "7.56: Stroke arrival.\n", |
545 |
| - "7.56: Patient 6 admitted to acute ward.(waited 0.00 days)\n", |
546 |
| - "7.62: Stroke arrival.\n", |
547 |
| - "7.77: Patient -1 discharged.\n", |
548 |
| - "7.77: Patient 7 admitted to acute ward.(waited 0.15 days)\n", |
549 |
| - "7.91: Patient -4 discharged.\n", |
550 |
| - "8.33: Patient -5 discharged.\n", |
551 |
| - "8.52: Stroke arrival.\n", |
552 |
| - "8.52: Patient 8 admitted to acute ward.(waited 0.00 days)\n", |
553 |
| - "8.82: Stroke arrival.\n", |
554 |
| - "8.82: Patient 9 admitted to acute ward.(waited 0.00 days)\n", |
555 |
| - "9.80: Patient 1 discharged.\n", |
556 |
| - "11.12: Stroke arrival.\n", |
557 |
| - "11.12: Patient 10 admitted to acute ward.(waited 0.00 days)\n", |
558 |
| - "11.93: Patient 2 discharged.\n", |
559 |
| - "12.98: Stroke arrival.\n", |
560 |
| - "12.98: Patient 11 admitted to acute ward.(waited 0.00 days)\n", |
561 |
| - "12.99: Stroke arrival.\n", |
562 |
| - "13.26: Patient 3 discharged.\n", |
563 |
| - "13.26: Patient 12 admitted to acute ward.(waited 0.26 days)\n", |
564 |
| - "13.80: Patient 5 discharged.\n", |
565 |
| - "14.19: Patient 7 discharged.\n", |
566 |
| - "14.20: Patient 4 discharged.\n" |
| 530 | + "0.00: Patient -9 admitted to acute ward.(waited 0.00 days)\n", |
| 531 | + "0.00: 🥵 Warm up complete.\n", |
| 532 | + "2.74: Patient 1. Stroke arrival.\n", |
| 533 | + "2.78: Patient 2. Stroke arrival.\n", |
| 534 | + "3.36: Patient 3. Stroke arrival.\n", |
| 535 | + "4.42: Patient 4. Stroke arrival.\n", |
| 536 | + "4.68: Patient 5. Stroke arrival.\n", |
| 537 | + "5.80: Patient -3 discharged.\n", |
| 538 | + "5.80: Patient -10 admitted to acute ward.(waited 5.80 days)\n", |
| 539 | + "5.80: Patient -8 discharged.\n", |
| 540 | + "5.80: Patient 1 admitted to acute ward.(waited 3.06 days)\n", |
| 541 | + "5.97: Patient 6. Stroke arrival.\n", |
| 542 | + "6.08: Patient -6 discharged.\n", |
| 543 | + "6.08: Patient 2 admitted to acute ward.(waited 3.30 days)\n", |
| 544 | + "6.22: Patient -7 discharged.\n", |
| 545 | + "6.22: Patient 3 admitted to acute ward.(waited 2.86 days)\n", |
| 546 | + "6.33: Patient 7. Stroke arrival.\n", |
| 547 | + "7.28: Patient 8. Stroke arrival.\n", |
| 548 | + "7.41: Patient -4 discharged.\n", |
| 549 | + "7.41: Patient 4 admitted to acute ward.(waited 2.99 days)\n", |
| 550 | + "7.43: Patient 9. Stroke arrival.\n", |
| 551 | + "7.55: Patient 10. Stroke arrival.\n", |
| 552 | + "7.94: Patient -5 discharged.\n", |
| 553 | + "7.94: Patient 5 admitted to acute ward.(waited 3.26 days)\n", |
| 554 | + "8.11: Patient -2 discharged.\n", |
| 555 | + "8.11: Patient 6 admitted to acute ward.(waited 2.14 days)\n", |
| 556 | + "8.26: Patient 11. Stroke arrival.\n", |
| 557 | + "8.42: Patient 12. Stroke arrival.\n", |
| 558 | + "8.68: Patient 13. Stroke arrival.\n", |
| 559 | + "8.72: Patient 14. Stroke arrival.\n", |
| 560 | + "8.82: Patient -9 discharged.\n", |
| 561 | + "8.82: Patient 7 admitted to acute ward.(waited 2.50 days)\n", |
| 562 | + "8.95: Patient 15. Stroke arrival.\n", |
| 563 | + "9.18: Patient 16. Stroke arrival.\n", |
| 564 | + "9.87: Patient -1 discharged.\n", |
| 565 | + "9.87: Patient 8 admitted to acute ward.(waited 2.58 days)\n", |
| 566 | + "9.92: Patient 17. Stroke arrival.\n" |
567 | 567 | ]
|
568 | 568 | },
|
569 | 569 | {
|
570 | 570 | "data": {
|
571 | 571 | "text/plain": [
|
572 |
| - "{'mean_acute_wait': 0.16965284328644098}" |
| 572 | + "{'mean_acute_wait': 2.8362718457918676}" |
573 | 573 | ]
|
574 | 574 | },
|
575 |
| - "execution_count": 34, |
| 575 | + "execution_count": 11, |
576 | 576 | "metadata": {},
|
577 | 577 | "output_type": "execute_result"
|
578 | 578 | }
|
|
583 | 583 | "init_cond_params[\"mode\"] = \"fixed\"\n",
|
584 | 584 | "\n",
|
585 | 585 | "# uncomment to vary the fixed amount 10 = 1 in queue.\n",
|
586 |
| - "# init_cond_params[\"fixed\"] = 10\n", |
| 586 | + "init_cond_params[\"fixed\"] = 10\n", |
587 | 587 | "\n",
|
588 | 588 | "experiment = Experiment(init_cond_params=init_cond_params)\n",
|
589 |
| - "results = single_run(experiment, rep=0, wu_period=5.0, rc_period=10.0)\n", |
| 589 | + "results = single_run(experiment, rep=1, wu_period=0.0, rc_period=10.0)\n", |
590 | 590 | "results"
|
591 | 591 | ]
|
| 592 | + }, |
| 593 | + { |
| 594 | + "cell_type": "code", |
| 595 | + "execution_count": 12, |
| 596 | + "id": "0aaef408-09ca-49e0-8d39-f4a088a4ef1b", |
| 597 | + "metadata": {}, |
| 598 | + "outputs": [ |
| 599 | + { |
| 600 | + "data": { |
| 601 | + "text/plain": [ |
| 602 | + "{'n_arrivals': 17,\n", |
| 603 | + " 'waiting_acute': [3.0586175577655674,\n", |
| 604 | + " 3.303449502025928,\n", |
| 605 | + " 2.857579305401165,\n", |
| 606 | + " 2.9908615153438225,\n", |
| 607 | + " 3.2622390398417513,\n", |
| 608 | + " 2.136685286636955,\n", |
| 609 | + " 2.496306611009193,\n", |
| 610 | + " 2.58443594831056]}" |
| 611 | + ] |
| 612 | + }, |
| 613 | + "execution_count": 12, |
| 614 | + "metadata": {}, |
| 615 | + "output_type": "execute_result" |
| 616 | + } |
| 617 | + ], |
| 618 | + "source": [ |
| 619 | + "experiment.results" |
| 620 | + ] |
592 | 621 | }
|
593 | 622 | ],
|
594 | 623 | "metadata": {
|
|
0 commit comments