## scenarios.Alternative


Represents an alternative in the MIKE+ model.


Usage

``` python
scenarios.Alternative(
    scenario_manager,
    net_alternative,
)
```


An alternative represents a specific configuration of a model component. Alternatives form a hierarchical tree structure with parent-child relationships.


## Attributes


`id: int`  
Unique identifier for the alternative

`name: str`  
Name of the alternative

`group: AlternativeGroup`  
The group this alternative belongs to

`parent: Alternative or None`  
Parent alternative (None if base alternative)

`children: list[Alternative]`  
Child alternatives derived from this one

`is_active: bool`  
Whether this alternative is part of the active scenario

`is_base: bool`  
Whether this is the base alternative for its group

`comment: str`  
User comment attached to this alternative

`scenarios: list[Scenario]`  
Scenarios that use this alternative


## Examples

``` python
>>> alt = db.alternative_groups["CS Network data"].active
>>> print(f"Active network: {alt.name}")
>>> print(f"Parent: {alt.parent.name if alt.parent else 'None'}")
>>> print(f"Child count: {len(alt.children)}")
```


## Attributes

| Name | Description |
|----|----|
| [children](#children) | Child alternatives derived from this alternative. |
| [comment](#comment) | Alternative's comment. |
| [group](#group) | Alternative group this alternative belongs to. |
| [id](#id) | Alternative's unique identifier. |
| [is_active](#is_active) | Whether this alternative is part of the active scenario. |
| [is_base](#is_base) | Whether this alternative is the base alternative for its group. |
| [name](#name) | Alternative's name. |
| [parent](#parent) | Parent alternative (None if this is the base alternative). |
| [scenarios](#scenarios) | Scenarios that use this alternative. |

------------------------------------------------------------------------


#### children


Child alternatives derived from this alternative.


`children: list[Alternative]`


------------------------------------------------------------------------


#### comment


Alternative's comment.


`comment: str`


------------------------------------------------------------------------


#### group


Alternative group this alternative belongs to.


`group: AlternativeGroup`


------------------------------------------------------------------------


#### id


Alternative's unique identifier.


`id: int`


------------------------------------------------------------------------


#### is_active


Whether this alternative is part of the active scenario.


`is_active: bool`


------------------------------------------------------------------------


#### is_base


Whether this alternative is the base alternative for its group.


`is_base: bool`


------------------------------------------------------------------------


#### name


Alternative's name.


`name: str`


##### Raises


`ValueError`  
If the alternative name could not be changed


------------------------------------------------------------------------


#### parent


Parent alternative (None if this is the base alternative).


`parent: Alternative | None`


------------------------------------------------------------------------


#### scenarios


Scenarios that use this alternative.


`scenarios: list[Scenario]`


## Methods

| Name | Description |
|----|----|
| [__eq__()](#__eq__) | Check if two alternatives are equal. |
| [__init__()](#__init__) | Alternative constructor. |
| [__repr__()](#__repr__) | Return a string representation of the alternative. |

------------------------------------------------------------------------


#### \_\_eq\_\_()


Check if two alternatives are equal.


Usage

``` python
__eq__(other)
```


------------------------------------------------------------------------


#### \_\_init\_\_()


Alternative constructor.


Usage

``` python
__init__(scenario_manager, net_alternative)
```


##### Parameters


`scenario_manager: IScenarioManager`  
The underlying .NET scenario manager object

`net_alternative: IAlternative`  
The .NET IAlternative object


------------------------------------------------------------------------


#### \_\_repr\_\_()


Return a string representation of the alternative.


Usage

``` python
__repr__()
```
