This "non-boolean truth table", as the OP has named it, can be converted into 3 (3 bits to cover the 6 types of Activities) truth tables, each with 5 bits of input (note Location requires 2 bits). This will contain some don't care values since there are only 6 types of Activities vs. 2^3 = 8, and since there are only 3 types of Locations vs. 2^2 = 4. From these truth tables, the kmaps can be constructed. From these kmaps, the boolean minimized equations can be constructed. From these boolean equations, the efficient code can be written. Note that this is a lot of mental work, which might be error prone. Based on this, and the fact that the OP merely asked for guidance, I will leave this work for the OP.