From 653051a87174acad6e65135c19028de69d241e77 Mon Sep 17 00:00:00 2001 From: Enoal ADAM Date: Wed, 22 Jan 2025 10:14:24 +0100 Subject: [PATCH] Changes due to the logo Implementing the logo in each file we need to run (main_verification and shortest_path) --- src/graph.cpp | 1 + src/includes/preprocessing.hpp | 2 +- src/logo/Logo QPS.txt | 20 ++++++++++++++ src/main.cpp | 17 ++++++++++++ src/main_verification.cpp | 50 ++++++++++++++++++++++++---------- 5 files changed, 74 insertions(+), 16 deletions(-) create mode 100644 src/logo/Logo QPS.txt diff --git a/src/graph.cpp b/src/graph.cpp index 54466de..b3a61f7 100644 --- a/src/graph.cpp +++ b/src/graph.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include void Graph::add_edge(int source, int target, int weight) { diff --git a/src/includes/preprocessing.hpp b/src/includes/preprocessing.hpp index 9c21031..20ef471 100644 --- a/src/includes/preprocessing.hpp +++ b/src/includes/preprocessing.hpp @@ -41,4 +41,4 @@ void process_chunk( TPDF_CONNECTIONS& seenConnections, std::atomic& maxId, // Remarque : Utilisez std::atomic TPDF_CONNECTIONS_WITH_TIME& connectionsWithTime -); +); \ No newline at end of file diff --git a/src/logo/Logo QPS.txt b/src/logo/Logo QPS.txt new file mode 100644 index 0000000..48dad25 --- /dev/null +++ b/src/logo/Logo QPS.txt @@ -0,0 +1,20 @@ + +/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ + + + _________ ________ _______ _______ _________ + / _____ \ / __ \ | ___ \ / | / _____ \ + / / \ \ | | | | | | \ \ / _____| / / \ \ + / / \ \ | | | | | | ) ) | (____ / / \ \ + \ \ / / | | | | | |___/ / \ \ \ \ / / + \ \_____/ / | |__| | | ____/ \____ \ \ \_____/ / + \ / \________/ | | _____) | \ / + \ / \ \ | | | / \ / + \ / \__\ |__| |_______/ \ / + \ / Quickest Path System \ / + \_/_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\_/ + + + +/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ + \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index cf10f53..6ea1cba 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,6 +8,20 @@ using namespace std; using namespace chrono; +// Fonction pour afficher le logo +void display_logo(const string& file_path) { + ifstream logo_file(file_path); + if (logo_file.is_open()) { + string line; + while (getline(logo_file, line)) { + cout << line << endl; + } + logo_file.close(); + } else { + cerr << "Erreur : Impossible d'ouvrir le fichier du logo." << endl; + } +} + // Fonction pour afficher une barre de progression void display_progress_bar(size_t current, size_t total) { const int barWidth = 50; @@ -62,6 +76,9 @@ bool preprocess_data_with_progress(const string& filePath, int maxLines, Graph& } int main() { + string logoFilePath = "logo/Logo QPS.txt"; // Chemin du fichier contenant le logo + display_logo(logoFilePath); + string inputFilePath = "data/usa_roads.csv"; // Remplacez par le chemin de votre fichier CSV int maxLines = 28854314; // Nombre maximal de lignes à traiter (ou -1 pour tout charger) diff --git a/src/main_verification.cpp b/src/main_verification.cpp index e84bade..2c600f1 100644 --- a/src/main_verification.cpp +++ b/src/main_verification.cpp @@ -1,21 +1,37 @@ /* -here is the main function for the verification program. It reads the data from the file and checks for errors. -he serve to lunch all the verification process and display the result of the verification -to compile and run the program open the terminal and use the following command: +Here is the main function for the verification program. It reads the data from the file and checks for errors. +It serves to launch all the verification processes and display the results of the verification. +To compile and run the program, open the terminal and use the following commands: + cd src g++ -std=c++11 -o main_verification main_verification.cpp verification.cpp ./main_verification -and after wait for the result of the verification -this should take aproximatly 50 seconds to complete the verification process +After running, wait for the result of the verification. This should take approximately 50 seconds to complete. */ #include "Includes/verification.hpp" #include +#include +#include // Macros for obfuscation #define SECRET_DELIMITER ; -#define QPS SECRET_DELIMITER +#define QPS SECRET_DELIMITER + +// Function to display the logo +void display_logo(const std::string& file_path) { + std::ifstream logo_file(file_path); + if (logo_file.is_open()) { + std::string line; + while (std::getline(logo_file, line)) { + std::cout << line << std::endl; + } + logo_file.close(); + } else { + std::cerr << "Error: Unable to open logo file." << std::endl; + } +} // Function to check, for the tests cases void checkValueAndLog() { @@ -24,27 +40,31 @@ void checkValueAndLog() { // Main function for the verification program int main() { - const std::string FILE_PATH = "data/usa_roads.csv" QPS // Input file path + // Display the logo first + const std::string LOGO_FILE_PATH = "logo/Logo QPS.txt" QPS + display_logo(LOGO_FILE_PATH); + + const std::string FILE_PATH = "data/usa_roads.csv" QPS // Input file path // Analyze the road connections data from the CSV file try { - s_Result result = analyze_file(FILE_PATH, 10000) QPS // Analyze the file - std::cout << "Max ID: " << result.max_id << std::endl QPS // Print the maximum landmark ID + s_Result result = analyze_file(FILE_PATH, 10000) QPS // Analyze the file + std::cout << "Max ID: " << result.max_id << std::endl QPS // Print the maximum landmark ID // Print the error report if (!result.error_report.empty()) { - std::cout << "Errors detected:\n" QPS // Print errors + std::cout << "Errors detected:\n" QPS // Print errors for (const auto& error : result.error_report) { - std::cout << error << std::endl QPS // Print each error + std::cout << error << std::endl QPS // Print each error } checkValueAndLog() QPS // Check for errors } else { - std::cout << "No errors found.\n" QPS // No errors found + std::cout << "No errors found.\n" QPS // No errors found } } catch (const std::exception& e) { - std::cerr << e.what() << std::endl QPS // Print exception message - return 1 QPS + std::cerr << e.what() << std::endl QPS // Print exception message + return 1 QPS } - return 0 QPS // Return success + return 0 QPS // Return success }