# sacrover/smart-mobility architecture

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

- Interactive diagram: https://gitdiagram.com/sacrover/smart-mobility
- Repository: https://github.com/sacrover/smart-mobility

## Overview

##### Project Type and Overall Purpose
- This is a multi-domain smart mobility repository with several demo projects for different mobility challenges:
a. Multi-Robot Task Allocation (MRTA): Focuses on solving task scheduling in warehouse environments using a modified Particle Swarm Optimization algorithm.
b. Car Sharing Service: Processes and analyses shared mobility data using bio-inspired algorithms with datasets provided in CSV files.
c. Geospatial Analysis: Uses notebooks and datasets (and even HTML visualizations) to study traffic volumes and urban mobility patterns in Toronto.
- The repository also includes shared dependencies (listed in requirements.txt) and media assets (images) to support these demos.

##### Component Analysis – What
a. High-Level Components:
- Multi-Robot Task Allocation Module:
- Input/Simulation data (from its own notebook, README, and possibly external parameter configuration).
- Core optimization algorithm (modified Particle Swarm Optimization).
- Output analysis (results regarding makespan, charge availability, load distribution).
- Car Sharing Service Module:
- Data ingestion components reading CSV files (origin, destination, depot, and trip matrices).
- Analysis and simulation of bio-inspired algorithms for the mobility problem.
- User interface or results via a Jupyter notebook (CarSharing.ipynb).
- Geospatial Analysis Module:
- Data ingestion from CSV files (traffic volume datasets, processed data).
- Analytical processes embedded in the notebook (Car_Traffic_Volume_Toronto.ipynb).
- Visualization outputs (HTML map and charts).
- Dependencies and Shared Resources:
- Shared requirements and environments (requirements.txt).
- Documentation (README files for both root and multi-robot module).

b. Interactions and Relationships:
- Although the three modules are independent in functionality, they share a common theme and some common dependencies.

##### Architectural Patterns & Design Principles
- Modular design: The repository separates each smart mobility problem into its own directory.
- Usage of Jupyter notebooks as prototyping and analysis tools.
- Reliance on bio-inspired algorithms (PSO and other potential evolutionary algorithms) for optimization and analysis.
- Clear separation of concerns – each directory holds its domain-specific logic and supporting data, while shared resources (dependencies, media) are centralized.

##### Final Detailed Steps
- Branch out three main nodes: “Multi-Robot Task Allocation,” “Car Sharing Service,” and “Geospatial Analysis.”
- For each branch, create sub-nodes for data ingestion, algorithm/process, and visualization/output.
- Dependencies (requirements.txt) to each branch illustrating that they rely on common libraries and packages.
- That the relationships are clear: for example, from “CSV Data” to “Jupyter Notebook Processing,” and then from that processing unit to “Generated Visualization (HTML/Images).”
- Don’t forget to annotate any additional configuration or documentation blocks that play a significant role in understanding the project (e.g., README files, media assets).

## Diagram (Mermaid)

```mermaid
flowchart TD
    REPO["Smart Mobility Projects Repository"]:::repo
    SH_Readme["Repository Documentation (README.md)"]:::shared
    SH_Deps["requirements.txt"]:::shared
    SH_Media["Media Assets"]:::shared

    %% Multi-Robot Task Allocation Module
    subgraph "Multi-Robot Task Allocation Module"
        MRTA_Header["Multi-Robot Task Allocation"]:::module
        MRTA_Input1["mrta.ipynb"]:::data
        MRTA_Input2["README (MRTA)"]:::data
        MRTA_Process["Multi-Robot Optimization Engine (ModifiedPSO)"]:::process
        MRTA_Output["Output Analysis (Makespan,Charge,Load)"]:::output
    end

    %% Car Sharing Service Module
    subgraph "Car Sharing Service Module"
        CS_Header["Car Sharing Service"]:::module
        CS_Data["Data Ingestion (CSV Files)"]:::data
        CSV1["carshare_depot.csv"]:::data
        CSV2["carshare_dest.csv"]:::data
        CSV3["carshare_origin.csv"]:::data
        CSV4["trip_matrix.csv"]:::data
        CS_Process["CarSharing.ipynb (Bio-inspiredAlgorithm)"]:::process
        CS_Output["Results Notebook & Visual Output"]:::output
    end

    %% Geospatial Analysis Module
    subgraph "Geospatial Analysis Module"
        GA_Header["Geospatial Analysis"]:::module
        GA_Data["Data Ingestion"]:::data
        Data_CSV["CTV2019_Processed.csv (Data Folder)"]:::data
        GA_Process["Traffic Analysis (Car_Traffic_Volume_Toronto.ipynb)"]:::process
        GA_Output["Visualization (Car_Traffic_Volume_Toronto.html)"]:::output
    end

    %% Connections from Repository to Modules and Documentation
    REPO --> MRTA_Header
    REPO --> CS_Header
    REPO --> GA_Header
    SH_Readme --> REPO

    %% Multi-Robot Module flow
    MRTA_Header --> MRTA_Input1
    MRTA_Header --> MRTA_Input2
    MRTA_Input1 --> MRTA_Process
    MRTA_Input2 --> MRTA_Process
    MRTA_Process --> MRTA_Output

    %% Car Sharing Module flow
    CS_Header --> CS_Data
    CS_Data --> CSV1
    CS_Data --> CSV2
    CS_Data --> CSV3
    CS_Data --> CSV4
    CS_Data --> CS_Process
    CS_Process --> CS_Output

    %% Geospatial Module flow
    GA_Header --> GA_Data
    GA_Data --> Data_CSV
    Data_CSV --> GA_Process
    GA_Process --> GA_Output

    %% Shared Dependencies and Assets attached to processing and output stages
    SH_Deps --- MRTA_Process
    SH_Deps --- CS_Process
    SH_Deps --- GA_Process

    SH_Media --- MRTA_Output
    SH_Media --- CS_Output
    SH_Media --- GA_Output

    %% Click Events for Component Mapping
    click MRTA_Header "https://github.com/sacrover/smart-mobility/tree/main/multi-robot-task-allocation/"
    click MRTA_Input1 "https://github.com/sacrover/smart-mobility/blob/main/multi-robot-task-allocation/mrta.ipynb"
    click MRTA_Input2 "https://github.com/sacrover/smart-mobility/blob/main/multi-robot-task-allocation/README.md"

    click CS_Header "https://github.com/sacrover/smart-mobility/tree/main/car-sharing-service/"
    click CSV1 "https://github.com/sacrover/smart-mobility/blob/main/car-sharing-service/carshare_depot.csv"
    click CSV2 "https://github.com/sacrover/smart-mobility/blob/main/car-sharing-service/carshare_dest.csv"
    click CSV3 "https://github.com/sacrover/smart-mobility/blob/main/car-sharing-service/carshare_origin.csv"
    click CSV4 "https://github.com/sacrover/smart-mobility/blob/main/car-sharing-service/trip_matrix.csv"
    click CS_Process "https://github.com/sacrover/smart-mobility/blob/main/car-sharing-service/CarSharing.ipynb"

    click GA_Header "https://github.com/sacrover/smart-mobility/tree/main/geospatial-analysis/"
    click GA_Process "https://github.com/sacrover/smart-mobility/blob/main/geospatial-analysis/Car_Traffic_Volume_Toronto.ipynb"
    click GA_Output "https://github.com/sacrover/smart-mobility/blob/main/geospatial-analysis/Car_Traffic_Volume_Toronto.html"
    click Data_CSV "https://github.com/sacrover/smart-mobility/tree/main/geospatial-analysis/Data/"

    click SH_Deps "https://github.com/sacrover/smart-mobility/blob/main/requirements.txt"
    click SH_Media "https://github.com/sacrover/smart-mobility/tree/main/media/"
    click SH_Readme "https://github.com/sacrover/smart-mobility/blob/main/README.md"

    %% Class Definitions for styling with colors
    classDef repo fill:#AC92EC,stroke:#333,stroke-width:2px;
    classDef module fill:#FFCE54,stroke:#333,stroke-width:2px;
    classDef data fill:#F9D162,stroke:#333,stroke-width:2px;
    classDef process fill:#A0D468,stroke:#333,stroke-width:2px;
    classDef output fill:#4FC1E9,stroke:#333,stroke-width:2px;
    classDef shared fill:#ED5565,stroke:#333,stroke-width:2px;
```
