## scenarios.AlternativeGroupCollection


Collection-like access to alternative groups.


Usage

``` python
scenarios.AlternativeGroupCollection(scenario_manager)
```


Provides access to alternative groups in the MIKE+ model with dictionary-like syntax and helper methods for finding groups by related criteria.


## Examples

``` python
>>> # Access by name/ID
>>> loads_group = db.alternative_groups["Loads and boundaries data"]
>>>
>>> # Get all group names
>>> group_names = db.alternative_groups.group_names()
>>> "Loads and boundaries data" in group_names
>>>
>>> # Find group by associated table
>>> msm_group = db.alternative_groups.by_table("msm_Link")
```


## Methods

| Name | Description |
|----|----|
| [__getitem__()](#__getitem__) | Get alternative group by ID or name. |
| [__init__()](#__init__) | AlternativeGroupCollection constructor. |
| [__iter__()](#__iter__) | Iterate through all alternative groups. |
| [__repr__()](#__repr__) | Return a string representation of the AlternativeGroupCollection. |
| [by_table()](#by_table) | Find the alternative group associated with a specific table. |
| [group_names()](#group_names) | Get a list of available group names. |

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


#### \_\_getitem\_\_()


Get alternative group by ID or name.


Usage

``` python
__getitem__(key)
```


##### Raises


`KeyError`  
If no alternative group with the specified ID or name is found


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


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


AlternativeGroupCollection constructor.


Usage

``` python
__init__(scenario_manager)
```


##### Parameters


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


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


#### \_\_iter\_\_()


Iterate through all alternative groups.


Usage

``` python
__iter__()
```


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


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


Return a string representation of the AlternativeGroupCollection.


Usage

``` python
__repr__()
```


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


#### by_table()


Find the alternative group associated with a specific table.


Usage

``` python
by_table(table_name)
```


##### Parameters


`table_name: str`  
The name of the table to find the group for (e.g. "msm_Link")


##### Returns


`AlternativeGroup`  
The alternative group associated with the given table


##### Raises


`KeyError`  
If no group is associated with the given table


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


#### group_names()


Get a list of available group names.


Usage

``` python
group_names()
```
