I'm simulating a discrete time Markov process on a finite state space corresponding to a linear interval $(x_1, x_2, ..., x_N) \in X$, where each time step $t_i$ involves updating the state of some number of agents labeled "Red"
and "Blue"
. At any time point $t_i$ I have an array that keeps track of the positions and colors of the agents along the interval:
agentArray[[t]] = {
{"Blue", 9}, {"Red", 8}, {"Blue", 9}, {"Blue", 9}, {"Blue", 8}, {"Blue", 8},
{"Blue", 8}, {"Blue", 6}, {"Blue", 9}, {"Blue", 9}, {"Blue", 8}, {"Blue", 8},
{"Red", 7}, {"Blue", 8}, {"Blue", 8}, {"Blue", 3}};
I'd like to first and foremost have a nice way in which to illustrate the occupancy levels (for agents of the types "Red" and "Blue") of the discrete states $1$ through $N$ in the Markov chain at some time point $t_i$. Given that Wolfram Research recently extensively updated their Markov processes toolkit in Mathematica, is there a nice way to do this automatically? Something like a heat map superimposed on a graph representation of the linear interval, with explicitly stated counts for the number of red and blue agents at each vertex?
Secondly, I was wondering if there was a way to make an animation showing the evolution of the Markov process? Something like the aforementioned graphic where we sample the state of the Markov chain at every $k$th time point?
Specifically: How do we use the aforementioned data structure to show a graph, with heat/color encoded "Red" and "Blue" occupancy levels at each vertex, with the occupancy counts also explicitly written in text above each vertex?