diff --git a/TP2_SD/.idea/inspectionProfiles/Project_Default.xml b/TP2_SD/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000000000000000000000000000000000000..3bef578419874ab37b1ede56d1a32e12e68e4618 --- /dev/null +++ b/TP2_SD/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,12 @@ +<component name="InspectionProjectProfileManager"> + <profile version="1.0"> + <option name="myName" value="Project Default" /> + <inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true"> + <option name="ignoredIdentifiers"> + <list> + <option value="main_PFM.PFM" /> + </list> + </option> + </inspection_tool> + </profile> +</component> \ No newline at end of file diff --git a/TP2_SD/.idea/inspectionProfiles/profiles_settings.xml b/TP2_SD/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000000000000000000000000000000000000..105ce2da2d6447d11dfe32bfb846c3d5b199fc99 --- /dev/null +++ b/TP2_SD/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ +<component name="InspectionProjectProfileManager"> + <settings> + <option name="USE_PROJECT_PROFILE" value="false" /> + <version value="1.0" /> + </settings> +</component> \ No newline at end of file diff --git a/TP2_SD/.idea/misc.xml b/TP2_SD/.idea/misc.xml new file mode 100644 index 0000000000000000000000000000000000000000..25be3d744ad806b0b3f239ab7756edb8300ee677 --- /dev/null +++ b/TP2_SD/.idea/misc.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="Black"> + <option name="sdkName" value="Python 3.8 (TP2_SD)" /> + </component> + <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8 (TP2_SD)" project-jdk-type="Python SDK" /> +</project> \ No newline at end of file diff --git a/TP2_SD/.idea/vcs.xml b/TP2_SD/.idea/vcs.xml new file mode 100644 index 0000000000000000000000000000000000000000..6c0b8635858dc7ad44b93df54b762707ce49eefc --- /dev/null +++ b/TP2_SD/.idea/vcs.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="$PROJECT_DIR$/.." vcs="Git" /> + </component> +</project> \ No newline at end of file diff --git a/TP2_SD/.idea/workspace.xml b/TP2_SD/.idea/workspace.xml new file mode 100644 index 0000000000000000000000000000000000000000..080ddeb8031986cde15d8ca7cadc3dbc9ff12f32 --- /dev/null +++ b/TP2_SD/.idea/workspace.xml @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="AutoImportSettings"> + <option name="autoReloadType" value="SELECTIVE" /> + </component> + <component name="ChangeListManager"> + <list default="true" id="d3ad6e06-4ec0-4bbd-8ff7-dd7b7d79011f" name="Changes" comment=""> + <change afterPath="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" afterDir="false" /> + <change afterPath="$PROJECT_DIR$/.idea/inspectionProfiles/profiles_settings.xml" afterDir="false" /> + <change afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" /> + <change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" /> + <change afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> + <change beforePath="$PROJECT_DIR$/../TP2_hachage/tp_2_miso_dict.py" beforeDir="false" afterPath="$PROJECT_DIR$/../TP2_hachage/tp_2_miso_dict.py" afterDir="false" /> + </list> + <option name="SHOW_DIALOG" value="false" /> + <option name="HIGHLIGHT_CONFLICTS" value="true" /> + <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> + <option name="LAST_RESOLUTION" value="IGNORE" /> + </component> + <component name="Git.Settings"> + <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." /> + </component> + <component name="ProjectColorInfo">{ + "associatedIndex": 1 +}</component> + <component name="ProjectId" id="2syqnupzN8dMmogQzixMGDGyDfW" /> + <component name="ProjectViewState"> + <option name="hideEmptyMiddlePackages" value="true" /> + <option name="showLibraryContents" value="true" /> + </component> + <component name="PropertiesComponent"><![CDATA[{ + "keyToString": { + "RunOnceActivity.ShowReadmeOnStart": "true", + "git-widget-placeholder": "Rebasing main", + "last_opened_file_path": "C:/Users/sania/Desktop/tp2_sania_ayat_sd/TP2_hachage/tp_2_miso_mphf.py" + } +}]]></component> + <component name="RecentsManager"> + <key name="MoveFile.RECENT_KEYS"> + <recent name="C:\Users\sania\Desktop\tp2_sania_ayat_sd\TP2_SD" /> + </key> + </component> + <component name="SharedIndexes"> + <attachedChunks> + <set> + <option value="bundled-python-sdk-0e3be3396995-c546a90a8094-com.jetbrains.pycharm.community.sharedIndexes.bundled-PC-242.23339.19" /> + </set> + </attachedChunks> + </component> + <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" /> + <component name="TaskManager"> + <task active="true" id="Default" summary="Default task"> + <changelist id="d3ad6e06-4ec0-4bbd-8ff7-dd7b7d79011f" name="Changes" comment="" /> + <created>1739438333670</created> + <option name="number" value="Default" /> + <option name="presentableId" value="Default" /> + <updated>1739438333670</updated> + </task> + <servers /> + </component> +</project> \ No newline at end of file diff --git a/TP2_hachage/tp_2_miso_dict.py b/TP2_hachage/tp_2_miso_dict.py index b77d10a5ef2183222d049327352cacb10bf03d04..560b912e716d89686de72d0e11a7bae021b0a6bc 100644 --- a/TP2_hachage/tp_2_miso_dict.py +++ b/TP2_hachage/tp_2_miso_dict.py @@ -2,7 +2,6 @@ import matplotlib.pyplot as plt import numpy as np import time import sys -import create_hash_table from tp_2_miso_mphf ###### PARTIE 2 ###### @@ -10,13 +9,35 @@ def experiment_load_factor(load_factors): #= load_factor = liste de facteur de c """ Étude du facteur de charge """ - A= create_hash_table(set_kmer,n) + insertion_times=[] + num_resizes = [] + sizes = [] - return [],[],[] + for i in load_factors: + dict = {} + num_elements= 0 #nombre d'élement dans table + num_resize = 0 #taille dico + last_size = sys.getsizeof(dict) #taile dico après insertion + start_time = time.time() # tps avant insertion + + while num_elements < load_factors: #remplie table tant que taille attendue par facteur de charge pas atteint + dict[num_elements]=num_elements + num_elements =+ 1 + last_size = sys.getsizeof(dict) + num_resize =+ 1 #on ajoute 1 élement donc 1 position en + + end_time = time.time() #temps fin insertion + insertion_times.append(end_time - start_time) #temps totale + sizes.append(last_size) #on ajoute la nouvelle taille dans la liste + num_resizes.append(num_resize) #nouvelle table + + return insertion_times, num_resizes, sizes def experiment_longest(): """ - TODO: que fait cette fonction + TODO: cette focntion apour objectif de créer un dictionnaire, à partir d'une valleur de départ, + pour chaque iteration, elle associé une clé qui est la chaine de caractère de la valeur. A chaque insertion, le temps + est ajouté est mésuré et est stocké dans une variable. + A la fin un histogramme est créer et stocké dans un histogramme. """ d = {} insertion_times = []