# Integrator

This solver performs the numerical integration of scalar functions \(f:\mathbb{R}^D\to \mathbb{R}\) for the “Integration” problem. Provided evalutation points \(\mathbf{x}_i\in\mathbb{R}^D\) with \(i=0,\dots,N-1\) the function is evaluated, giving \(f(\mathbf{x}_i)\). Using the provided weights \(w_d\in\mathbb{R}\) with \(d=0,\dots,D-1\) for one dimension, the cartesian product \(w_i=\prod\limits_{d=0}^{D-1}w_{i,d}\) with \(i=0,\dots,D\) is computed. Using these quantities the numerical approximation of the integral is performed

is performed.

## Usage

`e["Solver"]["Type"] = "Integrator"`

## Results

These are the results produced by this solver:

- Integral
**Usage**: e[“Results”][“Integral”] =*real number***Description**: Value of the integral.

## Configuration

These are settings required by this module.

- Executions Per Generation
**Usage**: e[“Solver”][“Executions Per Generation”] =*unsigned integer***Description**: Specifies the number of model executions per generation. By default this setting is 0, meaning that all executions will be performed in the first generation. For values greater 0, executions will be split into batches and split int generations for intermediate output.

## Termination Criteria

These are the customizable criteria that indicates whether the solver should continue or finish execution. Korali will stop when at least one of these conditions are met. The criteria is expressed in C++ since it is compiled and evaluated as seen here in the engine.

- Max Model Evaluations
**Usage**: e[“Solver”][“Max Model Evaluations”] =*unsigned integer***Description**: Specifies the maximum allowed evaluations of the computational model.**Criteria**:`_maxModelEvaluations <= _modelEvaluationCount`

- Max Generations
**Usage**: e[“Solver”][“Max Generations”] =*unsigned integer***Description**: Determines how many solver generations to run before stopping execution. Execution can be resumed at a later moment.**Criteria**:`_k->_currentGeneration > _maxGenerations`

## Default Configuration

These following configuration will be assigned by default. Any settings defined by the user will override the given settings specified in these defaults.

{ "Executions Per Generation": 500000000, "Model Evaluation Count": 0, "Termination Criteria": { "Max Generations": 10000000000, "Max Model Evaluations": 1000000000 }, "Variable Count": 0 }