# Goals & Constraints

The **optimization goal** defines the objective of an [optimization study](https://docs.akamas.io/akamas-docs/3.1.3/akamas-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.1.3/akamas-reference/glossary/offline-optimization-study) while absolute constraints are supported by both offline and [online optimization studies](https://docs.akamas.io/akamas-docs/3.1.3/akamas-reference/glossary/offline-optimization-study).

Goals and constraints are not an [Akamas resource](https://docs.akamas.io/akamas-docs/3.1.3/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.1.3/akamas-reference/construct-templates/study-template/goal-and-constraints) page of the [Study template](https://docs.akamas.io/akamas-docs/3.1.3/akamas-reference/construct-templates/study-template) section.

## Commands

Goals and constraints are not an [Akamas resource](https://docs.akamas.io/akamas-docs/3.1.3/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://3992428493-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD2bGkjffNK6bMgSMYyrY%2Fuploads%2FMI3r4WeTaOPhWfgiMJCT%2FScreenshot%202022-12-22%20at%2010.07.39.png?alt=media&#x26;token=8dfebb51-5c25-4099-86bf-e30fdad91f1a" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://3992428493-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD2bGkjffNK6bMgSMYyrY%2Fuploads%2FLUf9Yf1Wc5wlGrR40LK5%2FScreenshot%202022-12-22%20at%2010.09.39.png?alt=media&#x26;token=15251ef7-804b-4784-9c25-2c3daa3490ab" alt=""><figcaption></figcaption></figure>
