> ## Documentation Index
> Fetch the complete documentation index at: https://resq-dependabot-github-actions-github-actions-478e18be3d.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Service

<a id="resq_mcp.pdie.service" />

# resq\_mcp.pdie.service

PDIE - Predictive Disaster Intelligence Engine.

This module provides predictive disaster intelligence:

* Vulnerability mapping for sectors (population, infrastructure, risks)
* Probabilistic forecasts for disaster events
* Pre-alert generation based on LSTM/GNN model outputs

The current implementation is stubbed with mock data for development.

<a id="resq_mcp.pdie.service.annotations" />

## annotations

<a id="resq_mcp.pdie.service.random" />

## random

<a id="resq_mcp.pdie.service.uuid" />

## uuid

<a id="resq_mcp.pdie.service.Final" />

## Final

<a id="resq_mcp.pdie.service.ErrorResponse" />

## ErrorResponse

<a id="resq_mcp.pdie.service.PreAlert" />

## PreAlert

<a id="resq_mcp.pdie.service.VulnerabilityMap" />

## VulnerabilityMap

<a id="resq_mcp.pdie.service.VULNERABILITY_DB" />

#### VULNERABILITY\_DB

<a id="resq_mcp.pdie.service.get_vulnerability_map" />

#### get\_vulnerability\_map

```python theme={null}
def get_vulnerability_map(sector_id: str) -> VulnerabilityMap | ErrorResponse
```

Retrieve precomputed vulnerability assessment for a sector.

Part of PDIE (Predictive Disaster Intelligence Engine) system.
Provides static infrastructure and risk data used as input to
predictive models for disaster forecasting.

Vulnerability Data Includes:

* Population density classification (low/medium/high)
* Critical infrastructure inventory (hospitals, bridges, etc.)
* Flood risk score (0.0-1.0) from terrain and drainage analysis
* Fire risk score (0.0-1.0) from fuel load and climate data

**Arguments**:

* `sector_id` - Sector identifier (e.g., "Sector-1" through "Sector-4").

**Returns**:

* `VulnerabilityMap` - Comprehensive vulnerability data if sector exists.
* `ErrorResponse` - Error message if sector\_id is unknown.

**Example**:

> > > vuln = get\_vulnerability\_map("Sector-1")
> > > if isinstance(vuln, VulnerabilityMap):
> > > ...     if vuln.fire\_risk > 0.7:
> > > ...         print(f"High fire risk: \{vuln.fire\_risk}")
> > > ...         print(f"Infrastructure: \{vuln.critical\_infrastructure}")

**Notes**:

Production systems would integrate with GIS databases and update
vulnerability maps periodically based on infrastructure changes
and seasonal risk factors.

<a id="resq_mcp.pdie.service.get_predictive_alerts" />

#### get\_predictive\_alerts

```python theme={null}
def get_predictive_alerts(sector_id: str) -> list[PreAlert] | ErrorResponse
```

Generate probabilistic disaster forecasts for a sector.

Part of PDIE system. Simulates the output of LSTM/GNN predictive models
that analyze weather patterns, sensor trends, and historical data to
forecast disasters before they occur.

Prediction Logic (Simulated):

* Checks vulnerability map for sector risk factors
* Fire alert: Triggered if fire\_risk > 0.5 (40% probability)
* Probability: 0.75-0.95
* Horizon: 4-24 hours
* Flood alert: Triggered if flood\_risk > 0.5 (40% probability)
* Probability: 0.80-0.95
* Horizon: 12-48 hours
* Returns empty list if no alerts generated

**Arguments**:

* `sector_id` - Sector identifier to generate forecasts for.

**Returns**:

* `list[PreAlert]` - Zero or more pre-alerts with disaster forecasts
  if sector is valid.
* `ErrorResponse` - Error message if sector\_id is unknown.

**Example**:

> > > alerts = get\_predictive\_alerts("Sector-1")
> > > if isinstance(alerts, list):
> > > ...     for alert in alerts:
> > > ...         print(f"Predicted: \{alert.predicted\_disaster\_type}")
> > > ...         print(f"Probability: \{alert.probability:.0%}")
> > > ...         print(f"Time horizon: \{alert.forecast\_horizon\_hours}h")

Integration Note:
Production PDIE would run continuously with:

* Weather API integration (NOAA, MeteoBlue)
* IoT sensor stream processing (water levels, smoke detectors)
* Historical incident database for pattern matching
* LSTM models for time-series forecasting
* GNN models for spatial correlation analysis
