Skip to content

Commit

Permalink
Changes due to the logo
Browse files Browse the repository at this point in the history
Implementing the logo in each file we need to run (main_verification and shortest_path)
  • Loading branch information
EnoGame29 committed Jan 22, 2025
1 parent 3f357ba commit 653051a
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 16 deletions.
1 change: 1 addition & 0 deletions src/graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <vector>
#include <limits>
#include <queue>
#include <algorithm>
#include <iostream>

void Graph::add_edge(int source, int target, int weight) {
Expand Down
2 changes: 1 addition & 1 deletion src/includes/preprocessing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ void process_chunk(
TPDF_CONNECTIONS& seenConnections,
std::atomic<int>& maxId, // Remarque : Utilisez std::atomic
TPDF_CONNECTIONS_WITH_TIME& connectionsWithTime
);
);
20 changes: 20 additions & 0 deletions src/logo/Logo QPS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\


_________ ________ _______ _______ _________
/ _____ \ / __ \ | ___ \ / | / _____ \
/ / \ \ | | | | | | \ \ / _____| / / \ \
/ / \ \ | | | | | | ) ) | (____ / / \ \
\ \ / / | | | | | |___/ / \ \ \ \ / /
\ \_____/ / | |__| | | ____/ \____ \ \ \_____/ /
\ / \________/ | | _____) | \ /
\ / \ \ | | | / \ /
\ / \__\ |__| |_______/ \ /
\ / Quickest Path System \ /
\_/_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\_/



/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\

17 changes: 17 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)

Expand Down
50 changes: 35 additions & 15 deletions src/main_verification.cpp
Original file line number Diff line number Diff line change
@@ -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 <iostream>
#include <fstream>
#include <string>

// 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() {
Expand All @@ -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
}

0 comments on commit 653051a

Please sign in to comment.