Skip to content

Commit cd2df99

Browse files
committed
chore(pep8): autoformat of exp nb
1 parent a2050e2 commit cd2df99

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

content/07_experiments.ipynb

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"# default mean inter-arrival time (exp)\n",
6767
"MEAN_IAT = 60 / 100\n",
6868
"\n",
69-
"## default service time parameters (triangular)\n",
69+
"# default service time parameters (triangular)\n",
7070
"CALL_LOW = 5.0\n",
7171
"CALL_MODE = 7.0\n",
7272
"CALL_HIGH = 10.0\n",
@@ -415,60 +415,61 @@
415415
"outputs": [],
416416
"source": [
417417
"def service(identifier, env, args):\n",
418-
" '''\n",
418+
" \"\"\"\n",
419419
" simulates the service process for a call operator\n",
420420
"\n",
421421
" 1. request and wait for a call operator\n",
422422
" 2. phone triage (triangular)\n",
423423
" 3. exit system\n",
424-
" \n",
424+
"\n",
425425
" Params:\n",
426426
" ------\n",
427-
" \n",
428-
" identifier: int \n",
427+
"\n",
428+
" identifier: int\n",
429429
" A unique identifer for this caller\n",
430430
"\n",
431431
" env: simpy.Environment\n",
432432
" The current environent the simulation is running in\n",
433433
" We use this to pause and restart the process after a delay.\n",
434-
" \n",
434+
"\n",
435435
" args: Experiment\n",
436436
" The settings and input parameters for the current experiment\n",
437-
" \n",
438-
" '''\n",
439-
" \n",
437+
"\n",
438+
" \"\"\"\n",
439+
"\n",
440440
" # record the time that call entered the queue\n",
441441
" start_wait = env.now\n",
442-
" \n",
442+
"\n",
443443
" # request an operator\n",
444444
" with args.operators.request() as req:\n",
445445
" yield req\n",
446-
" \n",
446+
"\n",
447447
" # record the waiting time for call to be answered\n",
448448
" waiting_time = env.now - start_wait\n",
449-
" \n",
449+
"\n",
450450
" # ######################################################################\n",
451-
" # MODIFICATION: store the results for an experiment \n",
452-
" args.results['waiting_times'].append(waiting_time)\n",
451+
" # MODIFICATION: store the results for an experiment\n",
452+
" args.results[\"waiting_times\"].append(waiting_time)\n",
453453
" # ######################################################################\n",
454454
"\n",
455-
" trace(f'operator answered call {identifier} at ' \\\n",
456-
" + f'{env.now:.3f}')\n",
455+
" trace(f\"operator answered call {identifier} at \" + f\"{env.now:.3f}\")\n",
457456
"\n",
458457
" # ######################################################################\n",
459458
" # MODIFICATION: the sample distribution is defined by the experiment.\n",
460-
" call_duration = args.call_dist.sample() \n",
459+
" call_duration = args.call_dist.sample()\n",
461460
" # ######################################################################\n",
462-
" \n",
461+
"\n",
463462
" # schedule process to begin again after call_duration\n",
464463
" yield env.timeout(call_duration)\n",
465-
" \n",
466-
" # update the total call_duration \n",
467-
" args.results['total_call_duration'] += call_duration\n",
464+
"\n",
465+
" # update the total call_duration\n",
466+
" args.results[\"total_call_duration\"] += call_duration\n",
468467
"\n",
469468
" # print out information for patient.\n",
470-
" trace(f'call {identifier} ended {env.now:.3f}; ' \\\n",
471-
" + f'waiting time was {waiting_time:.3f}')"
469+
" trace(\n",
470+
" f\"call {identifier} ended {env.now:.3f}; \"\n",
471+
" + f\"waiting time was {waiting_time:.3f}\"\n",
472+
" )"
472473
]
473474
},
474475
{
@@ -561,7 +562,7 @@
561562
" / (rc_period * experiment.n_operators)\n",
562563
" ) * 100.0\n",
563564
"\n",
564-
" print(f\"Experiment complete\")\n",
565+
" print(\"Experiment complete\")\n",
565566
"\n",
566567
" # return the results from the run of the model\n",
567568
" return results"

0 commit comments

Comments
 (0)