# PDDL Task Planning for Tunnel Spraying Based on a Multivariate Coating Accumulation Model
## 2 Methods
### Spray Gun Action Sequence Planning
#### 2.3.2 Domain File Creation  
The PDDL domain file (domain.pddl) for tunnel spraying tasks describes the domain knowledge of the spraying task. It uses states and actions to model the tunnel spraying task. The state is mainly represented by types, predicates, and functions, while actions are described through preconditions, add effects, and delete effects. Figure 10: Modeling process of tunnel spraying task planning. Figure 9: Schematic diagram of sweep layer path endpoint calculation. Actions are executed to change the state. The structure is shown in Figure 11. The relevant content definitions in the tunnel spraying PDDL domain file are shown in Table 1.  
In the types section, the layers are divided into the patching layer (patching), filling layer (fill), and sweeping layer (surface). The stopping points for the patching layer, the grid stopping points for the filling layer, and the spray gun motion endpoints for the sweeping layer are all unified and defined as spray target points (wp). Since continuous straight-line motion (L_motion) and continuous curved motion (C_motion) are required in the sweeping layer, the target points in the sweeping layer are further divided into straight-line motion type (Lm) and curved motion type (Cm) based on these constraints. Additionally, the action executor (robot) is defined. Predicates mainly describe the state of the spray gun and the target points. For instance, at?robot indicates the target point where the spray gun is located, next-to?wp1?wp2 denotes that two target points are adjacent, visited?wp and unvisited?wp indicate whether a target point has been visited, and is-fill?wp and is-unfill?wp indicate whether the target point has been sprayed. The functions define the distance between adjacent target points (distance?wp1?wp2) the movement speed of the spray gun between target points during patching and filling operations (robot_speed?robot) and the spraying thickness required at a target point (T?wp). The definition of an action includes five components. The action_name refers to the name of the action, while parameters define the parameters associated with the action. Moreover, duration indicates the duration, which can either be a fixed value or a time function that determines the value. Additionally, condition represents the preconditions for the action, and effect describes the results following the execution of the action, as shown in Figure 12.  
Since the spraying methods differ between layers, the actions need to be categorized based on the layer. For example, the patching layer actions are move1 and spray1, representing the movement action between patching operation points and the spraying action at stopping points. The filling layer actions are move2 and spray2, representing the movement action between filling operation points and the spraying action at grid stopping points. L_motion and C_motion represent the continuous straight-line spraying action and continuous arc spraying action in the sweeping layer, respectively. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Types** & **Predicates** & **Functions** & **Action** \\ \hline patching fill surface—wp & at?robot & distance?wp1?wp2 & move1 \\ Lm Cm—surface & next-to?wp1?wp2 & robot\_speed?robot & spray1 \\ robot & visited?wp & T?wp & move2 \\  & unvisited?wp & & spray2 \\  & is-fill?wp & & L\_motion \\  & is-unfill?wp & & C\_motion \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Definition of related content in the PDDL domain file for spraying task planning. Figure 11: Schematic diagram of the PDDL domain file structure. To ensure the correct execution of the actions corresponding to different tasks, the constraints of the target point's layer and state are pre-built into the parameters and preconditions of the action definitions. These constraints must be satisfied when executing the corresponding actions for each layer.