#ifndef POSITIONING_CONFIG_H
#define POSITIONING_CONFIG_H

// Distributed Positioning Algorithm Configuration
#define POSITIONING_ENABLED true

// Algorithm Parameters
#define TRILATERATION_METHOD 1             // 1 = Standard, 2 = Weighted, 3 = Least Squares
#define MIN_DISTANCE_FOR_CALC 0.3          // Minimum distance in meters for calculations
#define MAX_DISTANCE_FOR_CALC 100.0        // Maximum distance in meters for calculations
#define DISTANCE_FILTER_ALPHA 0.3          // Low-pass filter coefficient for distances

// Coordinate System
#define COORDINATE_SYSTEM_2D true          // 2D positioning (true) or 3D (false)
#define ORIGIN_SELECTION_AUTO true         // Auto-select origin anchor
#define COORDINATE_PRECISION 2             // Decimal places for coordinates

// Position Validation
#define ENABLE_POSITION_VALIDATION true
#define MAX_POSITION_ERROR 2.0             // Maximum allowable position error in meters
#define MIN_POSITION_CONFIDENCE 0.5        // Minimum confidence score (0.0-1.0)
#define POSITION_STABILITY_THRESHOLD 0.5   // Position change threshold for stability

// Network Topology
#define MAX_NETWORK_DIAMETER 200.0         // Maximum network size in meters
#define MIN_ANCHOR_SEPARATION 2.0          // Minimum distance between anchors
#define OPTIMAL_ANCHOR_SEPARATION 10.0     // Optimal distance between anchors

// Communication Protocol
#define POSITION_DATA_FORMAT_JSON true     // Use JSON format for position data
#define COMPRESS_POSITION_DATA false       // Compress position data packets
#define POSITION_DATA_CHECKSUM true        // Include checksum in position data

// Performance Optimization
#define CALC_BATCH_SIZE 5                  // Number of positions to calculate per batch
#define POSITION_CACHE_SIZE 10             // Number of positions to cache
#define ENABLE_PARALLEL_CALC false         // Enable parallel calculations (if supported)

// Debug and Logging
#define POSITION_DEBUG_OUTPUT false        // Enable position calculation debug output
#define LOG_POSITION_HISTORY false         // Log position history for analysis
#define POSITION_LOG_SIZE 100              // Number of positions to log

// Error Handling
#define RETRY_FAILED_CALCULATIONS true     // Retry failed position calculations
#define MAX_CALCULATION_RETRIES 3          // Maximum retry attempts
#define FALLBACK_TO_2D_ON_ERROR true       // Fallback to 2D if 3D fails

// Timing Configuration
#define POSITION_UPDATE_RATE_MS 500        // Position update interval in milliseconds
#define DISTANCE_MEASUREMENT_TIMEOUT 2000  // Timeout for distance measurements
#define CALCULATION_TIMEOUT_MS 1000        // Timeout for position calculations

#endif // POSITIONING_CONFIG_H