## 2 Materials and Methods
### Problem Formalization and Proposed Method  
This section formalizes the problem introduced in Section 1 and describes the proposed solution. Table 1 reports the list of used symbols. Before dealing with such formalization, it is necessary to define the concept of temporal domain used in the following. Figure 4: Exemplification of the PPO functioning, inspired by [44]. **Definition 1** (Temporal Domain). : _A temporal domain \(\mathbb{T}\) is a tuple \((T,\leq)\), where \(T\) is a set of not-empty temporal instants and \(\leq\) is an ordering relation on \(T\)[45]._  
In other words, a temporal domain \(\mathbb{T}\) is a set of totally ordered time instants. A granularity is a mapping defined as follows. **Definition 2** (Temporal granularity). : _Given a temporal domain \(\mathbb{T}\), the temporal granularity is a mapping \(G\) from the integers \(\mathbb{Z}\) (set of indexes) to a subset of \(\mathbb{T}\) such that:_  
1. _If_ \(i<j\) _and_ \(G(i)\) _and_ \(G(j)\) _are not empty, then the elements of_ \(G(i)\) _are less than all the elements of_ \(G(j)\)_._
2. _If_ \(i<k<j\) _and_ \(G(i)\) _and_ \(G(j)\) _are not empty, then_ \(G(k)\) _is also not empty._  
In other words, the granularity defines a partition of the temporal domain in elements that are considered indivisible units, called _granules_. Time granularity can be defined as the resolution power of the temporal qualification of a statement. In this paper, we will consider only discrete temporal domains, and the minimum granularity is given by an interval of one minute. Therefore, a temporal duration or _temporal interval_ will be measured as the number of minutes between two granules. For the purposes of this study, we consider only non-negative temporal intervals. Accordingly, we define a temporal interval as an element of the set \(\mathbb{N}\), where \(\mathbb{N}\) denotes the set of natural numbers including zero, following the standard algebraic definition [46]. The environment under investigation is characterized by the following underlying hypothesis, which will be formalized as a whole in Definition 3. * An agricultural robot periodically describes a trajectory during its farming operations that potentially touches all elements of a set \(\mathcal{P}\) of predefined and well-identified Pols. The visit order is not predefined, and there are no precedence constraints. Moreover, some Pols in \(\mathcal{P}\) could be skipped during a specific trajectory. * Each Pol \(p\in\mathcal{P}\) could be reached directly or indirectly by passing through other Pols, so there could be more than one path connecting the same pair of PoIs. \begin{table}
\begin{tabular}{l l} \hline \hline
**Symbol** & **Meaning** \\ \hline \(\mathbb{T}\) & temporal domain \\ \(\mathcal{P}\) & set of Pols \\ \(V\) & set of nodes representing Pols \\ \(E\) & set of edges between Pols \\ \(\mathcal{P}\) & set of Pols \\ \(\mathcal{L}\) & node labeling \\ \(t_{p}\) & time for measuring in \(p\in\mathcal{P}\) \\ \(c_{p}\) & time for charging in \(p\in\mathcal{P}\) \\ \(\hat{\varepsilon}\) & edge labeling \\ \(m_{ij}\) & time for moving from \(i\in\mathcal{P}\) to \(j\in\mathcal{P}\) \\ \(e_{ij}\) & energy consumed for moving from \(i\in\mathcal{P}\) to \(j\in\mathcal{P}\) \\ \(\gamma\) & robot trajectory \\ \(\mu\) & measuring trajectory \\ \(\xi\) & charging trajectory \\ \(\tau_{\gamma}\) & time for completing \(\gamma\) \\ \(x\) & contextual measure \\ \(\delta=\langle d_{1},\ldots,d_{n}\rangle\) & contextual dimensions \\ \(\rho=\langle w_{1},\ldots,w_{n}\rangle\) & context \\ \(\tau(p,q)\) & reward for going from \(p\) to \(q\) \\ \(\varsigma\) & charging level of the robot \\ \(\ell\) & position of the robot \\ \(\sigma(p,q)\) & checks if \(p=q\) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: List of used symbols. * There is no fixed direction in visiting Pols; namely, the robot can go forward and backward among the Pols. * The robot is equipped with a device able to sample some climatic variables during the execution of its tasks.