# edubu2/hotel-revman-system architecture

> Architecture diagram of the GitHub repository edubu2/hotel-revman-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/edubu2/hotel-revman-system
- Repository: https://github.com/edubu2/hotel-revman-system

## Overview

This repository is a research prototype for hotel revenue management: it turns reservation history into cancellation-aware booking simulations, derives demand-model features, estimates remaining transient demand, and recommends rates for display. The main workflow is supported by the README and sampled source references. Several notebooks and intermediate data-generation steps were not inspected, so links to those are omitted rather than inferred.

Main entry points: [`code/app/st_practice.py`](https://github.com/edubu2/hotel-revman-system/blob/main/code/app/st_practice.py) (Rate recommendation display), [`code/model_cancellations.py`](https://github.com/edubu2/hotel-revman-system/blob/main/code/model_cancellations.py) (Cancellation prediction), [`code/sim.py`](https://github.com/edubu2/hotel-revman-system/blob/main/code/sim.py) (Booking simulation), [`code/app/app_funcs.py`](https://github.com/edubu2/hotel-revman-system/blob/main/code/app/app_funcs.py) (Pricing data loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Reservation preparation"]
  node_prepare["Reservation preparation<br/>[dbds.py]"]
  node_daily_stats["Daily hotel statistics<br/>[dbds.py]"]
  node_cancel_features["Cancellation features<br/>[features.py]"]
end

subgraph group_simulation["Booking simulation"]
  node_cancel_model["Cancellation prediction"]
  node_model_tools["Threshold evaluation<br/>[model_tools.py]"]
  node_simulation_run["Booking simulation<br/>[sim.py]"]
  node_simulation_utils["Simulation utilities<br/>[sim_utils.py]"]
  node_saved_sims["Saved simulations<br/>[save_sims.py]"]
end

subgraph group_modeling["Demand and pricing"]
  node_aggregate["Simulation aggregation<br/>[agg.py]"]
  node_aggregate_utils["Aggregation definitions<br/>[agg_utils.py]"]
  node_demand_features["Demand features<br/>[demand_features.py]"]
  node_demand_model["Demand and rate optimization<br/>[demand.py]"]
end

subgraph group_presentation["Rate display"]
  node_pricing_loader["Pricing data loader<br/>[app_funcs.py]"]
  node_display_columns["Display configuration<br/>[app_utils.py]"]
  node_rate_app["Rate recommendation display<br/>[st_practice.py]"]
end

node_analyst(("Analyst"))
node_reservation_data["Hotel reservations<br/>[H1.csv]"]
node_pricing_results["Pricing results"]

node_analyst -->|"views rates"| node_rate_app
node_reservation_data -->|"loads reservations"| node_prepare
node_prepare -->|"builds nightly stats"| node_daily_stats
node_cancel_model -->|"uses features"| node_cancel_features
node_cancel_model -->|"optimizes threshold"| node_model_tools
node_simulation_run -->|"predicts cancellations"| node_cancel_model
node_simulation_run -->|"uses utilities"| node_simulation_utils
node_saved_sims -->|"runs simulations"| node_simulation_run
node_aggregate -->|"uses definitions"| node_aggregate_utils
node_demand_model -->|"uses feature sets"| node_demand_features
node_pricing_results -->|"reads pricing data"| node_pricing_loader
node_pricing_loader -->|"selects columns"| node_display_columns
node_rate_app -->|"loads rates"| node_pricing_loader
node_rate_app -->|"uses display sets"| node_display_columns

click node_reservation_data "https://github.com/edubu2/hotel-revman-system/blob/main/data/H1.csv"
click node_prepare "https://github.com/edubu2/hotel-revman-system/blob/main/code/dbds.py"
click node_daily_stats "https://github.com/edubu2/hotel-revman-system/blob/main/code/dbds.py"
click node_cancel_features "https://github.com/edubu2/hotel-revman-system/blob/main/code/features.py"
click node_cancel_model "https://github.com/edubu2/hotel-revman-system/blob/main/code/model_cancellations.py"
click node_model_tools "https://github.com/edubu2/hotel-revman-system/blob/main/code/model_tools.py"
click node_simulation_run "https://github.com/edubu2/hotel-revman-system/blob/main/code/sim.py"
click node_simulation_utils "https://github.com/edubu2/hotel-revman-system/blob/main/code/sim_utils.py"
click node_saved_sims "https://github.com/edubu2/hotel-revman-system/blob/main/code/save_sims.py"
click node_aggregate "https://github.com/edubu2/hotel-revman-system/blob/main/code/agg.py"
click node_aggregate_utils "https://github.com/edubu2/hotel-revman-system/blob/main/code/agg_utils.py"
click node_demand_features "https://github.com/edubu2/hotel-revman-system/blob/main/code/demand_features.py"
click node_demand_model "https://github.com/edubu2/hotel-revman-system/blob/main/code/demand.py"
click node_pricing_loader "https://github.com/edubu2/hotel-revman-system/blob/main/code/app/app_funcs.py"
click node_display_columns "https://github.com/edubu2/hotel-revman-system/blob/main/code/app/app_utils.py"
click node_rate_app "https://github.com/edubu2/hotel-revman-system/blob/main/code/app/st_practice.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_prepare,node_daily_stats,node_cancel_features toneBlue
class node_cancel_model,node_model_tools,node_simulation_run,node_simulation_utils,node_saved_sims toneAmber
class node_aggregate,node_aggregate_utils,node_demand_features,node_demand_model toneMint
class node_pricing_loader,node_display_columns,node_rate_app toneRose
class node_analyst,node_pricing_results toneIndigo
class node_reservation_data toneTeal
```

## Components

### Reservation preparation

- [Reservation preparation](https://github.com/edubu2/hotel-revman-system/blob/main/code/dbds.py): `code/dbds.py`
- [Daily hotel statistics](https://github.com/edubu2/hotel-revman-system/blob/main/code/dbds.py): `code/dbds.py`
- [Cancellation features](https://github.com/edubu2/hotel-revman-system/blob/main/code/features.py): `code/features.py`

### Booking simulation

- [Cancellation prediction](https://github.com/edubu2/hotel-revman-system/blob/main/code/model_cancellations.py): `code/model_cancellations.py`
- [Threshold evaluation](https://github.com/edubu2/hotel-revman-system/blob/main/code/model_tools.py): `code/model_tools.py`
- [Booking simulation](https://github.com/edubu2/hotel-revman-system/blob/main/code/sim.py): `code/sim.py`
- [Simulation utilities](https://github.com/edubu2/hotel-revman-system/blob/main/code/sim_utils.py): `code/sim_utils.py`
- [Saved simulations](https://github.com/edubu2/hotel-revman-system/blob/main/code/save_sims.py): `code/save_sims.py`

### Demand and pricing

- [Simulation aggregation](https://github.com/edubu2/hotel-revman-system/blob/main/code/agg.py): `code/agg.py`
- [Aggregation definitions](https://github.com/edubu2/hotel-revman-system/blob/main/code/agg_utils.py): `code/agg_utils.py`
- [Demand features](https://github.com/edubu2/hotel-revman-system/blob/main/code/demand_features.py): `code/demand_features.py`
- [Demand and rate optimization](https://github.com/edubu2/hotel-revman-system/blob/main/code/demand.py): `code/demand.py`

### Rate display

- [Pricing data loader](https://github.com/edubu2/hotel-revman-system/blob/main/code/app/app_funcs.py): `code/app/app_funcs.py`
- [Display configuration](https://github.com/edubu2/hotel-revman-system/blob/main/code/app/app_utils.py): `code/app/app_utils.py`
- [Rate recommendation display](https://github.com/edubu2/hotel-revman-system/blob/main/code/app/st_practice.py): `code/app/st_practice.py`

### Other components

- **Analyst**
- [Hotel reservations](https://github.com/edubu2/hotel-revman-system/blob/main/data/H1.csv): `data/H1.csv`
- **Pricing results**

## Connections

- Analyst → Rate recommendation display: views rates (evidence: `code/app/st_practice.py`)
- Hotel reservations → Reservation preparation: loads reservations (evidence: `code/dbds.py`)
- Reservation preparation → Daily hotel statistics: builds nightly stats (evidence: `code/dbds.py`)
- Cancellation prediction → Cancellation features: uses features (evidence: `code/model_cancellations.py`)
- Cancellation prediction → Threshold evaluation: optimizes threshold (evidence: `code/model_cancellations.py`)
- Booking simulation → Cancellation prediction: predicts cancellations (evidence: `code/sim.py`)
- Booking simulation → Simulation utilities: uses utilities (evidence: `code/sim.py`)
- Saved simulations → Booking simulation: runs simulations (evidence: `code/save_sims.py`)
- Simulation aggregation → Aggregation definitions: uses definitions (evidence: `code/agg.py`)
- Demand and rate optimization → Demand features: uses feature sets (evidence: `code/demand.py`)
- Pricing results → Pricing data loader: reads pricing data (evidence: `code/app/app_funcs.py`)
- Pricing data loader → Display configuration: selects columns (evidence: `code/app/app_funcs.py`)
- Rate recommendation display → Pricing data loader: loads rates (evidence: `code/app/st_practice.py`)
- Rate recommendation display → Display configuration: uses display sets (evidence: `code/app/st_practice.py`)
