# Goals & Constraints

The **optimization goal** defines the objective of an [optimization study](https://docs.akamas.io/akamas-docs/3.6/reference/glossary/optimization-studies) to be achieved by changing the system parameters to modify the system behavior while also satisfying any defined **optimization constraints** on the system metrics, possibly representing SLOs.

## Construct

A **goal** is defined by:

* an optimization objective: either maximize or minimize
* a scoring function (scalar): either a single metric or a formula defined by one or more metrics

One or more **constraints** can be associated with a goal

* a formula defined on one or more metrics, referring to either absolute values (**absolute** **constraints**) or relative to a baseline value (**relative constraints**)

Notice that relative constraints are only supported by [offline optimization studies](https://docs.akamas.io/akamas-docs/3.6/using/study/offline-optimization-study) while absolute constraints are supported by both offline and [online optimization studies](https://docs.akamas.io/akamas-docs/3.6/using/study/offline-optimization-study).

Goals and constraints are not an [Akamas resource](https://docs.akamas.io/akamas-docs/3.6/cli-reference#clireference-operations) as they are defined as part of an optimization study. The construct to be used to define a goal and its constraints are described in the [Goal & Constraint](https://docs.akamas.io/akamas-docs/3.6/reference/construct-templates/study-template/goal-and-constraints) page of the [Study template](https://docs.akamas.io/akamas-docs/3.6/reference/construct-templates/study-template) section.

## Commands

Goals and constraints are not an [Akamas resource](https://docs.akamas.io/akamas-docs/3.6/cli-reference#clireference-operations) and are always defined as part of an optimization study.

## User Interface

Goals and constraints are displayed in the Akamas UI when drilling down each optimization study.

<figure><img src="https://4103111959-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzrIhBBVa4sw46ol13SWX%2Fuploads%2Fgit-blob-f0ca25c66f444dcc0296b12402642bb0e2a505bf%2FScreenshot%202022-12-22%20at%2010.07.39.png?alt=media" alt=""><figcaption></figcaption></figure>

The detail of the formula used to define the goal may also be displayed:

<figure><img src="https://4103111959-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzrIhBBVa4sw46ol13SWX%2Fuploads%2Fgit-blob-af8af41fa5d770bc95226dff065f4d1425159e96%2FScreenshot%202022-12-22%20at%2010.09.39.png?alt=media" alt=""><figcaption></figcaption></figure>
