I'm trying to deal with a process planning and machine layout allocation simultaneously.
I have the following variables:
$X_p{_w}_{cj}=1$ if an operation $p$ is done by a machine $w$ with a configuration $c$ at process plan position $j$, and zero otherwise
$T_w{_{w'}}_{,jj+1}=1$ if there is a change of machine $w$ between position $j$ and $j+1$, and zero otherwise.
$C_w{_{cc'}}_{,jj+1}=1$ if for a given machine $w$ there is a change of configuration between position $j$ and $j+1$, and zero otherwise.
Since the variable $X_p{_w}_{cj}$ gives me the position of each machine and configuration on the process plan, I think I must establish a relation between this variable and $T_w{_{w'}}_{,jj+1}$ and $C_w{_{cc'}}_{,jj+1}$, respectively.
In order to do that, I created the following constraint:
$$\sum_{c}(X_p{_w}_{cj}+X_{p+1}{_{w'}}_{cj+1})\leqslant T_w{_{w'}}_{,jj+1} + 1$$
With this constraint I would like to state that for 2 followed positions on the process plan, the sum of variables $X_p{_w}_{cj}$ must be equal or less than the variable $T_w{_{w'}}_{,jj+1}+1$. In other words, this constraint states if there is a change of machine between $j$ and $j+1$.
Similarly, the following constraint states if there is a change of configuration for the same machine between $j$ and $j+1$.
$$X_p{_w}_{cj}+X_{p+1}{_w}_{{c'}j+1}\leqslant C_w{_{cc'}}_{,jj+1} + 1$$
I would like to know if it is correct or if there is a better way to express these relations. Could someone help me?