adrian0010 / Percolation

1 stars 0 forks source link

Process between 2 Matrices #9

Open discoleo opened 1 year ago

discoleo commented 1 year ago

Process between 2 Matrices

It is possible to build a coupled process which transitions matrix 1 into matrix 2.

R Code

# t = Mixing parameter;
as.grid.m2 = function(m1, m2, t, p=0.5, val = c(-1, 0)) {
    isBlock = ((1-t)*m1 + t*m2) < p;
    m = array(val[2], dim = dim(m1));
    m[isBlock] = val[1];
    return(m);
}