> For the complete documentation index, see [llms.txt](https://swonh.gitbook.io/sdmp-user-manual-eng/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://swonh.gitbook.io/sdmp-user-manual-eng/general-module/user-controls/eventcontrol.md).

# EventControl

Controls for functions related to events that occur while performing the solver functions

### OnBeginSolve

```csharp
public override void OnBeginSolve()
```

#### Definition

A function called when the solver starts running.

#### Example (Default Logic)

```csharp
public override void OnBeginSolve()
{

}
```

### OnDataLoad

```csharp
public override void OnDataLoad()
```

#### Definition

A function called immediately after data is loaded through `GetData` in `DataControl`.

#### Example (Default Logic)

```csharp
public override void OnDataLoad() 
{

}
```

### OnVisitState

```csharp
public override void OnVisitState(State state)
```

#### Definition

A function that is called when the State is visited.

#### Parameter

| Type  | Description                  |
| ----- | ---------------------------- |
| State | The currently visited state. |

#### Example (Default Logic)

```csharp
public override void OnVisitState(State state)
{
  
}
```

### OnVisitToState

```csharp
public override void OnVisitToState(State fromState, State toState)
```

#### Definition

A function that is called when the state is transitioned through a defined action and visits the state of the next stage for the first time.

#### Parameters

<table><thead><tr><th width="99">Type</th><th>Description</th></tr></thead><tbody><tr><td>State</td><td>The state before performing the action.</td></tr><tr><td>State</td><td>The state of the next stage visited after being transitioned through the action.</td></tr></tbody></table>

#### Example (Default Logic)

```csharp
public override void OnVisitToState(State fromState, State toState)
{

}
```

### OnStageChanged

```csharp
public override void OnStageChanged(Stage stage)
```

#### Definition

A function that is called when the stage is changed.

#### Parameter

<table><thead><tr><th width="190">Type</th><th>Description</th></tr></thead><tbody><tr><td>Stage</td><td>The changed stage.</td></tr></tbody></table>

#### Example (Default Logic)

```csharp
public virtual void OnStageChanged(Stage stage) 
{
    
}
```

### OnDoneSolve

```csharp
public override void OnDoneSolve()
```

#### Definition

A function called when the solver finishes running.

#### Example (Default Logic)

```csharp
public override void OnDoneSolve()
{

}
```
