File size: 2,155 Bytes
110eb15
 
 
 
 
68ed193
 
 
110eb15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68ed193
110eb15
 
 
 
 
68ed193
110eb15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68ed193
110eb15
 
 
 
 
 
 
44cdbab
110eb15
 
44cdbab
 
110eb15
68ed193
110eb15
 
44cdbab
 
110eb15
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Dự án Algorithm Testing - Đang Chạy

## Trạng Thái Hiện Tại

### ✅ Backend (FastAPI) - ĐANG CHẠY
- **URL**: http://localhost:8000
- **API Docs**: http://localhost:8000/docs  
- **Health**: http://localhost:8000/health
- **Trạng thái**: Application startup complete

### ✅ Frontend (Streamlit) - ĐANG CHẠY
- **URL**: http://localhost:8502
- **Trạng thái**: Ready to use
- **Network**: http://192.168.2.9:8502

## Cách Sử Dụng

### Bước 1: Mở Streamlit UI
Truy cập: http://localhost:8502

### Bước 2: Cấu hình Parameters (Sidebar)
- Min Spacing: 20m
- Max Spacing: 30m  
- Angle Range: 0-90°
- Lot Width: 5-8m
- Population: 50
- Generations: 100

### Bước 3: Input Tab
Chọn **"Use Sample Data"** để test nhanh

### Bước 4: Run Optimization Tab
Nhấn **"🚀 Run Full Pipeline"**

Chờ 30-60 giây để thuật toán chạy.

### Bước 5: Results Tab
Xem kết quả:
- Summary statistics
- Stage 1: Grid Optimization visualization
- Stage 2: Block Subdivision visualization
- Download GeoJSON results

## Ghi Chú Kỹ Thuật

### Ports Sử Dụng
- Backend: 8000 (default port)
- Frontend: 8502 (tránh conflict với service trên 8501)

### Đã Fix
1. Import errors (relative → absolute imports)
2. Folium version conflict (0.15.1 → 0.14.0)
3. Port configuration trong frontend (8001 → 8000)

### Dependencies Installed
**Backend**:
- FastAPI 0.104.1
- DEAP 1.4.1
- OR-Tools 9.8.3296
- Shapely 2.0.2

**Frontend**:
- Streamlit 1.29.0
- Plotly 5.18.0
- Pandas 2.1.4

## Dừng Services

```bash
# Tìm và kill backend process
lsof -i :8000
kill -9 <PID>

# Tìm và kill frontend process
lsof -i :8502
kill -9 <PID>
```

# Restart Services

# Terminal 1: Backend
# Kill existing backend process
lsof -i :8000 | awk 'NR!=1 {print $2}' | xargs kill -9
cd /Volumes/WorkSpace/Project/REMB/algorithms/backend
../../venv/bin/uvicorn main:app --reload --port 8000

# Terminal 2: Frontend
# Kill existing frontend process
lsof -i :8502 | awk 'NR!=1 {print $2}' | xargs kill -9
cd /Volumes/WorkSpace/Project/REMB/algorithms/frontend
../../venv/bin/streamlit run app.py --server.port 8502