# Mathematical Algorithm for Risk Assessment of Police Officer in VR Training Simulation
## 4 Algorithm  
The assessment of the risk of actions taken by the students of police specialist courses on the site of a traffic incident is based on a mathematical algorithm implemented in the training VR technology. The method of calculating a virtual assessment of the student's behavior takes two main aspects into account. The first concerns the assessment of the actions carried out. This value consists of performing tasks as well as performing them in the correct sequence. To verify the sequence, the so-called priority of tasks is applied. This allows you to give the same priority to several different tasks. Due to such a procedure, for example, tasks related to providing aid to multiple injured people with the same health condition (color) are given the same priority. This releases the student from the ethical responsibility during the segregation of victims. The verification of the execution of tasks in the system is carried out by marking: \"completed task\" and \"uncompleted task\". The system assigns number one to a completed task, and zero to an uncompleted task. Another component of the first aspect is the virtual life of the officer during a simulation involving a dangerous substance (ADR). In our work we assumed that the student cannot stay in an ADR-contaminated area when performing the tasks. Otherwise, the simulation will be aborted. To help others, the officer must stay safe. The second aspect concerns the complexity of the scenario. The trainer must select factors from the system list when creating a virtual training environment. Whether or not a scenario is difficult to carry out depends on the quantity of these factors and their level of impact. With such diversification, the trainer, when creating a scenario for a group that is more or less advanced, gets information from the system about the difficulty of the scenario. The risk of actions of the officer on the site of a traffic incident is calculated as an instantaneous value for the given simulation moment, t. This allows us to identify elements that are the most problematic for students already in the course of the training. The final risk consists of the risk of actions of the officer during a traffic incident (R) and the assessment of the trainer (OI). The value of 0.4 or 40% of the final risk assessment refers to the assessment calculated by the algorithm and the value of 0.6 refers to the trainer's assessment, which represents 60% of the Rk assessment. This breakdown results from the fact that the trainer decides on the satisfactory completion of the training in the presented training, and only the trainer can evaluate non-standard tasks, such as the trainer's interview with the student. The equation describing the final risk is set out below:  
\[\mathrm{R_{k}}=0.4\cdot\mathrm{R}+0.6\cdot\mathrm{O_{I}} \tag{1}\]  
where \(\mathrm{R_{k}}\)--final risk of actions of the officer on the site of a traffic incident, \(\mathrm{O_{I}}\)--trainer's assessment, and R--risk of actions of the officer on the site of a traffic incident. The R-parameter in Equation (1) is defined as the product of the probability of rational action and the level of difficulty of the scenario is characterized by Equation (2)  
\[\mathrm{R}=\mathrm{P}\cdot\mathrm{N}, \tag{2}\]  
where R--risk of actions of the officer on the site of a traffic incident, \(\mathrm{P}\)--probability of rational action taking, and \(\mathrm{N}\)--level of complexity of the scenario. The risk of actions of the officer on the site of a traffic incident (R) includes the probability of rational action taking during training in virtual reality and the level of complexity of the scenario created by the trainer. The level of complexity (difficulty) of the scenario is made up of the so-called main factors. These were selected on the basis of experience of police officers from road traffic to include the most important elements influencing the training process in virtual reality. In mathematical terms, this is the product of a given factor and its assigned expert weight.