<jupyter_start><jupyter_text>Extension One Notebook: The baseline assumes that the system has only one AV. Clearly, this is a limited case; in many cases we may be interested in mixed-autonomy settings which involve a number of AVs. Thus, the first extension investigates how the system behaves as the proportion of AVs in the system increases. Run the cells below to execute the experiments, illustrate the results, plot system metrics, and save the visualizations in the "outputs" folder.<jupyter_code># Automatically reload custom code modules when there are changes:
%load_ext autoreload
%autoreload 2

# Adjust relative path so that the notebook can find the code modules:
import sys
sys.path.append('../code/')

import numpy as np
import pandas as pd

import matplotlib as mpl
import matplotlib.pyplot as plt

%matplotlib inline
plt.style.use('seaborn-darkgrid')

# Import code modules:
from structures import RingRoad
from extension_one import extension_one
from extension_three import extension_three
# Hide warnings about safe distance violation (still in development):
import warnings
warnings.filterwarnings("ignore", category=UserWarning)<jupyter_output><empty_output><jupyter_text>In the figures below, the green vehicles are AVs, the blue vehicles are human-driven cars, and the pink shaded area is the 'safety zone' behind each vehicle.<jupyter_code>num_vehicles = 22

# Scale the proportion of AVs in the system (from 0% to 100%) and record the results for each
# Then, plot the results 
extension_one(num_vehicles, show_fig=True)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.056472081218274114, 'fraction_numerical': 0.004441624365482234, 'mean_word_length': 5.797413793103448, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '30021', 'license': 'MIT', 'n_tokens_mistral': 437, 'n_tokens_neox': 415, 'n_words': 201, 'path': 'notebooks/Extension-One.ipynb', 'repo_name': 'chickert/autonomous_vehicles', 'size': '1576'}