wfgemyd / Clojure_airlines

Ica1+2 SC for PCU

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clojure Airlines 🛫

This project forms a part of the Symbolic Computation course in the BSc (Hons) Computing program. Presented Clojure program efficiently reads and processes flight data, offering personalized flight tickets, which are tailored to increase the company's profit.

Overview

The program is structured as follows:

  • Data Parsing: Utilizes clojure.data.csv to parse flight information from the "Flights_ICA1.csv" dataset.

  • Graph Representation: Constructs a graph where cities are vertices and flights are edges, representing the entire flight network.

  • User Input: Accepts user's input including current location, destination, name and date of birth. The user's input may be a group of people.

  • Flight Plan Generation: Employs a breadth-first search (BFS) algorithm to curate flight plans meeting user's criteria.

  • Sorting and Optimization: Sorts flight plans by cost and flight count, eliminating duplicates.

  • User Analysis: Categorizes the user into one of the groups, either "family" or "group".

  • Historical Flights Sales Analysis: Analyzes historical sales data to predict user budget based on chosen route and group type.

  • Profit Maximization: Maximizes the profit of the company by offering the cheapest ticket by the most expensive price the user will agree to by it for.

Usage

  1. Ensure that JDK, Clojure and Leiningen are installed on your system. Visit Oracle website, Clojure's official website and Leiningen's website for installation instructions.

  2. Clone this repository and navigate to the project directory.

git clone https://github.com/wfgemyd/Clojure_airlines.git
  1. Make sure that the required dependencies are connected correctly.
lein deps 
lein deps :tree
  1. Make sure that you have Java Installed for Incanter graphs to display correctly.

  2. Ensure that the dataset "Flights_ICA1.csv" file is in the "src/data/airlines" directory. Alternatively, you can use your own dataset. Ensure it's in CSV format and contains necessary flight data fields.

  3. Input the departure city, destination city and vector with information about people in your group into the main-check-broker function. Each person's information should be inside of a separate vector, which should contain the name of the person and year of birth. Alternatively, you can use the broker_team_2.csv file to test the function.

  4. Set the fourth argument of main-check-broker function to "true" for program output. If no 4th argument is provided, the program will not provide an output.

  5. Run the program using Clojure REPL.

Example

Scenario

Finding flights from Prague to Brno for the following group of people:

Harry Adams, 1982
Elsie Adams, 1992
Alfie Adams, 2017
Elsie Adams, 2014 

Results

PREDICTED BUDGET IS:  754.9094110317012
FOR PATH:  Prague (0) -> Brno (100)
TICKET PRICE IS:  100
WILL BE SOLD TO CUSTOMER:  700.0
PROFIT FOR ONE TICKET:  600.0
TOTAL PROFIT IF BOUGHT 2400.0

Features

  • Custom Flight Search: Input your travel details and let our algorithm present you with the best ticket price options.

  • Multiple Destinations: Multiple route options can be explored to reach your desired location.

  • Graph representation of flight networks: The flight connections and cities are presented in a graph data structure for a clear representation of the flight network.

  • Historical Data Analysis Visualization: The data visualizations are presented in the code using the Incanter library and in the assets folder.

  • Customizable and Extensible Code Structure: Tailor the application to your needs or contribute to its growth!

Limitations and Future Improvements

  • Single Data Source: The program currently supports only one CSV data file as a data source for flight information.

  • Error Handling: The program currently does not handle missing fields or invalid inputs (e.g., non-existent cities, negative budget values) in the dataset gracefully. Ensure that the CSV file has no missing or invalid values.

  • Limited Filtering Options: Currently, our program is designed to output the most and least expensive flight connections.

  • Limiter Budget Prediction Model: The program currently uses a simple hypothesis to predict the user's budget based on the historical data. The groups of people are distinguished only by two types now. The model does not support the budget evaluation for an individual. The model can be improved by using more advanced machine learning techniques.

  • Localization: Currently, the program only supports datasets and inputs in English. Internationalization features, such as multi-language support, are not yet implemented.

References

License

Clojure Airlines is licensed under the Eclipse Public License 2.0. See the LICENSE file for more details.

About

Ica1+2 SC for PCU

License:Other


Languages

Language:Clojure 83.4%Language:Python 16.6%