# Scenarios API

### Scenarios API

Define variable initial conditions for robust training.

#### Basic Scenarios

```python
from composabl import Scenario

# Fixed scenario
fixed_scenario = Scenario({
    "temperature": 25.0,
    "pressure": 1.0,
    "flow_rate": 100.0
})

# Sample from scenario
sampled = fixed_scenario.sample()
# Returns: {"temperature": 25.0, "pressure": 1.0, "flow_rate": 100.0}

# Variable scenario with ranges
variable_scenario = Scenario({
    "temperature": [20, 30],
    "pressure": [0.8, 1.2],
    "flow_rate": [80, 120]
})

# Variable scenario with choices
variable_scenario_choices = Scenario({
    "temperature": [20, 30, 40],
    "pressure": [0.8, 1.2, 2],
    "flow_rate": [80, 120, 150]
})

# Sample from scenario
sampled = variable_scenario_choices.sample()
# Returns: {"temperature": 30, "pressure": 2, "flow_rate": 80}
```


---

# 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.amesa.com/reference/sdk-reference/core/scenarios-api.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.
