# Baseline step

A baseline step performs an experiment (a baseline experiment) and marks it as the initial experiment of a study. The purpose of the step is to build a reference configuration that Akamas can use to measure the effectiveness of an optimization conducted towards a system.

A baseline step offers three options when it comes to selecting the configuration of the baseline experiment:

* Use a configuration made with the default values of the parameters taken from the system of the study
* Use a configuration taken from an experiment of another study
* Use a custom configuration

The baseline step has the following structure:

| Field                   | Type             | Value restriction                                                                       | Is required | Default value | Description                                                                                                                                                                                                                                                                                   |
| ----------------------- | ---------------- | --------------------------------------------------------------------------------------- | ----------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `type`                  | string           | `baseline`                                                                              | yes         |               | The type of the step, in this case, `baseline`                                                                                                                                                                                                                                                |
| `name`                  | string           |                                                                                         | yes         |               | The name of the step                                                                                                                                                                                                                                                                          |
| `runOnFailure`          | boolean          | <p><code>true</code><br><code>false</code></p>                                          | no          | `false`       | <p>The execution policy of the step:</p><ul><li><code>false</code> prevents the step from running in case the previous step failed</li><li><code>true</code> allows the step to run even if the previous step failed</li></ul>                                                                |
| `from`                  | array of objects | Each object should have the structure described below                                   | no          |               | <p>The study and the experiment from which to take the configuration of the baseline experiment</p><p>The <code>from</code> and <code>experiments</code> fields are defined as an array, but it can only contain one element</p><p>This can be set only if <code>values</code> is not set</p> |
| `values`                | object           | The keys should match existing parameters                                               | no          |               | <p>The configuration with which execute the baseline experiment</p><p>This can be set only if <code>from</code> is not set</p>                                                                                                                                                                |
| `doNotRenderParameters` | string           | this cannot be used when using a *from* option since no experiment is actually executed | no          |               | Parameters not to be rendered. - see [Parameter rending](https://docs.akamas.io/akamas-docs/3.2.1-1/akamas-reference/construct-templates/study-template/parameter-rendering)                                                                                                                  |
| `renderParameters`      | string           | this cannot be used when using a *from* option since no experiment is actually executed | no          |               | Parameters to be rendered. - see [Parameter rending](https://docs.akamas.io/akamas-docs/3.2.1-1/akamas-reference/construct-templates/study-template/parameter-rendering)                                                                                                                      |

where the `from` field should have the following structure:

{% code lineNumbers="true" %}

```yaml
study: "study_from_which_to_take_the_baseline"
experiments: [1]
```

{% endcode %}

with

* `study` contains the name or id of the study from which to take the configuration
* `experiments` contains the number of the experiment from which to take the configuration

### Examples

#### Baseline configuration with default values

Default values for the baseline configuration only require setting the `name` and `type` fields:

{% code lineNumbers="true" %}

```yaml
name: "my_baseline" # name of the step
type: "baseline" # type of the step (baseline)
```

{% endcode %}

#### Baseline configuration from another study <a href="#baseline-configuration-taken-from-another-study" id="baseline-configuration-taken-from-another-study"></a>

The configuration taken from another study to be used as a baseline only requires setting the `from` field:

{% code lineNumbers="true" %}

```yaml
name: "my_baseline" # name of the step
type: "baseline"  # type of the step (baseline)
from:
  - study: "study_from_which_take_the_baseline" # name or id of the study from which to take the configuration
    experiments: [1] # the number of the experiment from which to take the configuration
```

{% endcode %}

Notice: the `from` and `experiments` fields are defined as an array, but can only contain one element.

#### Custom baseline configuration

The custom configuration for the baseline only requires setting the `values` field:

{% code lineNumbers="true" %}

```yaml
name: "my_baseline" # name of the step
type: "baseline" # type of the step (baseline)
values:
  jvm1.maxHeapSize: 1024 # parameter maxHeapSize of jvm1 is set to 1024
  jvm2.maxHeapSize: 2048 # parameter maxHeapSize of jvm2 is set to 2048
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.akamas.io/akamas-docs/3.2.1-1/akamas-reference/construct-templates/study-template/steps/baseline-step.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
