Smart optimization of product distribution in supermarkets to maximize sales and efficiency.
- Project Description
- Key Features
- Quick Demo
- Tech Stack and Architecture
- Getting Started
- Project Structure
- Useful Gradle Commands
- Development Team
Supermarket Manager is a desktop application designed to solve the complex problem of product distribution on supermarket shelves.
The goal is to generate an optimal layout that not only enhances the customer experience but also increases sales through strategic product placement based on data and similarities between products defined by the supermarket itself.
The system uses advanced algorithms, such as a solution to the Travelling Salesman Problem (TSP) and Backtracking, to calculate the most efficient layout.
- Profile Management: Create, load, and edit supermarket profiles containing the product catalog and sales data.
- Shelf Management: Define the physical structure of supermarket shelves.
- Optimal Distribution Calculation: Automatically generate the best product layout using different algorithmic strategies.
- Similarity Analysis: Modify and consult the similarity matrix between products to refine cross-selling strategies.
- Result Visualization: Display the final distribution graphically and intuitively.
- Data Persistence: Save and load the application's state (profiles, shelves) for future use.
- Language: Java (JDK 22)
- UI: Java Swing for the desktop interface.
- Build System: Gradle for dependency management and task automation.
The project follows a Layered Architecture to separate responsibilities:
- Presentation Layer (UI): Swing views interacting with the user.
- Domain Layer: Contains business logic and core entities (Product, Profile, etc.).
- Persistence Layer: Handles reading and writing data to files.
- Controllers: Coordinate communication between layers to keep them as independent as possible.
The project also uses several interfaces to decouple the various calculation methods from the core code.
Follow these instructions to get a working copy of the project on your local machine.
- Install Java JDK 22.
- Install Git.
-
Clone the repository:
git clone <REPOSITORY-URL> cd PROP_Supermaket_manager
-
Build the project with Gradle:
On Windows:
./gradlew.bat build
On macOS/Linux:
./gradlew build
-
Run the application:
On Windows:
./gradlew.bat run
On macOS/Linux:
./gradlew run
To run the unit test suite and ensure everything works as expected:
On Windows:
./gradlew.bat testOn macOS/Linux:
./gradlew test.
├── DOCS/ # Project documentation: user manual, testing, etc.
├── EXE/ # .jar executables organized by class type (test, exceptions, etc.)
├── FONTS/ # Source code, including JUnit tests
├── JAVADOC/ # Documentation generated with JavaDoc
├── PERFILES/ # Saved profile data (.dat)
├── PRESTATGERIES/ # Shelf data (.dat)
├── build/ # Gradle-generated files
└── src/main/java/edu/upc/prop/clusterxx/
├── clases_dominio/ # Data models (Product, Profile)
├── controladores/ # Business and UI logic
├── controladores_persistencia/ # Logic for saving/loading data
├── controladores_presentacion/ # Graphical interface views
└── estrategias_calculo/ # Optimization algorithms
./gradlew run # Run the application
./gradlew test # Run tests
./gradlew build # Compile and build the project
./gradlew clean # Clean compiled files
./gradlew jar # Generate a .jar in build/libs (without dependencies)
./gradlew compileAllClasses # Compile all classes in /classes/java
./gradlew assembleDist # Create a complete distribution (.zip and .tar) for running without an IDEPROP Group 31.5 — Projecte de Programació, UPC
Professor: Carles Arnal (carles.arnal@upc.edu)
Group Members:
- Eric Díez Apolo (eric.diez@estudiantat.upc.edu)
- Pol Carnicer Gonzalez (pol.carnicer@estudiantat.upc.edu)
- Aleix Montero Ponce (aleix.montero@estudiantat.upc.edu)
- Francesc Pérez Venegas (francesc.perez.venegas@estudiantat.upc.edu)


