What is the most efficient way to get a binary variable A(t), {t - is a time point} which is ‘1’ when a process is running at time point t, otherwise 0. Given that Ts and Tf are the start and end time continuous variables for that process and Val(t) is a parameter which has the value of time at time point t.