38980-vm/app-9w9pd00g5j41/FLOW_DIAGRAM.md
2026-03-04 18:25:09 +00:00

341 lines
20 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Analyze-Trip Enhancement - Flow Diagram
## πŸ”„ Processing Flow
```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ INPUT: Trip Request β”‚
β”‚ { destination, days: [{ date, places: [...] }], travelers } β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ STEP 1: Analyze Trip Metrics β”‚
β”‚ β”‚
β”‚ For each day: β”‚
β”‚ For each place: β”‚
β”‚ βœ“ Calculate distance from previous place (Haversine) β”‚
β”‚ βœ“ Estimate travel time (distance Γ· 40 km/h) β”‚
β”‚ βœ“ Parse visit duration ("2 hours" β†’ 120 min) β”‚
β”‚ β”‚
β”‚ Calculate daily totals: β”‚
β”‚ βœ“ Total distance (sum of all distances) β”‚
β”‚ βœ“ Total travel time (sum of all travel times) β”‚
β”‚ βœ“ Total visit time (sum of all visit durations) β”‚
β”‚ βœ“ Total time (travel + visit) β”‚
β”‚ β”‚
β”‚ Calculate density score: β”‚
β”‚ density = (distance_km Γ— 5 + time_hours Γ— 10) Γ· places β”‚
β”‚ β”‚
β”‚ Determine density level: β”‚
β”‚ <20: low, 20-35: moderate, 35-50: high, β‰₯50: very_high β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ STEP 2: Calculate Overall Metrics β”‚
β”‚ β”‚
β”‚ βœ“ Total days β”‚
β”‚ βœ“ Total places (across all days) β”‚
β”‚ βœ“ Total distance (sum of all daily distances) β”‚
β”‚ βœ“ Total time (sum of all daily times) β”‚
β”‚ βœ“ Average density score (mean of daily scores) β”‚
β”‚ βœ“ Maximum density score (highest daily score) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ STEP 3: Identify Decision Factors β”‚
β”‚ β”‚
β”‚ Analyze and record factors: β”‚
β”‚ β”‚
β”‚ βœ“ Density Level (PRIMARY FACTOR) β”‚
β”‚ - Very High (β‰₯50): Strong positive impact β”‚
β”‚ - High (35-50): Positive impact β”‚
β”‚ - Moderate (20-35): Neutral impact β”‚
β”‚ - Low (<20): Negative impact β”‚
β”‚ β”‚
β”‚ βœ“ Total Distance β”‚
β”‚ - >100km: Positive impact β”‚
β”‚ - 50-100km: Neutral impact β”‚
β”‚ β”‚
β”‚ βœ“ Time Commitment β”‚
β”‚ - >8h/day: Positive impact β”‚
β”‚ β”‚
β”‚ βœ“ Group Size β”‚
β”‚ - β‰₯4 travelers: Positive impact β”‚
β”‚ - 1 traveler: Neutral impact β”‚
β”‚ β”‚
β”‚ βœ“ Place Count β”‚
β”‚ - β‰₯5 places/day: Positive impact β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ STEP 4: Match Daily Tours β”‚
β”‚ β”‚
β”‚ Query database for active daily tours in region β”‚
β”‚ β”‚
β”‚ For each tour: β”‚
β”‚ βœ“ Extract place types from trip β”‚
β”‚ βœ“ Compare with tour's related_place_types β”‚
β”‚ βœ“ Calculate overlap score β”‚
β”‚ β”‚
β”‚ Select best match (highest score β‰₯0.3) β”‚
β”‚ β”‚
β”‚ If match found: β”‚
β”‚ β†’ Generate tour-specific reasoning β”‚
β”‚ β†’ Boost confidence based on density score β”‚
β”‚ β†’ Return recommendation with tour slug β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
↓
Match Found?
↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ β”‚
YES NO
β”‚ β”‚
↓ ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Return with Tour β”‚ β”‚ Check Fallback β”‚
β”‚ Recommendation β”‚ β”‚ (4+ travelers) β”‚
β”‚ + Debug Info β”‚ β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ β”‚
YES NO
β”‚ β”‚
↓ ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Suggest Private β”‚ β”‚ Check Minimum β”‚
β”‚ Guide β”‚ β”‚ Criteria β”‚
β”‚ + Debug Info β”‚ β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”
β”‚ β”‚
PASS FAIL
β”‚ β”‚
↓ ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Call AI for β”‚ β”‚ Return No β”‚
β”‚ Analysis β”‚ β”‚ Recommend β”‚
β”‚ β”‚ β”‚ + Debug Info β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ AI analyzes β”‚
β”‚ with density β”‚
β”‚ metrics β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Return AI β”‚
β”‚ Recommendation β”‚
β”‚ + Debug Info β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```
---
## πŸ“Š Density Score Calculation Detail
```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ DENSITY SCORE CALCULATION β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Input:
- totalDistanceKm: 85.0
- totalTimeMinutes: 518
- placeCount: 5
Step 1: Convert time to hours
totalTimeHours = 518 Γ· 60 = 8.63
Step 2: Apply formula
density = (distance Γ— 5 + time Γ— 10) Γ· places
density = (85.0 Γ— 5 + 8.63 Γ— 10) Γ· 5
density = (425 + 86.3) Γ· 5
density = 511.3 Γ· 5
density = 102.26
Step 3: Determine level
102.26 β‰₯ 50 β†’ VERY HIGH
Step 4: Calculate confidence
confidence = 0.85 + (102.26 - 50) Γ· 100
confidence = 0.85 + 0.52
confidence = 1.37 β†’ capped at 1.0
confidence = 1.0
Result:
βœ“ Density Score: 102.26
βœ“ Density Level: VERY HIGH
βœ“ Recommendation: HIGHLY RECOMMEND
βœ“ Confidence: 1.0 (100%)
```
---
## 🎯 Decision Tree
```
Start Analysis
β”‚
↓
Calculate Density Score
β”‚
↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ β”‚
Score β‰₯ 50 Score < 50
β”‚ β”‚
↓ ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”
β”‚ VERY HIGH β”‚ β”‚ β”‚
β”‚ Confidence: β”‚ β”‚ Score β‰₯ 35β”‚
β”‚ 0.85-1.0 β”‚ β”‚ β”‚
β”‚ β”‚ ↓ ↓
β”‚ Highly β”‚ β”Œβ”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Recommend β”‚ β”‚HIGH β”‚ β”‚Scoreβ‰₯20 β”‚
β”‚ Tour β”‚ β”‚0.70-β”‚ β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚0.85 β”‚ ↓ ↓
β”‚ β”‚ β”Œβ”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”
β”‚Rec β”‚ β”‚MOD β”‚ β”‚ LOW β”‚
β”‚Tour β”‚ β”‚0.50β”‚ β”‚<0.50 β”‚
β””β”€β”€β”€β”€β”€β”˜ β”‚- β”‚ β”‚ β”‚
β”‚0.70β”‚ β”‚Don't β”‚
β”‚ β”‚ β”‚Rec β”‚
β”‚Opt β”‚ β””β”€β”€β”€β”€β”€β”€β”˜
β”‚Tourβ”‚
β””β”€β”€β”€β”€β”˜
Legend:
β–  VERY HIGH (β‰₯50): πŸ”₯ Highly Recommend (0.85-1.0)
β–  HIGH (35-50): ⭐ Recommend (0.70-0.85)
β–  MODERATE (20-35): ⚠️ Optional (0.50-0.70)
β–  LOW (<20): ❌ Don't Recommend (<0.50)
```
---
## πŸ” Debug Info Structure
```
debug_info
β”œβ”€β”€ dailyMetrics[]
β”‚ β”œβ”€β”€ dayNumber
β”‚ β”œβ”€β”€ date
β”‚ β”œβ”€β”€ totalPlaces
β”‚ β”œβ”€β”€ totalDistanceKm
β”‚ β”œβ”€β”€ totalTravelTimeMinutes
β”‚ β”œβ”€β”€ totalVisitTimeMinutes
β”‚ β”œβ”€β”€ totalTimeMinutes
β”‚ β”œβ”€β”€ densityScore
β”‚ β”œβ”€β”€ densityLevel
β”‚ └── places[]
β”‚ β”œβ”€β”€ name
β”‚ β”œβ”€β”€ type
β”‚ β”œβ”€β”€ lat, lng
β”‚ β”œβ”€β”€ distanceFromPreviousKm
β”‚ β”œβ”€β”€ travelTimeFromPreviousMinutes
β”‚ └── visitDurationMinutes
β”‚
β”œβ”€β”€ overallMetrics
β”‚ β”œβ”€β”€ totalDays
β”‚ β”œβ”€β”€ totalPlaces
β”‚ β”œβ”€β”€ totalDistanceKm
β”‚ β”œβ”€β”€ totalTimeHours
β”‚ β”œβ”€β”€ averageDensityScore
β”‚ └── maxDensityScore
β”‚
β”œβ”€β”€ decisionFactors[]
β”‚ β”œβ”€β”€ factor (name)
β”‚ β”œβ”€β”€ value (numeric or string)
β”‚ β”œβ”€β”€ impact (positive/negative/neutral)
β”‚ └── reasoning (explanation)
β”‚
└── recommendation_reasoning (summary)
```
---
## πŸ“ˆ Confidence Calculation Flow
```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ CONFIDENCE CALCULATION ALGORITHM β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Input: maxDensityScore
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ IF maxDensityScore β‰₯ 50 β”‚
β”‚ confidence = 0.85 + (maxDensityScore - 50) / 100 β”‚
β”‚ range: [0.85, 1.0] β”‚
β”‚ recommendation: HIGHLY RECOMMEND β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ELSE IF maxDensityScore β‰₯ 35 β”‚
β”‚ confidence = 0.70 + (maxDensityScore - 35) / 100 β”‚
β”‚ range: [0.70, 0.85) β”‚
β”‚ recommendation: RECOMMEND β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ELSE IF maxDensityScore β‰₯ 20 β”‚
β”‚ confidence = 0.50 + (maxDensityScore - 20) / 100 β”‚
β”‚ range: [0.50, 0.70) β”‚
β”‚ recommendation: OPTIONAL β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ELSE (maxDensityScore < 20) β”‚
β”‚ confidence = maxDensityScore / 40 β”‚
β”‚ range: [0.0, 0.50) β”‚
β”‚ recommendation: DON'T RECOMMEND β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ IF confidence < 0.6 β”‚
β”‚ recommend = false β”‚
β”‚ (Override any previous recommendation) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Examples:
Score 102.26 β†’ confidence = 0.85 + 52.26/100 = 1.37 β†’ capped at 1.0
Score 42.8 β†’ confidence = 0.70 + 7.8/100 = 0.778
Score 28.5 β†’ confidence = 0.50 + 8.5/100 = 0.585
Score 15.2 β†’ confidence = 15.2/40 = 0.38 β†’ recommend = false
```
---
## 🎨 Visual Density Scale
```
DENSITY SCORE VISUALIZATION
0 ────────── 20 ────────── 35 ────────── 50 ────────── 100+
β”‚ β”‚ β”‚ β”‚ β”‚
β”‚ LOW β”‚ MODERATE β”‚ HIGH β”‚ VERY HIGH β”‚
β”‚ β”‚ β”‚ β”‚ β”‚
β”‚ βœ… Self β”‚ ⚠️ Optional β”‚ ⭐ Recommendβ”‚ πŸ”₯ Highly β”‚
β”‚ Plan β”‚ Tour β”‚ Tour β”‚ Recommend β”‚
β”‚ β”‚ β”‚ β”‚ β”‚
β”‚ Confidence β”‚ Confidence β”‚ Confidence β”‚ Confidence β”‚
β”‚ 0.0-0.48 β”‚ 0.50-0.70 β”‚ 0.70-0.85 β”‚ 0.85-1.0 β”‚
β”‚ β”‚ β”‚ β”‚ β”‚
β”‚ Examples: β”‚ Examples: β”‚ Examples: β”‚ Examples: β”‚
β”‚ β€’ 2 nearby β”‚ β€’ 4 places β”‚ β€’ 5 places β”‚ β€’ 4 places β”‚
β”‚ places β”‚ 45km β”‚ 85km β”‚ 90km β”‚
β”‚ β€’ 15km β”‚ β€’ 6 hours β”‚ β€’ 8.5 hours β”‚ β€’ 9+ hours β”‚
β”‚ β€’ 4 hours β”‚ β”‚ β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
```
---
**Status**: βœ… Deployed and Active
**Version**: 2.0 (Enhanced)
**Date**: February 7, 2024