MarkovChainSimulator

A Markov Chain simulator that runs against the provided yaml state configuration file.
Quick Start
Installation
This application can be installed onto the command line with the following command:
go install github.com/Kilemonn/MarkovChainSimulator@latest
Simulation Configuration
The simulation configuration, which contains the simulation states, initial state, interations and transitions between states is defined in a sample below:
initialState: A
stepCount: 100
states:
- id: A
transitions:
- state: A
chance: 0.10
- state: B
chance: 0.28
- state: C
chance: 0.62
- id: B
transitions:
- state: C
chance: 0.5
- state: A
chance: 0.5
- id: C
transitions:
- state: A
chance: 0.7
- state: B
chance: 0.3
initialState is used to define the state where the simulation will start from (it must match one of the defined state ids in the states array below).
stepCount indicates the amount of steps between states that will be performed before the simulation finishes. Once stepCount amount of state changes has occurred the simulation will finish.
states defines the list of states that are available in the simulation.
States are made up of the following properties:
id a unique ID to identify the state
transitions which is a list of:
state the state.id of the state that it can transition into from the current state
chance the percentage change as a float, where 1.0 is 100% and 0.0 is 0%.
All chance amounts must add up to exactly 1.0.
Usage
Lets say the above configuration is in a file called sample.yaml then we can execute the simulation against it using the following command:
MarkovChainSimulator.exe -f sample.yaml
Some example output for the above would look like the below (state order is not guaranteed in output):
A - 37/100 = 37.00%
B - 25/100 = 25.00%
C - 38/100 = 38.00%