# otniel113/fuzzylogic_in_python architecture

> Architecture diagram of the GitHub repository otniel113/fuzzylogic_in_python, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/otniel113/fuzzylogic_in_python
- Repository: https://github.com/otniel113/fuzzylogic_in_python

## Overview

##### Project type and purpose
- This is a small data‐processing / algorithmic tool: a Python script (`fuzzylogic.py`) that reads an input Excel dataset of restaurants, applies a fuzzy logic inference chain, and writes out the top 10 rankings to an output Excel file.
- Supporting artifacts (PDF, PPTX) are documentation and not part of the runtime architecture.

##### File structure
Top‐level items:
- `fuzzylogic.py` – the single entry‐point script.
- Input data files: `Fuzzy Logic/restoran.xlsx`
- Output placeholder: `Fuzzy Logic/peringkat.xlsx`
- Documentation: `18_IF4305_1301180469.pdf`, `Fuzzy Logic.pptx`, `README.md`
No sub-services, no web or UI layer. It’s purely batch/CLI.

##### Extract architectural insights from the README
- Core stages: Data ingestion (Pandas), fuzzification, rule‐base inference (9 rules), Sugeno defuzzification, sorting/ranking, Excel export.
- External library: Pandas.

##### Main components and their interactions
A. Data Source (Excel)
B. Data Ingestion Module (Pandas loader)
C. Fuzzification Module (maps raw scores to membership values)
D. Rule Base & Inference Engine (9 fuzzy rules)
E. Defuzzification Module (Sugeno method)
F. Ranking Module (sort by defuzzified score)
G. Excel Writer (Pandas → `peringkat.xlsx`)
H. Python Runtime & Dependencies (annotate that Pandas is used)

- Excel → Ingestion
- Ingestion → Fuzzification
- Fuzzification → Inference (references Rule Base)
- Inference → Defuzzification
- Defuzzification → Ranking
- Ranking → Excel Writer → Output Excel

##### Architectural patterns / principles
- Pipeline (linear data flow)
- Modular separation of concerns: each stage is a distinct functional block.
- Rule‐based engine (for inference)
- Single-process, single-threaded batch job

##### Final checklist
[ ] All seven components (A–G plus H) are present
[ ] Rule base/inference stage explicitly called out
[ ] Output Excel file depicted as end point

## Diagram (Mermaid)

```mermaid
flowchart TD
    dataSource[(Input Excel<br/>restoran.xlsx)]:::data
    ingest["Data Ingestion<br/>(Pandas loader)"]:::process
    fuzz["Fuzzification"]:::process
    inference["Rule Base &<br/>Inference Engine"]:::process
    defuzz["Defuzzification<br/>(Sugeno method)"]:::process
    rank["Ranking Module"]:::process
    writer["Excel Writer"]:::process
    output[(Output Excel<br/>peringkat.xlsx)]:::data
    deps["Python Runtime &<br/>Dependencies<br/>(Pandas)"]:::dep

    dataSource -->|"reads raw scores"| ingest
    ingest -->|"DataFrame with id,pelayanan,makanan"| fuzz
    fuzz -->|"membership values"| inference
    inference -->|"fuzzy results"| defuzz
    defuzz -->|"defuzzified scores"| rank
    rank -->|"top 10 scores"| writer
    writer -->|"writes peringkat.xlsx"| output
    deps -.-> ingest

    click dataSource "https://github.com/otniel113/fuzzylogic_in_python/blob/main/Fuzzy Logic/restoran.xlsx"
    click ingest "https://github.com/otniel113/fuzzylogic_in_python/blob/main/Fuzzy Logic/fuzzylogic.py"
    click fuzz "https://github.com/otniel113/fuzzylogic_in_python/blob/main/Fuzzy Logic/fuzzylogic.py"
    click inference "https://github.com/otniel113/fuzzylogic_in_python/blob/main/Fuzzy Logic/fuzzylogic.py"
    click defuzz "https://github.com/otniel113/fuzzylogic_in_python/blob/main/Fuzzy Logic/fuzzylogic.py"
    click rank "https://github.com/otniel113/fuzzylogic_in_python/blob/main/Fuzzy Logic/fuzzylogic.py"
    click writer "https://github.com/otniel113/fuzzylogic_in_python/blob/main/Fuzzy Logic/fuzzylogic.py"
    click deps "https://github.com/otniel113/fuzzylogic_in_python/blob/main/README.md"

    classDef data fill:#D0E6FF,stroke:#000,stroke-width:1px
    classDef process fill:#D0FFD6,stroke:#000,stroke-width:1px
    classDef dep fill:#FFE0B2,stroke:#000,stroke-width:1px
```
