{"id":28287264,"url":"https://github.com/3bbaas/newspaper-seller-simulation-case-study","last_synced_at":"2026-02-25T23:06:11.897Z","repository":{"id":291586483,"uuid":"977329053","full_name":"3bbaas/Newspaper-Seller-Simulation-Case-Study","owner":"3bbaas","description":"Newspaper-Seller-Simulation-Case-Study","archived":false,"fork":false,"pushed_at":"2025-05-05T13:46:14.000Z","size":6678,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-18T04:38:50.567Z","etag":null,"topics":["case-study","modeling","newspaper-seller","simulation"],"latest_commit_sha":null,"homepage":"https://3bbaas.github.io/Newspaper-Seller-Simulation-Case-Study/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/3bbaas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-04T00:12:58.000Z","updated_at":"2025-05-07T07:48:01.000Z","dependencies_parsed_at":"2025-05-05T14:43:49.598Z","dependency_job_id":null,"html_url":"https://github.com/3bbaas/Newspaper-Seller-Simulation-Case-Study","commit_stats":null,"previous_names":["3bbaas/newspaper-selle-rsimulation-case-study"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/3bbaas/Newspaper-Seller-Simulation-Case-Study","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3bbaas%2FNewspaper-Seller-Simulation-Case-Study","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3bbaas%2FNewspaper-Seller-Simulation-Case-Study/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3bbaas%2FNewspaper-Seller-Simulation-Case-Study/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3bbaas%2FNewspaper-Seller-Simulation-Case-Study/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/3bbaas","download_url":"https://codeload.github.com/3bbaas/Newspaper-Seller-Simulation-Case-Study/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/3bbaas%2FNewspaper-Seller-Simulation-Case-Study/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29844845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T22:37:40.667Z","status":"ssl_error","status_checked_at":"2026-02-25T22:37:25.960Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["case-study","modeling","newspaper-seller","simulation"],"created_at":"2025-05-21T22:11:18.844Z","updated_at":"2026-02-25T23:06:11.890Z","avatar_url":"https://github.com/3bbaas.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Newspaper Seller Simulation Case Study\n\n## Description\n\nThis repository contains a case study project for the \"Modeling \u0026 Simulation\" subject. The primary objective is to determine the optimal number of newspapers a seller should purchase each day to maximize profits, considering daily demands classified as Good, Fair, or Poor days. The project includes a C++ console application for core simulations, a Python desktop GUI for user interaction, and comprehensive documentation in multiple formats.\n\n### Problem Overview\n\n- **Objective**: Maximize daily profit by determining the quantity of newspapers to purchase.\n- **Parameters**:\n  - Selling price per newspaper $(P)$: \\$ $0.50$\n  - Cost per newspaper $(C)$: \\$ $0.33$\n  - Scrap value per unsold newspaper $(S)$: \\$ $0.05$\n  - Daily demand $(d)$: Varies based on the type of day (Good, Fair, Poor)\n  - Quantity of newspapers purchased $(X)$\n- **Demand Distribution**: Possible demand values are $40, 50, 60, 70, 80, 90, 100$ newspapers, with probabilities depending on the day type.\n\n### Model Formulation\n\nThe model calculates daily profit based on the following equations:\n\n- Revenue from sales: $(\\min(d, X) \\times P)$\n- Excess demand: $\\max(X, d) - d$ (Note: This represents unsold newspapers, not excess demand in the standard sense)\n- Profit per newspaper: $P - C$\n- Lost profit: $\\text{excess demand} \\times (P - C)$\n- Number of scraps: $\\max(X, d) - d$ (Same as excess demand)\n- Salvage from scraps: $\\text{Number of scraps} \\times S$\n- Cost of daily newspapers: $X \\times C$\n- Daily Profit: $\\text{Revenue Sales} - \\text{Cost of daily newspapers} - \\text{lost Profit} + \\text{Salvage from scrap}$\n\n**Note**: The definition of \"excess demand\" and \"lost profit\" differs from the standard newsvendor model, where lost profit typically relates to unmet demand $\\max(d - X, 0) $. In this model, \"excess demand\" refers to unsold newspapers $\\max(X - d, 0)$, leading to a unique profit calculation: $(P - C) \\times \\min(d, X) + (S - P) \\times \\max(X - d, 0)$.\n\n## Project Structure\n\nThe repository is organized as follows:\n\n| Folder/File | Description |\n|-------------|-------------|\n| `Console App/` | Core C++ implementation |\n| \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;`main.cpp` | Entry point for the console application simulating the newspaper seller’s decision-making |\n| `Desktop-App/` | Python desktop GUI application |\n| \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;`main.py` | Entry point for the GUI application |\n| \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;`assets/` | Folder with GUI assets (e.g., images, icons) |\n| \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;`requirements.txt` | List of Python dependencies for the GUI |\n| `Docs/` | Documentation and modeling files |\n| \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;`Newspaper Seller Case Study.docx` | Word document with detailed project information |\n| \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;`Newspaper Seller Case Study.pdf` | PDF version of the project documentation |\n| \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;`Newspaper Seller Problem - Modeling Simulation.xlsx` | Excel spreadsheet for modeling and simulation |\n| HTML + CSS Documentation | A simple HTML + CSS documentation (e.g., `index.html`) available in the repository. Open with a web browser for interactive documentation |\n\n## How to Run\n\n### C++ Console Application\n\n1. Ensure a C++ compiler is installed (e.g., [g++](https://gcc.gnu.org/) for Linux/Mac, [Visual Studio](https://visualstudio.microsoft.com/) for Windows).\n2. Navigate to the `Console App/` directory.\n3. Compile `main.cpp`:\n   - For g++: `g++ main.cpp -o newspaper_simulation`\n   - For Visual Studio: Open `main.cpp` in Visual Studio and build the project.\n4. Run the executable:\n   - Linux/Mac: `./newspaper_simulation`\n   - Windows: `newspaper_simulation.exe`\n\n### Python Desktop GUI\n\n1. Ensure [Python](https://www.python.org/) is installed (check `requirements.txt` for the required version).\n2. Navigate to the `Desktop-App/` directory.\n3. Install dependencies: `pip install -r requirements.txt`\n4. Run the application: `python main.py`\n\n## Documentation\n\nDetailed information about the project, including the problem definition, assumptions, and model formulation, is available in the `Docs/` folder:\n\n- `Newspaper Seller Case Study.docx`: Comprehensive project details in Word format.\n- `Newspaper Seller Case Study.pdf`: PDF version for easy sharing and viewing.\n- `Newspaper Seller Problem - Modeling Simulation.xlsx`: Excel spreadsheet containing simulation data and modeling.\n\nAdditionally, an [online documentation](https://3bbaas.github.io/Newspaper-Selle-rSimulation-Case-Study/) is included in the repository. Locate the `index.html` file (or similar) and open it in a web browser for an interactive overview.\n\n## Team Members:\n- [Ahmed Abbas (Me)](https://github.com/3bbaas)\n- [Rokiya Abdelsattar](https://github.com/RokiyaAbdElsatar)\n- [Ahmed Ibrahim](https://github.com/jamika78)\n\n\n\u003ccenter\u003e\n  \u003cbr/\u003e\n  \n  \u003cp\u003eThat's all.\u003c/p\u003e\n\n\u003c/center\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3bbaas%2Fnewspaper-seller-simulation-case-study","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F3bbaas%2Fnewspaper-seller-simulation-case-study","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F3bbaas%2Fnewspaper-seller-simulation-case-study/lists"}