# Goals & Constraints

The **optimization goal** defines the objective of an [optimization study](https://docs.akamas.io/akamas-docs/3.2.0/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.2.0/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.2.0/akamas-reference/glossary/offline-optimization-study).

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

## Commands

Goals and constraints are not an [Akamas resource](https://docs.akamas.io/akamas-docs/3.2.0/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://1840531935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC1d2wNp5yTa9gnHgSILG%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://1840531935-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FC1d2wNp5yTa9gnHgSILG%2Fuploads%2Fgit-blob-af8af41fa5d770bc95226dff065f4d1425159e96%2FScreenshot%202022-12-22%20at%2010.09.39.png?alt=media" alt=""><figcaption></figcaption></figure>


---

# 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.0/akamas-reference/glossary/goals-and-constraints.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.
