# Peak Zone

### Introduction&#x20;

### What is a Peak Zone?

A Peak Zone is a geospatial area where ride demand exceeds a configured threshold, triggering dynamic surge pricing. When enough rides are requested within a specific radius during a time window, the system automatically creates a peak zone to balance supply and demand through price adjustments.

{% hint style="warning" %} <mark style="color:$info;">**Note:**</mark> <mark style="color:$info;"></mark><mark style="color:$info;">Peak zones are automatically generated and managed by the system based on real-time ride data. They help optimize driver distribution and manage demand during high-traffic periods.</mark>
{% endhint %}

### How Peak Zones Work

The peak zone system operates through the following process:

1. **Detection:** The system continuously monitors ride requests within configurable radius areas
2. **Threshold Check:** When ride count exceeds the configured threshold within the analysis window
3. **Zone Creation:** Automatically generates a polygon zone with surge pricing
4. **Pricing Application:** Applies surge multiplier to base fares for rides originating in the zone
5. **Zone Expiration:** Peak zones automatically expire after the configured duration

```
Ride Requests → Analysis → Threshold Check → Peak Zone Creation → Surge Pricing → Zone Expiration
                
```

### Configuring Parameters for Peak Zone Management

The peak zone system is controlled by several key parameters that can be configured in the admin panel:

| Parameter                        | Description                               | Default Value |
| -------------------------------- | ----------------------------------------- | ------------- |
| `total_rides_in_peak_zone`       | Ride count threshold to trigger peak zone | 10            |
| `peak_zone_geographic_radius`    | Detection radius in kilometers            | 2 km          |
| `minutes_choosing_peak_zone`     | Analysis time window in minutes           | 15 minutes    |
| `minutes_peak_zone_active`       | Duration peak zone remains active         | 60 minutes    |
| `peak_price_increase_percentage` | Surge pricing multiplier percentage       | 20%           |

{% hint style="danger" %}
**Important:** All parameters must be positive values. Invalid values will be rejected by the system
{% endhint %}

### **Surge Pricing Calculation for Peak Zones**

The peak zone surge pricing is calculated using the following formula:

```
Surge Charge = (Base Fare × Peak Price Increase Percentage) / 100
Final Fare = Base Fare + Surge Charge  
```

Example calculation:

* Base Fare: $10.00
* Peak Price Increase: 20%
* Surge Charge: ($10.00 × 20) / 100 = $2.00
* Final Fare: $10.00 + $2.00 = $12.00

{% hint style="info" %}
**Technical Note:** The system only considers rides with payment status 'COMPLETED' when calculating peak zones to ensure data accuracy.
{% endhint %}

### Admin Panel Configuration

#### Editing a peak zone&#x20;

**Steps to Edit**

1. Log in to the Admin Dashboard.
2. Navigate via the left‑sidebar: **CAB MANAGEMENT** → **Peak Zones**.
3. In the Peak Zones list, locate the zone you wish to edit and click the **Edit** button.
4. On the edit screen, you can modify the following parameters (change as needed):

* Peak Zone Name: Enter a unique name for the ride zone. The name should reflect the area covered by the zone, for example, "Downtown", "North Side", or "Airport Area".
* Search Location — the time window in minutes during which ride requests are counted.
* Place Points: Place Points are automatically generated when you draw the boundary on the map. Mark key locations (Place Points) like pickup/drop-off points.
* Map: Use the map tool to draw the zone boundaries or enter the coordinates manually.
* Status: Enable or disable Zone.
* &#x20;After making your updates, click **Save** (or similar) to apply the changes.

{% hint style="warning" %}
Note: Your configuration changes take effect **immediately** for any *new* Peak Zones that are triggered. Existing zones already active will continue under their previously set parameters.
{% endhint %}

<figure><img src="https://74030740-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6o4UzjBZtMQpeq4oeh8s%2Fuploads%2FRkYCjtbf6vbc7bvxpzcx%2FScreenshot%20from%202025-11-17%2012-38-17.png?alt=media&#x26;token=583c62a8-d13e-4082-924a-0d1dd2caf966" alt=""><figcaption></figcaption></figure>

#### Configuration Fields

* **Total Rides in Peak Zone:** Number of rides required to trigger a peak zone
* **Peak Zone Geographic Radius:** Radius in kilometers for ride analysis
* **Minutes Choosing Peak Zone:** Time window for ride counting
* **Minutes Peak Zone Active:** Duration the peak zone remains active
* **Peak Price Increase Percentage:** Surge pricing multiplier

<br>
