## 2 ACT-R Modeling for Task Switching
### Subsymbolic Structure of Proposed Task Switching Model  
Several subsymbolic equations must be added to develop a computational model based on the symbolic structure proposed in the previous section. First, considering the interrupt-task rule in the symbolic structure, a subsymbolic equation is needed to represent the timing of starting the rule. In a situation where the interrupt-task rule begins when there exists an imbalance between the difficulty of the ongoing task and the performer's ability,the subsymbolic equation must be able to evaluate the level of imbalance quantitatively in real time. According to [PERSON] et al. [31], difficulty is associated with the mental workload imposed by a task. The level of ability indicates the speed of cognitive processes [39]. According to these perspectives, the level of imbalance at time \(T\) (\(LI_{T}\)) is proportional to the ratio of the value of the imposed mental workload to the speed of the cognitive processes in the ongoing task at time \(T\). [PERSON] et al. [40] developed a methodology to quantitatively predict the mental workload over time using ACT-R, in which the accumulated mental workload over a time interval [\(T1\), \(T2\)] (AW\({}_{[T1,T2]}\)) is represented as the sum of the activated times of ACT-R modules during the time period, as indicated below:  
\[AW_{[T1,\ T2]}=\sum_{i}\left(W_{i}\int_{T1}^{T2}A_{i}(t)dt\right) \tag{1}\]  
where \(W_{i}\) is the weight assigned to module \(i\) (\(W_{i}\geq 1\)), and \(A_{i}(t)\) is a function that determines if module \(i\) is activated at the given time \(t\) (0 or 1 according to inactive or active, respectively), and \(A_{i}(t)dt\) represents the activated time of module \(i\) during the infinitesimal time d\(t\), such that each module in ACT-R is activated to process relevant information associated with the execution of a task [40]. Additionally, because affective experiences such as frustration, which can be caused by mental workload, are affected by the temporal dimension that includes recovery time [41], we can assume that the imposed mental workload decays over time. Therefore, the general decay function is applied to Equation (1) for the accumulated mental workload, as follows:  
\[MW_{T}=\sum_{j}(AW)_{j}\cdot t_{j}^{-d} \tag{2}\]  
where \(MW_{T}\) is the imposed mental workload at time \(T\), (AW)\({}_{j}\) is the accumulated mental workload imposed by the \(j\)th subtask in the ongoing task, \(t_{j}\) is the time since the \(j\)th subtask has been executed, and \(d\) is the decay parameter and can be decimal number between 0 and 1. Furthermore, it can be assumed that the speed of cognitive processes is related to the number of subtasks in the ongoing task that have been processed, which can be represented as the number of accomplished subgoals in the ongoing task. Consequently, \(LI_{T}\) can be denoted as the ratio of \(MW_{T}\) to the number of accomplished subgoals at time \(T\), \(N\)(Subgoals\({}_{T}\)), as expressed below:  
\[LI_{T}=MW_{T}\ /\ N(Subgoals_{T}) \tag{3}\]  
In Equation (3) above, \(LI_{T}\) can be interpreted as the amount of mental workload imposed per subtask. Finally, the scaled value of the level of imbalance, as in Equation (4), can be obtained by dividing \(LI_{T}\) by the standard value (\(MW_{std}\)), which is calculated using the accumulated workload imposed when performing a basic subtask. \[Scaled\ LI_{T}=LI_{T}/MW_{std} \tag{4}\]  
In Equation (4), if the scaled \(LI_{T}\) value is greater than unity, it means that the subtask being performed at time \(T\) is more difficult than the standard subtask in the ongoing task. Therefore, in the proposed model, the interrupt-task rule is implemented when the scaled \(LI_{T}\) value is greater than the sum of unity and the imbalance threshold value, as expressed below:  
\[Scaled\ LI_{T}>1+\varepsilon\ (imbalance\ threshold\ value) \tag{5}\]  
where the imbalance threshold value, \(\varepsilon\), can be a decimal number between 0 and 1.