i am a beginner to `Discrete optimization` domain. I am working on the real world problem, i.e., Scheduling of hybrid appliances. I have hybrid appliances which can use gas and electricity or electricity and hot water or hot water and gas for their operation. Each appliance has some set of tasks, each task use above mentioned energy carriers based on the requirement. 

The question is, i want to create a constraint such that if the task of the appliance starts with electricity and hot water, it should end with using electricity and hot water. It should not alter the energy carrier to gas during the operation. 

I have created some of the decision variables like this:

$x\_{t,i,j}$ indicates whether task j of appliance i at time slot k processed by electricity or not; 1 = task processed; 0 = not processed 

$y\_{t,i,j}$ indicates whether task j of appliance i at time slot k processed by natural gas or not; 1 = task processed; 0 = not processed

$z\_{t,i,j}$ indicates whether task j of appliance i at time slot k processed by hot water or not; 1 = task processed; 0 = not processed

I tried with the following constraint it seems something missing. 

$\sum\_{k=t}^{t+H\_{i,j}}$ $(x\_{t,i,j}+y\_{t,i,j}+z\_{t,i,j})$ $\geq$ $H\_{i,j} (x\_{t,i,j}+y\_{t,i,j}+z\_{t,i,j})$

Where 
`i` is index of appliance.

`t` is current time slot.

`j` is index of task.

$H\_{i,j}$ is run time of tasks.