ParametricInsuranceEngine
Parametric insurance evaluation engine.
Evaluates conditions for parametric insurance contracts based on external data triggers (e.g., flood depth, temperature, rainfall).
Supports condition types:
THRESHOLD: Value exceeds or falls below a threshold
RANGE: Value within a specified range
COMPARISON: Compare two values
Expression format examples:
Threshold: "$.floodDepthCm >= 50"
Range: "
$.temperature >= 20 && $
.temperature <= 30"Comparison: "
$.value1 > $
.value2"
Example Usage:
val engines = EvaluationEngines()
engines += ParametricInsuranceEngine()
val contract = createContract(
executionModel = ExecutionModel.Parametric(
triggerType = TriggerType.EarthObservation,
evaluationEngine = "parametric-insurance"
)
)Content copied to clipboard
Properties
Functions
Link copied to clipboard
open suspend override fun evaluateCondition(condition: ContractCondition, inputData: JsonElement, context: EvaluationContext): Boolean
Evaluate a single contract condition.
Link copied to clipboard
open suspend override fun evaluateConditions(conditions: List<ContractCondition>, inputData: JsonElement, context: EvaluationContext): Map<String, Boolean>
Default implementation of evaluateConditions that evaluates each condition individually. Override if you need custom batch evaluation logic.