# Petri Net Toolbox for Multi-Robot Planning under Uncertainty
## 3 Materials and Methods
### Model Design
These actions are typically identical across all the topological map. Still, the extended GSPNR model must be able to distinguish when the same action is executed in different regions of the topological map. Thus the algorithm adapts the action models for each node and edge on the topological map. This ensures that the same action on different locations is captured with different names whilst only requiring the manual design of a single model per action. To achieve this the user should use the special symbols \(\langle\rangle\) on the places and transitions names of the designed actions. These angle brackets are used by the algorithm and replaced by the respective node name as defined in lines 5-6 and 21-22 of Algorithm 1. When replacing the angle brackets in edges the algorithm uses the names of the _source_ and _target_ nodes. Consider a place named _Navigating_\(\langle 1\rangle-\langle 2\rangle\) that is part of the navigation action model. This place is renamed to _Navigating_\(\langle NodeA\rangle-\langle NodeB\rangle\) for the edge connecting _Node A_ to _Node B_ and renamed to _Navigating_\(\langle NodeA\rangle-\langle NodeC\rangle\) for the edge connecting _Node A_ to _Node C_. Additionally, the navigation action may take more or less time to execute depending on the region of the topological map where it is being performed. The user can define the duration uncertainty of traversing each edge without designing a different navigation model for each edge. To do this the user must assign a weight to each topological map that should correspond to the average duration of traversing that edge. Algorithm 1 assumes that there is a single timed transition that models the edge traversing uncertainty and sets the rate of that transition to the reciprocal of the edge weight as detailed in line 24. The algorithm also sets the initial state of each robot. This is done by setting the initial marking of the extended GSPNR \(m_{0}\). As it is detailed in lines 35-37, the algorithm adds one token to the place that has the same name as the node where the robot will start. This place was already created when iterating through all the topological map nodes in lines 1-16. The initial node of each robot is provided by the user as the _Pos_ vector. This vector does not require a particular order due to the homogeneous nature of the multi-robot system. Nevertheless if two or more robots start in the same node, this node should be repeated in the _Pos_ vector. Note that the pseudocode detailed in Algorithm 1 is a simplification of the actual implementation. The real implementation, available here [24], checks for wrong inputs and prevents the algorithm from outputting a GSPNR with missing elements. Moreover, instead of the _TopoActions_ function the user can input a simpler function \(NameTopoActions:TopoElements\rightarrow\{action1_{name},\ldots,action_{name}\}\) that only specifies the action names that can be executed in each node of the topological map. In this case, the algorithm uses a template action model identical to the one depicted in Figure 3 and replaces the action name for the one provided in _NameTopoActions_. This lifts the need to understand the GSPNR formalism, and expands the toolbox userbase to a group of users that does not require complex GSPNR models to capture multi-robot systems. To better understand how model composition algorithm works consider the multi-robot navigation example presented in Section 2. Consider that each robot, besides navigating, can also vacuum and mop each location. These are the three actions that the multi-robot system can perform and that need to be modeled. Figure 3 (Left), Figure 3 (Center) and Figure 3 (Right) shows the primitive actions GSPNR model for navigation (\(G_{nav}\)), vacuuming (\(G_{vacuum}\)) and mopping (\(G_{mop}\)), respectively. The brackets allow defining how the places and transitions names should change from one location to the other. These brackets will then be replaced by the names given to the topological map nodes.