## 3 Algorithm Design
### PCFL and ACFL  
The PCFL algorithm and the ACFL algorithm can be both divided into three steps: (a) determination of the sampling area; (b) RGB values calculation; and (c) filtering and weighted evaluation. (a) In the first step, we use the task-rings sampling method to determine the sampling area. Here every task-ring is expressed as the signal range interface for every corresponding task anchor, as previously defined in Equation (7). Then, the sampling area constraining the location of the mobile node is the intersection region of these task-rings corresponding to each task projection. For instance, the shadow region in Figure 3 represents the sampling area which is derived from the task-rings of task projections \(n_{1}^{\prime}\), \(n_{2}^{\prime}\) and \(n_{3}^{\prime}\)with respect to task anchors \(n_{1}\), \(n_{2}\) and \(n_{3}\), respectively. The task-rings are represented as the blue dotted circles. As each task anchor can receive the signal from the mobile node, it can be inferred that the mobile node's location is inside its task-ring. The following Theorem 1 will prove this. The following restricted conditions based on the task-rings  
Figure 2: Hierarchical and projection structure model. sampling method will confine the samples shown as the purple squares inside the shadow region in Figure 3:  
\[\sqrt{\left(x-x_{i}^{\prime}\right)^{2}+\left(y-y_{i}^{\prime}\right)^{2}} \leq \sqrt{\left(R^{2}-\left(k_{i_{1}}^{\prime}\right)^{2}\right)},z=z_{ i}^{\prime}=z_{i}\] \[\sqrt{\left(x-x_{2}^{\prime}\right)^{2}+\left(y-y_{z}^{\prime} \right)^{2}} \leq \sqrt{\left(R^{2}-\left(k_{i_{2}}^{\prime}\right)^{2}\right)},z=z_{ i}^{\prime}=z_{i} \tag{11}\] \[\sqrt{\left(x-x_{3}^{\prime}\right)^{2}+\left(y-y_{s}^{\prime} \right)^{2}} \leq \sqrt{\left(R^{2}-\left(k_{i_{3}}^{\prime}\right)^{2}\right)},z=z_{ 3}^{\prime}=z_{i}\]  
where (\(x\), \(y\), \(z\)) denotes the coordinates of the sample. Normally, the set of the sampling area \(S_{i}^{t}\) is defined as:  
\[S_{i}^{t}=\left\{\left(x,y,z\right)\middle|\forall n_{j}^{\prime}\in B_{i}^{t },\sqrt{\left(x-x_{j}^{\prime}\right)+\left(y-y_{j}^{\prime}\right)^{2}}\leq \sqrt{\left(R^{2}-\left(k_{i_{j}}^{\prime}\right)^{2}\right)},z=z_{i}\right\} \tag{12}\]  
(b) The process of RGB values calculation can be divided into two stages. The first stage is the RGB sequences calculation for the mobile nodes, denoted by \(RGB_{i}^{M}:\left\{R_{i}^{M},G_{i}^{M},B_{i}^{M}\right\},\left(n_{i}\in M \right).\) After arranging all the RGB values \(RGB_{j}^{M}:\left\{R_{j}^{M},G_{j}^{M},B_{j}^{M}\right\},\left(n_{j}^{\prime} \in B_{i}^{t}\right)\) for task anchors' projections (PCFL) or arranging all RGB values \(RGB_{j}^{M}:\left\{R_{j}^{M},G_{j}^{M},B_{j}^{M}\right\},\left(n_{j}\in A_{i}^ {t}\right)\) for task anchors (ACFL), the mobile node converts \(RGB_{j}^{M}\) or \(RGB_{j}^{M}\) into Hue, Saturation, and Value (HSV) [12] at time instant \(t\). \[H_{j}^{M}S_{j}^{M}V_{j}^{M}=\left(RGB\text{ to }HSV\right)R_{j}^{M}G_{j}^{M}B_{j}^{M };k=p,a \tag{13}\]  
Then we can calculate the changed values \(H_{\bar{q}}^{M}S_{\bar{q}}^{M}V_{\bar{q}}^{M}\) of HSV between \(n_{i}\) and the task projection \(n_{j}^{\prime}\) (or task anchor \(n_{j}\)) by the equations below:  
\[H_{\bar{q}}^{M}=H_{j}^{M},S_{\bar{q}}^{M}=S_{j}^{M},V_{\bar{q}}^{M}=\left(1- \frac{d_{\bar{q}}^{t}}{Range}\right)\times V_{j}^{M},k=p,a;d_{\bar{q}}^{t}=p_{ \bar{q}}^{t}\quad\text{or}\quad d_{\bar{q}}^{t}=d^{t}\left(n_{i},n_{j}\right) \tag{14}\]  
where \(Range\) is the maximum length of color change, and we assume \(Range\) to be the maximum communication distance of the mobile node's plane. Then \(\left\{R_{\bar{q}}^{M},G_{\bar{q}}^{M},B_{\bar{q}}^{M}\right\}\) between the mobile node \(n_{i}\) and the task projection \(n_{j}^{\prime}\) (or task anchor \(n_{j}\)) can be worked out based on the algorithm HSVtoRGB [12]:  
Figure 3: The sampling area.