# Artificial Empathy and Imprecise Communication in a Multi-Agent System
## 3 Proposed Model
### Fuzzy Agent State
The primary element in the proposed framework is the goal operator \(G^{A}\) for agent \(\mathcal{A}\). This operator is tasked with determining how closely the agent's current sequence of states \(S=\left((\mathbf{X}_{1}^{A},\mathbf{Y}_{1}^{A}),\ldots,(\mathbf{X}_{k}^{A}, \mathbf{Y}_{k}^{A})\right)\) aligns with the overall, predefined goal. The goal operator works by comparing \(S\) against all state sequences stored in the agent's memory \(\mathcal{M}^{A}\), along with their corresponding goal fulfillment levels \((K,g)\). A key aspect of this comparison is the inclusion of partial matches, where the current sequence \(S\) is a prefix of \(K\). This approach accounts for situations where a state sequence with high potential is still in progress and should be evaluated based on the length of its overlap with \(K\). To facilitate this, a prefix weighting function \(\omega\left(\frac{|\mathbf{X}^{\prime}|}{|K|}\right)\) is employed, designed to assign lower or zero values to short prefixes. This is expressed mathematically as:  
\[\omega(x)=\max(2(x-0.5),0)\,. \tag{8}\]  
By employing this method, the goal operator ensures that only state sequences with a substantial match contribute to evaluating the goal. This approach effectively enhances the agent's decision-making process, focusing on actions that significantly advance towards achieving the set goal. Given state sequence \(S=(A_{1},A_{2},\cdots,A_{i})\), we say that \(S^{\prime}\) is its prefix and denote it by \(S^{\prime}\prec S\) if \(S^{\prime}=(A_{1},A_{2},\cdots,A_{j})\), for some \(j\leq i\). The goal operator is defined via a family of functions \(G_{k}^{A}:([0,1]^{n+m})^{k}\to[-1,1]\). For the sake of simplicity, we write \(G^{\mathcal{A}}(S)\) instead of \(G_{|S|}^{\mathcal{A}}(S)\). Then, for any aggregation operator \(\bigoplus\), we define the goal operator as:  
\[G^{\mathcal{A}}(S)=\bigoplus_{(K,g)\in\mathcal{M}_{A}}\max_{K^{\prime}\prec K} \operatorname{sim}(S,K^{\prime})\cdot\omega\bigg{(}\frac{|K^{\prime}|}{|K|} \bigg{)}\cdot g\,. \tag{9}\]  
In situations where state sequences are being compared vary in length, we introduce a technique called sequence compaction to enable effective comparisons. This process is facilitated by the compaction operator \(L_{k}^{l}:([0,1]^{n+m})^{k}\to([0,1]^{n+m})^{l}\), which is applicable when \(k<l\). The compaction operator employs a fuzzy set aggregation method to combine consecutive states within a sequence, to produce a sequence of a specific length \(l\). For a given sequence \(S\), where \(|S|>l\), let \(\mathcal{L}^{l}(S)\) represent the set of all possible \(\binom{|S|-1}{l-1}\) compactions of \(S\) to length \(l\). Each compaction in \(\mathcal{L}^{l}(S)\) is generated by aggregating states in the original sequence \(S\) to create a shorter sequence that maintains the essential characteristics of \(S\), but with a length equal to \(l\). Let \(l=\min(|S^{\mathcal{A}}|,|S^{\mathcal{B}}|)\), and the similarity of two state sequences \(S^{\mathcal{A}}=\Big{(}(\mathbf{X}_{1}^{\mathcal{A}},\mathbf{Y}_{1}^{ \mathcal{A}}),\dots,(\mathbf{X}_{|S^{\mathcal{A}}|}^{\mathcal{A}},\mathbf{Y}_ {|S^{\mathcal{A}}|}^{\mathcal{A}})\Big{)}\) and \(S^{\mathcal{B}}=\Big{(}(\mathbf{X}_{1}^{\mathcal{B}},\mathbf{Y}_{1}^{ \mathcal{B}}),\dots,(\mathbf{X}_{|S^{\mathcal{B}}|}^{\mathcal{B}},\mathbf{Y}_ {|S^{\mathcal{B}}|}^{\mathcal{B}})\Big{)}\) is defined as:  
\[\operatorname{sim}(S^{\mathcal{A}},S^{\mathcal{B}})=\sup_{ \begin{subarray}{c }\hat{S}^{\mathcal{A}}\in\mathcal{L}^{l}(S^{\mathcal{A}})\\ \hat{S}^{\mathcal{B}}\in\mathcal{L}^{l}(S^{\mathcal{B}})\end{subarray} }\bigotimes _{1\leq i\leq l}s(\hat{\mathcal{X}}_{i}^{\mathcal{A}},\hat{\mathcal{X}}_{i}^ {\mathcal{B}})\odot s(\hat{\mathcal{Y}}_{i}^{\mathcal{A}},\hat{\mathcal{Y}}_{ i}^{\mathcal{B}}) \tag{10}\]  
where \(\bigotimes\) and \(\odot\) are aggregation operators and \(s\) is the similarity measure of classical, interval-valued, or hesitant fuzzy sets [18; 26].