Skip to content

Commit 75bf102

Browse files
version 2
WebConference
1 parent 75095e8 commit 75bf102

83 files changed

Lines changed: 26276 additions & 237832 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 47 additions & 193 deletions
Original file line numberDiff line numberDiff line change
@@ -1,215 +1,69 @@
1-
# Manhattan Power Grid - Environment Configuration Template
2-
# Copy this file to .env and update with your settings
1+
# ==============================================
2+
# Manhattan Power Grid Co-Simulation
3+
# Environment Configuration Template
4+
# ==============================================
35

4-
# =============================================================================
5-
# Flask Application Settings
6-
# =============================================================================
7-
8-
# Environment: development, production, testing
6+
# Flask Configuration
7+
FLASK_APP=main_complete_integration.py
98
FLASK_ENV=development
10-
11-
# Enable debug mode (set to False in production)
129
FLASK_DEBUG=True
13-
14-
# Secret key for session management (generate a secure key for production)
1510
SECRET_KEY=your-secret-key-here-change-in-production
1611

17-
# Application host and port
18-
FLASK_HOST=0.0.0.0
19-
FLASK_PORT=5000
20-
21-
# =============================================================================
22-
# Database Configuration
23-
# =============================================================================
24-
25-
# Database URL (SQLite for development, PostgreSQL for production)
26-
DATABASE_URL=sqlite:///manhattan_grid.db
27-
28-
# Production PostgreSQL example:
29-
# DATABASE_URL=postgresql://username:password@localhost:5432/manhattan_grid
12+
# Server Configuration
13+
HOST=0.0.0.0
14+
PORT=5000
3015

31-
# Database connection pool settings
32-
DB_POOL_SIZE=10
33-
DB_MAX_OVERFLOW=20
34-
35-
# =============================================================================
36-
# SUMO Traffic Simulation
37-
# =============================================================================
38-
39-
# SUMO installation directory (required for vehicle simulation)
16+
# SUMO Configuration
4017
SUMO_HOME=/path/to/sumo
18+
# Windows example: C:\Program Files (x86)\Eclipse\Sumo
19+
# Linux example: /usr/share/sumo
20+
# macOS example: /usr/local/opt/sumo/share/sumo
4121

42-
# Windows example:
43-
# SUMO_HOME=C:\Program Files (x86)\Eclipse\Sumo
44-
45-
# Linux example:
46-
# SUMO_HOME=/usr/share/sumo
47-
48-
# macOS example:
49-
# SUMO_HOME=/opt/homebrew/share/sumo
50-
51-
# SUMO configuration
52-
SUMO_GUI=False
53-
SUMO_STEP_LENGTH=1.0
54-
SUMO_BEGIN_TIME=0
55-
SUMO_END_TIME=3600
56-
57-
# =============================================================================
58-
# Power Grid Simulation
59-
# =============================================================================
60-
61-
# Grid update interval (seconds)
62-
GRID_UPDATE_INTERVAL=5
63-
64-
# Power flow analysis settings
65-
POWER_FLOW_SOLVER=pandapower
66-
VOLTAGE_TOLERANCE=0.05
67-
FREQUENCY_TOLERANCE=0.1
68-
69-
# =============================================================================
70-
# Vehicle-to-Grid (V2G) Settings
71-
# =============================================================================
72-
73-
# V2G system enable/disable
74-
V2G_ENABLED=True
75-
76-
# Default V2G power rating per vehicle (kW)
77-
V2G_POWER_RATING=250
78-
79-
# Energy pricing ($/kWh)
80-
V2G_ENERGY_PRICE=0.15
81-
82-
# V2G activation threshold (percentage of substation capacity)
83-
V2G_ACTIVATION_THRESHOLD=90
84-
85-
# =============================================================================
86-
# Machine Learning & AI
87-
# =============================================================================
88-
89-
# OpenAI API key for AI chatbot (optional)
22+
# OpenAI API Configuration (for LLM features)
9023
OPENAI_API_KEY=your-openai-api-key-here
24+
# Get your API key from: https://platform.openai.com/api-keys
9125

92-
# OpenAI model configuration
93-
OPENAI_MODEL=gpt-3.5-turbo
94-
OPENAI_MAX_TOKENS=1000
95-
OPENAI_TEMPERATURE=0.7
26+
# Database Configuration (if using PostgreSQL)
27+
DATABASE_URL=sqlite:///cosim.db
28+
# PostgreSQL example: postgresql://user:password@localhost:5432/cosim_db
9629

97-
# ML model training settings
98-
ML_RETRAIN_INTERVAL=3600
99-
ML_BATCH_SIZE=32
100-
ML_LEARNING_RATE=0.001
30+
# Grid Configuration
31+
DEFAULT_VEHICLE_COUNT=10
32+
DEFAULT_EV_PERCENTAGE=0.7
33+
DEFAULT_BATTERY_MIN_SOC=0.2
34+
DEFAULT_BATTERY_MAX_SOC=0.9
10135

102-
# =============================================================================
103-
# External Services
104-
# =============================================================================
36+
# V2G Configuration
37+
V2G_POWER_RATE=50 # kW per vehicle
38+
V2G_MARKET_PRICE=0.15 # USD per kWh
39+
V2G_EMERGENCY_MULTIPLIER=50 # Price multiplier during emergencies
10540

106-
# Mapbox access token for enhanced mapping (optional)
107-
MAPBOX_ACCESS_TOKEN=your-mapbox-token-here
41+
# Simulation Parameters
42+
SIMULATION_STEP=0.1 # SUMO step time in seconds
43+
GRID_UPDATE_INTERVAL=5 # Power grid update interval in seconds
44+
VISUALIZATION_UPDATE_RATE=1 # WebSocket update rate in seconds
10845

109-
# Weather API configuration (optional)
110-
WEATHER_API_KEY=your-weather-api-key
111-
WEATHER_UPDATE_INTERVAL=1800
46+
# Mapbox Configuration (for web interface)
47+
MAPBOX_TOKEN=your-mapbox-token-here
48+
# Get a token from: https://account.mapbox.com/access-tokens/
11249

113-
# =============================================================================
11450
# Logging Configuration
115-
# =============================================================================
116-
117-
# Logging level: DEBUG, INFO, WARNING, ERROR, CRITICAL
11851
LOG_LEVEL=INFO
119-
120-
# Log file location
121-
LOG_FILE=logs/manhattan_grid.log
122-
123-
# Log rotation settings
124-
LOG_MAX_BYTES=10485760
52+
LOG_FILE=logs/cosim.log
53+
LOG_MAX_BYTES=10485760 # 10MB
12554
LOG_BACKUP_COUNT=5
12655

127-
# Structured logging format
128-
LOG_FORMAT=json
129-
130-
# =============================================================================
131-
# Security Settings
132-
# =============================================================================
133-
134-
# CORS allowed origins (comma-separated)
135-
CORS_ORIGINS=http://localhost:3000,http://localhost:5000
136-
137-
# API rate limiting
138-
RATE_LIMIT_ENABLED=True
139-
RATE_LIMIT_PER_MINUTE=60
140-
RATE_LIMIT_PER_HOUR=1000
141-
142-
# Session timeout (seconds)
143-
SESSION_TIMEOUT=3600
144-
145-
# =============================================================================
146-
# Performance Settings
147-
# =============================================================================
148-
149-
# Enable caching
150-
CACHE_ENABLED=True
151-
CACHE_TYPE=simple
152-
CACHE_DEFAULT_TIMEOUT=300
153-
154-
# Background task settings
155-
CELERY_BROKER_URL=redis://localhost:6379/0
156-
CELERY_RESULT_BACKEND=redis://localhost:6379/0
157-
158-
# =============================================================================
159-
# Development Settings
160-
# =============================================================================
161-
162-
# Enable profiling (development only)
163-
PROFILING_ENABLED=False
56+
# Performance Monitoring
57+
ENABLE_MONITORING=True
58+
METRICS_INTERVAL=60 # seconds
16459

165-
# Mock external services (for testing)
166-
MOCK_SUMO=False
167-
MOCK_WEATHER=False
168-
MOCK_OPENAI=False
60+
# Development Flags
61+
ENABLE_CORS=True
62+
DEBUG_MODE=True
63+
AUTO_RELOAD=True
16964

170-
# =============================================================================
171-
# Monitoring & Metrics
172-
# =============================================================================
173-
174-
# Enable metrics collection
175-
METRICS_ENABLED=True
176-
177-
# Metrics export interval (seconds)
178-
METRICS_EXPORT_INTERVAL=60
179-
180-
# Health check endpoint
181-
HEALTH_CHECK_ENABLED=True
182-
183-
# =============================================================================
184-
# Backup & Recovery
185-
# =============================================================================
186-
187-
# Database backup settings
188-
BACKUP_ENABLED=True
189-
BACKUP_INTERVAL=86400
190-
BACKUP_RETENTION_DAYS=30
191-
BACKUP_LOCATION=backups/
192-
193-
# =============================================================================
194-
# Deployment Settings
195-
# =============================================================================
196-
197-
# Environment identifier
198-
ENVIRONMENT=development
199-
200-
# Application version (auto-populated by CI/CD)
201-
APP_VERSION=2.0.0
202-
203-
# Build information
204-
BUILD_ID=local
205-
BUILD_DATE=2025-01-15
206-
207-
# =============================================================================
20865
# Feature Flags
209-
# =============================================================================
210-
211-
# Enable experimental features
212-
FEATURE_ADVANCED_ML=False
213-
FEATURE_BLOCKCHAIN_TRADING=False
214-
FEATURE_IOT_INTEGRATION=False
215-
FEATURE_MULTI_CITY=False
66+
ENABLE_ML_ENGINE=True
67+
ENABLE_V2G=True
68+
ENABLE_AI_CHATBOT=True
69+
ENABLE_SCENARIO_CONTROLLER=True

0 commit comments

Comments
 (0)