## Results


Simulation output for a single model run.


Usage

``` python
Results(model)
```


## Methods

| Name | Description |
|----|----|
| [__init__()](#__init__) | Create instance of Results. |
| [mean_by_category()](#mean_by_category) | Find mean of metric by response category, and then also by outcome. |
| [patient_df()](#patient_df) | Return per-patient results as a DataFrame. |
| [summary_df()](#summary_df) | Return run-level summary in long format. |
| [utilisation()](#utilisation) | Return mean time-weighted ambulance utilisation. |
| [utilisation_df()](#utilisation_df) | Return time-weighted ambulance utilisation intervals. |

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


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


Create instance of Results.


Usage

``` python
__init__(model)
```


##### Parameters


`model: Model`  
A model instance that has already been executed (model.run())


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


#### mean_by_category()


Find mean of metric by response category, and then also by outcome.


Usage

``` python
mean_by_category(df, col, name)
```


##### Parameters


`df: pd.DataFrame`  
Patient-level dataframe.

`col: str`  
Column to aggregate.

`name: str`  
Name to assign in the metric column.


##### Returns


`pd.DataFrame`  
Long-format dataframe with aggregated results.


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


#### patient_df()


Return per-patient results as a DataFrame.


Usage

``` python
patient_df()
```


Each row represents one patient. Patients who had not completed their full pathway by the end of the run will have NaN for unset time attributes.


##### Returns


`pd.DataFrame`  
Dataframe with patient-level results.


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


#### summary_df()


Return run-level summary in long format.


Usage

``` python
summary_df()
```


##### Returns


`pd.DataFrame`  
Run-level summary.


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


#### utilisation()


Return mean time-weighted ambulance utilisation.


Usage

``` python
utilisation()
```


##### Returns


`float`  
Mean time-weighted ambulance utilisation.


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


#### utilisation_df()


Return time-weighted ambulance utilisation intervals.


Usage

``` python
utilisation_df()
```


##### Returns


`pd.DataFrame`  
Columns: time, busy, interval_duration, utilisation.
