{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Simulation" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The simulator allows to observe the behavior of the system under a given policy.\n", "\n", "The following policies are provided:" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2024-07-09T20:48:36.646390Z", "start_time": "2024-07-09T20:48:34.876737Z" }, "execution": { "iopub.execute_input": "2025-09-28T06:59:32.314219Z", "iopub.status.busy": "2025-09-28T06:59:32.314219Z", "iopub.status.idle": "2025-09-28T06:59:39.243494Z", "shell.execute_reply": "2025-09-28T06:59:39.243494Z", "shell.execute_reply.started": "2025-09-28T06:59:32.314219Z" } }, "outputs": [ { "data": { "text/plain": [ "{'fcfm': stochastic_matching.simulator.fcfm.FCFM,\n", " 'priority': stochastic_matching.simulator.priority.Priority,\n", " 'random_edge': stochastic_matching.simulator.random_edge.RandomEdge,\n", " 'random_item': stochastic_matching.simulator.random_item.RandomItem,\n", " 'e_filtering': stochastic_matching.simulator.e_filtering.EFiltering,\n", " 'constant_regret': stochastic_matching.simulator.constant_regret.ConstantRegret,\n", " 'longest': stochastic_matching.simulator.longest.Longest,\n", " 'virtual_queue': stochastic_matching.simulator.virtual_queue.VirtualQueue}" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import stochastic_matching as sm\n", "\n", "sm.common.get_classes(sm.Simulator)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Tadpole" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Bijective" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Consider the following tadpole:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "ExecuteTime": { "end_time": "2024-07-09T20:48:36.657262Z", "start_time": "2024-07-09T20:48:36.648398Z" }, "execution": { "iopub.execute_input": "2025-09-28T06:59:39.244501Z", "iopub.status.busy": "2025-09-28T06:59:39.244501Z", "iopub.status.idle": "2025-09-28T06:59:39.251007Z", "shell.execute_reply": "2025-09-28T06:59:39.250500Z", "shell.execute_reply.started": "2025-09-28T06:59:39.244501Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "