This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Modelling and Search-Based Testing of Robot Controllers Using Enzymatic Numerical P Systems

Radu Traian Bobe   Florentin Ipate   Ionuţ Mihai Niculescu Department of Computer Science, Faculty of Mathematics and Computer Science, University of Bucharest,
Str Academiei 14, Bucharest, 010014, Romania radu.bobe@s.unibuc.ro florentin.ipate@unibuc.ro ionutmihainiculescu@gmail.com
Abstract

The safety of the systems controlled by software is a very important area in a digitalized society, as the number of automated processes is increasing. In this paper, we present the results of testing the accuracy of different lane keeping controllers for an educational robot. In our approach, the robot is controlled using numerical P systems and enzymatic numerical P systems. For tests generation, we used an open-source tool implementing a search-based software testing approach.

keywords:
tests generation, numerical P systems, enzymatic numerical P systems, search-based software testing, cyber-physical systems, membrane computing

1 Introduction

Due to the remarkable technological progress of late years, software applications tend to have a considerable role in solving most problems of everyday life. The medical, financial or automotive fields are just three of the main areas in which software products are intensively used. Given the importance of these areas in every individual’s life, ensuring product quality and functionality is an essential step in the development process. The safety of software systems for large-scale use is ensured by testing. Software testing aims to validate the fulfillment of the requirements defined for the developed product, as well as to identify possible unwanted behaviors triggered by simulating certain operational contexts.

In this paper, we propose an approach for testing two different lane keeping controllers designed to move an educational robot called E-puck [9]. Both controllers are based on numerical P systems, introduced by G. Păun and R. Păun in [12]. We also provide an equivalent version for the models using enzymatic numerical P systems, an extension of numerical P systems, defined by A. Pavel et al. in [10]. For this experiment we used some reliable tools which will be introduced in the following sections.

The paper is structured as described: Section 2 presents the P system variants to be used in the paper. Section 3 introduces the working environment, including the tools used. Section 4 describes the models and the main differences between them, while Section 5 illustrates the testing approach along with the results. In the end, Section 6 presents the future work and conclusions.

2 Preliminaries

Membrane computing is a field of research introduced by Gh. Păun in [11, 13]. The computational paradigm was originally inspired by the structure and functionality of the living cells. Several classes of membrane systems (P systems) have been later defined and investigated, being classified according to the structure of the membranes as cell-like, tissue-like and neural-like P systems. Membrane computing has made significant breakthroughs in the last decades in fields like computer science, economics or biology. Depending on the requirements, extensions of the main concept were introduced and our experiment involves two of these types: numerical P systems and enzymatic numerical P systems.

2.1 (Enzymatic) Numerical P System

The (enzymatic) numerical P systems [12, 10] are computational models that only inherit the membrane structure from the membrane systems, more exactly a cell-like membrane structure. The membranes contain variables and their values are processed by the programs on every time unit. The whole system is synchronized by a global clock in discrete time units.

The (enzymatic) numerical P system (EN P system) is defined by the tuple:

Π=(m,H,μ,(𝑉𝑎𝑟1,𝑃𝑟1,𝑉𝑎𝑟1(0)),,(𝑉𝑎𝑟m,𝑃𝑟m,𝑉𝑎𝑟m(0)))\varPi\ \mathit{=(m,H,\mu,(Var_{1},Pr_{1},Var_{1}(0)),\dots,(Var_{m},Pr_{m},Var_{m}(0)))} (1)

where:

  • m1\mathit{m}\geq 1 is degree of the system Π\Pi (the number of membranes);

  • H\mathit{H} is an alphabet of labels;

  • μ\mu is membrane structure;

  • 𝑉𝑎𝑟i\mathit{Var_{i}} is a set of variables from membrane i,1im\mathit{i,1\leq i\leq m};

  • 𝑉𝑎𝑟i(0)\mathit{Var_{i}(0)} is the initial values of the variables from region i,1im\mathit{i,1\leq i\leq m};

  • 𝑃𝑟i\mathit{Pr_{i}} is the set of programs from membrane i,1im\mathit{i,1\leq i\leq m}.

    The program 𝑃𝑟li,i\mathit{Pr_{l_{i},i}}, 1limi1\leq\mathit{l_{i}}\leq\mathit{m_{i}} has one of the two following forms:

    1. i)

      non-enzymatic

      Fli,i(x1,i,,xk,i)c1,i|v1+c2,i|v2++cmi,i|vmi\mathit{F_{l_{i},i}(x_{1,i},\dots,x_{k,i})\rightarrow c_{1,i}|v_{1}+c_{2,i}|v_{2}+\dots+c_{m_{i},i}|v_{m_{i}}}

      where Fli,i(x1,i,,xk,i)\mathit{F_{l_{i},i}(x_{1,i},\dots,x_{k,i})} is the production function, c1,i|v1+c2,i|v2++cmi,i|vmi\mathit{c_{1,i}|v_{1}+c_{2,i}|v_{2}+\dots+c_{m_{i},i}|v_{m_{i}}} is the repartition protocol, and x1,i,,xk,i\mathit{x_{1,i},\dots,x_{k,i}} are variables from VariVar_{i}. Variables v1,v2vmiv_{1},v_{2}\dots v_{m_{i}} can be from the region where the programs are located, and to its upper and inner compartments, for a particular region ii. If a compartment contains more than one program, only one will be chosen in non-deterministically manner.

    2. ii)

      enzymatic

      Fli,i(x1,i,,xk,i)|eic1,i|v1+c2,i|v2++cmi,i|vmi\mathit{F_{l_{i},i}(x_{1,i},\dots,x_{k,i})|_{e_{i}}\rightarrow c_{1,i}|v_{1}+c_{2,i}|v_{2}+\dots+c_{m_{i},i}|v_{m_{i}}}

      where ei\mathit{e_{i}} is an enzymatic variable from 𝑉𝑎𝑟i\mathit{Var_{i}}, ei{x1,i,,xk,i,v1,,vmi}\mathit{e_{i}\notin\{x_{1,i},\dots,x_{k,i},v_{1},\dots,v_{m_{i}}\}}. The program can be applied at time t\mathit{t} only if ei>𝑚𝑖𝑛(x1,i(t),,xk,i(t))\mathit{e_{i}>min(x_{1,i}(t),\dots,x_{k,i}(t))}. The programs that meet this condition in a region will be applied in parallel.

When the program is applied by the system at time t0t\geq 0, the computed value

qli,i(t)=Fli,i(x1,i(t),,xk,i(t))j=1nicj,i\mathit{q_{l_{i},i}(t)=\frac{F_{l_{i},i}(x_{1,i}(t),\dots,x_{k,i}(t))}{\displaystyle\sum_{j=1}^{n_{i}}c_{j,i}}}

represents the unitary portion that will be distributed to the variables v1,,vn\mathit{v_{1},\dots,v_{n}}, proportional to coefficients c1,i,,cmi,i\mathit{c_{1,i},\dots,c_{m_{i},i}}, where cj,i𝐍+\mathit{c_{j,i}\in\mathbf{N}^{+}} and the received values will be qli,i(t)c1,i,,qli,i(t)cmi,i\mathit{q_{l_{i},i}(t)\cdot c_{1,i},\dots,q_{l_{i},i}(t)\cdot c_{m_{i},i}}.

The values of variables, from t1\mathit{t-1}, present in the production functions are consumed, reset to zero, and their new value is the sum of the proportions distributed to variable through the repartition protocols, if they appear in them or remain at the value zero.

3 Experimental environment

In this section we will provide brief descriptions of the tools we integrated in our experiment. Firstly, we used an open-source software which allows the simulation of numerical P systems and enzymatic numerical P systems. The simulator is called PeP and will be introduced later in this section. Since we don’t have the physical education robot involved in this study, we also used a dedicated platform for robot simulations, called Webots. For tests generation, we used a tool which won the SBST Tool Competition 2022 [5]. We will discuss later in this section the arguments for using a search-based testing tool.

3.1 PeP simulator

PeP simulator [15] is an open-source product developed by A.Florea and C.Buiu, used for simulations based on numerical P systems and enzymatic numerical P systems. The program is written in Python and receives numerical P systems as an input file. The input file includes the membrane structure and the contents of each membrane, being stored in memory and executed.
PeP can be used as a stand-alone tool for simple simulations and run from the command line with some options, like the number of simulations steps or a csv document generation containing the values at each step of the simulation. As observed in [15], the tool comes with a set of basic input files examples, both numerical P systems and enzymatic numerical P systems.

Besides the simplicity of running this tool, another advantage which can be taken into account when using PeP is that it can be used as an integrated module in complex projects. We used this approach in our experiment in order to make a controller accepted by the robot simulation platform and able to receive information from the platform. In our lane keeping experiments, the simulation ends when the robot drives off the generated lane or when the lane is kept until the end.

3.2 Webots and E-puck

Webots is a robotics simulation software which allows the user to construct a complex environment for programming, modelling and simulating mobile robots. The environment can include multiple scene objects with different properties which can be set from the graphic interface or from the generation files [8]. In addition, the robots can be equiped with a large number of objects called nodes, like sensors, camera, GPS, LED, light sensor etc.
In our approach, additionally to the original equipments of E-puck, we used a GPS attached to the turret slot in order to examine the coordinates at each step of the simulation. The scenes, called ”worlds” in Webots, are containing the road that the robot will try to follow. The roads are generated with Ambiegen, a tool that will be described later in this section. Each world is defined by a .wbt file. The objects can be edited in this file and we used this option in order to place the road object in the scene with coordinates exported from Ambiegen. Additional functionalities, like sensors or GPS can also be added to the robot by editing the world file which will be imported in Webots, obtaining the visual representation of the scene.

As mentioned before, for this experiment we used a robot widely known from educational and research purposes, called E-puck. At the moment, the robot has some capabilities that are not implemented in Webots, but considering the fact that both hardware and software components of E-puck are open source, this remains a challenging opportunity [2].

E-puck has eight infrared proximity sensors placed around the body [9]. For lane keeping simulation, we used just six of them: the two sensors placed in front and the four placed two on each side. This aspect can be easily adapted by changing the membrane structure and creating new membranes if more sensors are needed or deleting a few of them if required. Each sensor has a corresponding membrane in the numerical P system model and the association was made in the controller. The robot has two motors attached to the body along with two wheels, and the speed value is also changeable from the controller.

3.3 Ambiegen

Ambiegen is an open-source tool that utilizes evolutionary search for the generation of test scenarios for autonomous systems. It can be used in experiments involving lane keeping assist systems and robots navigating a room with obstacles [7]. The software is developed in Python and uses evolutionary search [17] for tests generation. The main goal of Ambiegen in this approach is to generate roads as test cases in order to challenge E-puck to keep the lane. The tool exports the roads in separate text files as a sequence of points, representing the road spine. From this points, we can build the road with a proportional size to E-puck.

Challenging different LKAS (Lane Keeping Assist Systems) involves a large diversity of road topologies in order to detect the behavior in limit situations, such as narrow curves. Ambiegen figures out the solution for diversity by using a multi-objective genetic algorithm for search-based test generation, called Non-dominated Sorting Genetic Algorithm-II (NSGA-II) [3]. In Ambiegen implementation, NSGA-II has two-objectives: to increase the fault revealing power of test cases and to preserve their diversity [6]. This multi-objective approach, which combines roads generation with a high attention to diversity along with remarkable results at the competition mentioned above, attracted our curiosity to integrate Ambiegen with Webots and testing E-puck on the roads resulted.

3.4 Experimental Procedure

Considering the above information, we will detail the way we worked with the presented tools. PeP and Ambiegen are developed in Python and so is the robot controller.
First of all, we could easily integrate PeP with E-puck controller using the PeP module which allowed us to parse the numerical P system model as an input file for controller. Achieving this, the model membranes were associated with controller variables. Names and constant values (e.g., robot cruise speed) were taken using a text file containing membrane’s values of the variables. The values were chosen empirically.

Next is a pseudocode version of the main loop in our controller, which performs the simulation steps.

Algorithm 1 Simulation steps performing algorithm
1:repeat
2:     for i=1 to number_of_sensors do
3:         sensor_membrane(i)value(i)\textit{sensor\_membrane}(i)\leftarrow\textit{value}(i)      
4:     run one simulation step
5:     read lw, rw from P system
6:     leftMotorlw\textit{leftMotor}\leftarrow\textit{lw}
7:     rightMotorrw\textit{rightMotor}\leftarrow\textit{rw}
8:until  the end of the road or E-puck goes out of the road

Another challenge for us was to move the robot on the roads exported from Ambiegen with the above presented approach. Ambiegen exports the roads as .json files along with informations like test outcome, maximum curvature coefficient etc. We took the road points from the file and wrote them in the world file.

Webots provides the possibility to extend the set of scene nodes by adding custom nodes created by users. The mechanism is called PROTO and is described in [14]. After a node is extending with the PROTO interface, it can be instantiated from the Webots graphic interface.

We used this technique to retrieve the points forming the spines of the roads generated by Ambiegen and putting them into the wayPoints of the Road node. Using javascript, used as scripting language by the PROTO, we constructed new nodes illustrating the roads from Ambiegen. Then, in the graphic interface of Webots, the road is represented in accordance with the road from Ambiegen. With minimal Python code additions we plotted each generated road with the corresponding spine to confirm that the shape illustrated in Webots respects the original one.

4 Models

In this section we will present two models used to control the robot, the core of the controller. The controller receives data from proximity sensors, that measure distances to obstacles from the environment, to determine the direction of movement of a differential two wheeled robot, E-puck, in our case.

The proximity sensor has a range of 4 cm; if the obstacles are further than this limit the sensor returns the value of 0. The proximity sensors are placed on the left and right side of the robot in the direction of its movement at different angles.

The first model was taken from [4] and adapted. The equations that calculate the linear and angular velocity are shown below:

𝑙𝑒𝑓𝑡𝑆𝑝𝑒𝑒𝑑=\displaystyle\mathit{leftSpeed}= 𝑐𝑟𝑢𝑖𝑠𝑒𝑆𝑝𝑒𝑒𝑑+i=1n𝑤𝑒𝑖𝑔ℎ𝑡𝐿𝑒𝑓𝑡i𝑝𝑟𝑜𝑥i\displaystyle\mathit{cruiseSpeed}+\displaystyle\sum_{i=1}^{n}\mathit{weightLeft_{i}}\cdot\mathit{prox_{i}}
𝑟𝑖𝑔ℎ𝑡𝑆𝑝𝑒𝑒𝑑=\displaystyle\mathit{rightSpeed}= 𝑐𝑟𝑢𝑖𝑠𝑒𝑆𝑝𝑒𝑒𝑑+i=1n𝑤𝑒𝑖𝑔ℎ𝑡𝑅𝑖𝑔ℎ𝑡i𝑝𝑟𝑜𝑥i\displaystyle\mathit{cruiseSpeed}+\displaystyle\sum_{i=1}^{n}\mathit{weightRight_{i}}\cdot\mathit{prox_{i}}

The 𝑙𝑒𝑓𝑡𝑆𝑝𝑒𝑒𝑑\mathit{leftSpeed} and 𝑟𝑖𝑔ℎ𝑡𝑆𝑝𝑒𝑒𝑑\mathit{rightSpeed} are the speeds of the two wheels of the robot. The enzymatic numerical P system described below encapsulates this behavior.
The first model is defined as follows:

Π=M1(m,H,μ,(𝑉𝑎𝑟1,𝑃𝑟1,𝑉𝑎𝑟1(0)),,(𝑉𝑎𝑟m,𝑃𝑟m,𝑉𝑎𝑟m(0)))\varPi\mathit{{}_{M_{1}}=(m,H,\mu,(Var_{1},Pr_{1},Var_{1}(0)),\dots,(Var_{m},Pr_{m},Var_{m}(0)))}

where:

  • m=k3+3,k=6\mathit{m=k\cdot 3+3,k=6}, where k\mathit{k} is the number of proximity sensors;

  • H={s,sc}i=1k{ci,si,wi}\mathit{H=\{s,s_{c}\}\cup\displaystyle\bigcup_{i=1}^{k}\{c_{i},s_{i},w_{i}\}};

  • μ=[[[]s1[]w1]c1[[]sk[]wk]ck[]sc]s;\mathit{\mu=[[[]_{s_{1}}[]_{w_{1}}]_{c_{1}}\dots[[]_{s_{k}}[]_{w_{k}}]_{c_{k}}[]_{s_{c}}]_{s};}

  • 𝑉𝑎𝑟s={xsl,xsr},𝑉𝑎𝑟sc={xsc},\mathit{Var_{s}=\{x_{s_{l}},x_{s_{r}}\},Var_{s_{c}}=\{x_{s_{c}}\},}
    𝑉𝑎𝑟ci={xci,sl,xci,sr,xci,wl,xci,wr,eci},1ik,\mathit{Var_{c_{i}}=\{x_{c_{i},s_{l}},x_{c_{i},s_{r}},x_{c_{i},w_{l}},x_{c_{i},w_{r}},e_{c_{i}}\},1\leq i\leq k,}
    𝑉𝑎𝑟si={xsi,i},1ik,\mathit{Var_{s_{i}}=\{x_{s_{i},i}\},1\leq i\leq k,}
    𝑉𝑎𝑟wi={xwi,wl,xwi,wr,ewi},1ik\mathit{Var_{w_{i}}=\{x_{w_{i},w_{l}},x_{w_{i},w_{r}},e_{w_{i}}\},1\leq i\leq}k;

  • 𝑉𝑎𝑟i(0)=0,1ik\mathit{Var_{i}(0)=0,1\leq i\leq k};

  • 𝑃𝑟s={0xslxsr1|xsl+1|xsr}\mathit{Pr_{s}=\{0\cdot x_{s_{l}}\cdot x_{s_{r}}\rightarrow 1|x_{s_{l}}+1|x_{s_{r}}\}};
    𝑃𝑟sc={3xsc1|xsc+1|xsl+1|xsr}\mathit{Pr_{s_{c}}=\{3x_{s_{c}}\rightarrow 1|x_{s_{c}}+1|x_{s_{l}}+1|x_{s_{r}}\}};
    𝑃𝑟ci={xci,slxci,wl|eci1|xsl,\mathit{Pr_{c_{i}}=\{x_{c_{i},s_{l}}\cdot x_{c_{i},w_{l}}|_{e_{c_{i}}}\rightarrow 1|x_{s_{l}},}
                xci,srxci,wr|eci1|xsr},1ik\mathit{x_{c_{i},s_{r}}\cdot x_{c_{i},w_{r}}|_{e_{c_{i}}}\rightarrow 1|x_{s_{r}}\},1\leq i\leq k};
    𝑃𝑟si={3xsi,i1|xsi,i+1|xci,sl+1|xci,sr},1ik\mathit{Pr_{s_{i}}=\{3x_{s_{i},i}\rightarrow 1|x_{s_{i},i}+1|x_{c_{i},s_{l}}+1|x_{c_{i},s_{r}}\},1\leq i\leq k};
    𝑃𝑟wi={2xwi,wl|ewi1|xwi,wl+1|xci,wl,\mathit{Pr_{w_{i}}=\{2x_{w_{i},w_{l}}|_{e_{w_{i}}}\rightarrow 1|x_{w_{i},w_{l}}+1|x_{c_{i},w_{l}},}
                2xwi,wr|ewi1|xwi,wr+1|xci,wr},1ik\mathit{2x_{w_{i},w_{r}}|_{e_{w_{i}}}\rightarrow 1|x_{w_{i},w_{r}}+1|x_{c_{i},w_{r}}\},1\leq i\leq k};

The meaning of the variables from the model is the following:

  • \circ

    xsl\mathit{x_{s_{l}}} and xsr\mathit{x_{s_{r}}} from the region s\mathit{s} represent 𝑙𝑒𝑓𝑡𝑆𝑝𝑒𝑒𝑑\mathit{leftSpeed} and 𝑟𝑖𝑔ℎ𝑡𝑆𝑝𝑒𝑒𝑑\mathit{rightSpeed}, the sum of the products are accumulated in s\mathit{s} ;

  • \circ

    xsc\mathit{x_{s_{c}}} from the compartment sc\mathit{s_{c}} is 𝑐𝑟𝑢𝑖𝑠𝑒𝑆𝑝𝑒𝑒𝑑\mathit{cruiseSpeed};

  • \circ

    each pair of weights, 𝑤𝑒𝑖𝑔ℎ𝑡𝐿𝑒𝑓𝑡i\mathit{weightLeft_{i}} and 𝑤𝑒𝑖𝑔ℎ𝑡𝑅𝑖𝑔ℎ𝑡i\mathit{weightRight_{i}}, resides in the regions wi\mathit{w_{i}}, 1ik\mathit{1\leq i\leq k};

  • \circ

    for each proximity sensor, 𝑝𝑟𝑜𝑥i\mathit{prox_{i}}, a compartment is defined, namely sis_{i}, containing a single variable, xsi,i\mathit{x_{s_{i},i}}, 1ik\mathit{1\leq i\leq k};

  • \circ

    the products are calculated by two distinct programs, 𝑤𝑒𝑖𝑔ℎ𝑡𝐿𝑒𝑓𝑡i𝑝𝑟𝑜𝑥i\mathit{weightLeft_{i}\cdot prox_{i}}, and 𝑤𝑒𝑖𝑔ℎ𝑡𝑅𝑖𝑔ℎ𝑡i𝑝𝑟𝑜𝑥i\mathit{weightRight_{i}\cdot prox_{i}}, 1ik\mathit{1\leq i\leq k}, in the compartments ci\mathit{c_{i}}.

The second model is an improvement on the first one. First we define the function

f(x)={1,if x=00,otherwisef(x)=\begin{cases}1,&\text{if }x=0\\ 0,&\text{otherwise}\end{cases}

This function will be used in the equations describing the behavior of the model and in the production functions from the programs.

The equations describing the behavior are:

𝑤𝑒𝑖𝑔ℎ𝑡𝐿𝑒𝑓𝑡=\displaystyle\mathit{weightLeft}= i=1n𝑤𝑒𝑖𝑔ℎ𝑡𝐿𝑒𝑓𝑡i𝑝𝑟𝑜𝑥i\displaystyle\displaystyle\sum_{i=1}^{n}\mathit{weightLeft_{i}}\cdot\mathit{prox_{i}}
𝑤𝑒𝑖𝑔ℎ𝑡𝑅𝑖𝑔ℎ𝑡=\displaystyle\mathit{weightRight}= i=1n𝑤𝑒𝑖𝑔ℎ𝑡𝑅𝑖𝑔ℎ𝑡i𝑝𝑟𝑜𝑥i\displaystyle\displaystyle\sum_{i=1}^{n}\mathit{weightRight_{i}}\cdot\mathit{prox_{i}}
𝑙𝑒𝑓𝑡𝑆𝑝𝑒𝑒𝑑=\displaystyle\mathit{leftSpeed}= 𝑐𝑟𝑢𝑖𝑠𝑒𝑆𝑝𝑒𝑒𝑑𝑤𝑒𝑖𝑔ℎ𝑡𝐿𝑒𝑓𝑡+f(𝑤𝑒𝑖𝑔ℎ𝑡𝐿𝑒𝑓𝑡)𝑐𝑟𝑢𝑖𝑠𝑒𝑆𝑝𝑒𝑒𝑑\displaystyle\mathit{cruiseSpeed}\cdot\mathit{weightLeft+f(weightLeft)}\cdot\mathit{cruiseSpeed}
𝑟𝑖𝑔ℎ𝑡𝑆𝑝𝑒𝑒𝑑=\displaystyle\mathit{rightSpeed}= 𝑐𝑟𝑢𝑖𝑠𝑒𝑆𝑝𝑒𝑒𝑑𝑤𝑒𝑖𝑔ℎ𝑡𝑅𝑖𝑔ℎ𝑡+f(𝑤𝑒𝑖𝑔ℎ𝑡𝑅𝑖𝑔ℎ𝑡)𝑐𝑟𝑢𝑖𝑠𝑒𝑆𝑝𝑒𝑒𝑑\displaystyle\mathit{cruiseSpeed}\cdot\mathit{weightRight+f(weightRight)}\cdot\mathit{cruiseSpeed}

The model is defined as follows:

Π=M2(m,H,μ,(𝑉𝑎𝑟1,𝑃𝑟1,𝑉𝑎𝑟1(0)),,(𝑉𝑎𝑟m,𝑃𝑟m,𝑉𝑎𝑟m(0)))\varPi\mathit{{}_{M_{2}}=(m,H,\mu,(Var_{1},Pr_{1},Var_{1}(0)),\dots,(Var_{m},Pr_{m},Var_{m}(0)))}

where:

  • m=3k+3,k=6;\mathit{m=3k+3,k=6;}

  • H={s,w,sc}i=1k{ci,si,wi}\mathit{H=\{s,w,s_{c}\}\cup\displaystyle\bigcup_{i=1}^{k}\{c_{i},s_{i},w_{i}\}};

  • μ=[[[[]s1[]w1]c1[[]sk[]wk]ck[]sc]w]s;\mathit{\mu=[[[[]_{s_{1}}[]_{w_{1}}]_{c_{1}}\dots[[]_{s_{k}}[]_{w_{k}}]_{c_{k}}[]_{s_{c}}]_{w}]_{s};}

  • 𝑉𝑎𝑟s={xsl,xsr},𝑉𝑎𝑟w={xwl,xwr,ew},𝑉𝑎𝑟sc={xsc},\mathit{Var_{s}=\{x_{s_{l}},x_{s_{r}}\},Var_{w}=\{x_{w_{l}},x_{w_{r}},e_{w}\},Var_{s_{c}}=\{x_{s_{c}}\},}
    𝑉𝑎𝑟ci={xci,sl,xci,sr,xci,wl,xci,wr,eci},1ik,\mathit{Var_{c_{i}}=\{x_{c_{i},s_{l}},x_{c_{i},s_{r}},x_{c_{i},w_{l}},x_{c_{i},w_{r}},e_{c_{i}}\},1\leq i\leq k,}
    𝑉𝑎𝑟si={xsi,i},1ik,\mathit{Var_{s_{i}}=\{x_{s_{i},i}\},1\leq i\leq k,}
    𝑉𝑎𝑟wi={xwi,wl,xwi,wr,ewi},1ik\mathit{Var_{w_{i}}=\{x_{w_{i},w_{l}},x_{w_{i},w_{r}},e_{w_{i}}\},1\leq i\leq k};

  • 𝑉𝑎𝑟i(0)=0,1ik\mathit{Var_{i}(0)=0,1\leq i\leq k};

  • 𝑃𝑟s={0xslxsr1|xsl+1|xsr}\mathit{Pr_{s}=\{0\cdot x_{s_{l}}\cdot x_{s_{r}}\rightarrow 1|x_{s_{l}}+1|x_{s_{r}}\}};
    𝑃𝑟w={xscxwl+f(xwl)xsc|ew1|xsl,\mathit{Pr_{w}=\{x_{s_{c}}\cdot x_{w_{l}}+f(x_{w_{l}})\cdot x_{s_{c}}|_{e_{w}}\rightarrow 1|x_{s_{l}},}
                xscxwr+f(xwr)xsc|ew1|xsr}\mathit{x_{s_{c}}\cdot x_{w_{r}}+f(x_{w_{r}})\cdot x_{s_{c}}|_{e_{w}}\rightarrow 1|x_{s_{r}}\}};
    𝑃𝑟sc={xsc1|xsc}\mathit{Pr_{s_{c}}=\{x_{s_{c}}\rightarrow 1|x_{s_{c}}\}};
    𝑃𝑟ci={xci,slxci,wl|eci1|xsl,\mathit{Pr_{c_{i}}=\{x_{c_{i},s_{l}}\cdot x_{c_{i},w_{l}}|_{e_{c_{i}}}\rightarrow 1|x_{s_{l}},}
                xci,srxci,wr|eci1|xsr},1ik\mathit{x_{c_{i},s_{r}}\cdot x_{c_{i},w_{r}}|_{e_{c_{i}}}\rightarrow 1|x_{s_{r}}\},1\leq i\leq k};
    𝑃𝑟si={3xsi,i1|xsi,i+1|xci,sl+1|xci,sr},1ik\mathit{Pr_{s_{i}}=\{3x_{s_{i},i}\rightarrow 1|x_{s_{i},i}+1|x_{c_{i},s_{l}}+1|x_{c_{i},s_{r}}\},1\leq i\leq k};
    𝑃𝑟wi={2xwi,wl|ewi1|xwi,wl+1|xci,wl,\mathit{Pr_{w_{i}}=\{2x_{w_{i},w_{l}}|_{e_{w_{i}}}\rightarrow 1|x_{w_{i},w_{l}}+1|x_{c_{i},w_{l}},}
                2xwi,wr|ewi1|xwi,wr+1|xci,wr},1ik\mathit{2x_{w_{i},w_{r}}|_{e_{w_{i}}}\rightarrow 1|x_{w_{i},w_{r}}+1|x_{c_{i},w_{r}}\},1\leq i\leq k};

As we see from the definition of the ΠM1\varPi\mathit{{}_{M_{1}}} and its equations, in the proximity of an obstacle, roadside, the speed of the wheel on the side with the obstacle increases according to the weights. In certain circumstances, particularly related to the geometry of a tight road curve, the sum between travel speed and the weights results in a rotation in the opposite direction of the obstacle, but a slight forward motion still continues, causing the robot to leave the road.

The second model, ΠM2\varPi\mathit{{}_{M_{2}}}, overcomes this problem by calculating the product of the travel speed and the sum of the weights. In a similar situation, the second model performs an angular rotation, in the opposite direction to the obstacle, and when the proximity sensors no longer detect obstacles, it continues moving forward with a constant velocity. This behavior is modeled by compartment w\mathit{w}.

In the next section, it can be seen that the ΠM2\varPi\mathit{{}_{M_{2}}} model has better behavior in similar situations compared to the first model.

5 Simulation Results

Having presented the way we integrate the tools along with the models we will detail in this section the testing stage. Ambiegen offers the possibility to configure the setup for its genetic algorithms, choosing the values for parameters like population size, number of generations, mutation rate or crossover rate. Also, aspects like the amount of time allocated for tests generation, map size, out of bound percent from which the test is considered as failed can be set easily from the command line, when executing the main Python file used in [5].

Refer to caption
Test 1
Refer to caption
Test 2
Refer to caption
Test 3
Refer to caption
Test 4
Figure 1: Illustration of different road tests

After series of trials we kept the default values, so we used the population size 100 with 75 generations. Mutation rate is 0.4 and crossover rate is 1. These values can be changed from the internal configuration file of Ambiegen. From the command line we chose the time budget allocated to generation and execution to be 1800 seconds and the map size to 200x200 meters which is the default value. For the out of bound percentage we also kept the default value (95%). After each simulation, Ambiegen exported roads spines coordinates as text files and we also plotted each generated road, as mentioned before. Then we could easily chose different roads based on the number of curves and their angle as the main criteria to diversify the tests that were supposed to be given to E-puck controller in Webots.

Next we report some roads along with the simulation results. The road is marked with grey, whilst the trajectory using the first model is represented with red. The trajectory of the second model (the improved one) is colored with green.

In Figure 1 we can see the results of different roads tests. We observe that Test 1, being the simplest test of the above presented, is passed by both models. In the next scenarios, the complexity of the road increases and only the improved model can pass.

From all the experiments, we noticed that the first model (the one marked with red in results) cannot pass a huge majority of tests with curves, whilst the improved model performs a rotation movement when the road is curved and for this reason it manages to advance until the end of the road. Additional tests were added to [16].

6 Conclusions and Future Work

In this paper we presented an approach to test different enzymatic numerical P systems models using modern tools and search-based generated tests. We evaluated our approach on a research and educational robot called E-puck, virtually represented in Webots simulator. We set up our working environment incorporating the tools with different scripts created to ensure a smooth integration between them and also a better data processing. We formally described each model involved and then showed the differences between the lane-keeping controllers resulted when using each of them. As future work, we will investigate the possibility to dynamically calculate the values for weights, which are at the moment empirically assigned. Based on the controller behavior during the previous tests, the weights values will be automatically adapted. Also, we will try to develop a method to generate more complex roads in order to better challenge the controllers.

References

  • [1]
  • [2] Micael S Couceiro, Patricia A Vargas & Rui P Rocha (2014): Bridging the reality gap between the Webots simulator and e-puck robots. Robotics and Autonomous Systems 62(10), pp. 1549–1567, 10.1016/j.robot.2014.05.007.
  • [3] Kalyanmoy Deb, Amrit Pratap, Sameer Agarwal & TAMT Meyarivan (2002): A fast and elitist multiobjective genetic algorithm: NSGA-II. IEEE transactions on evolutionary computation 6(2), pp. 182–197, 10.1109/4235.996017.
  • [4] Andrei George Florea & Cătălin Buiu (2017): Modelling multi-robot interactions using a generic controller based on numerical P systems and ROS. In: 2017 9th International Conference on Electronics, Computers and Artificial Intelligence (ECAI), pp. 1–6, 10.1109/ECAI.2017.8166411.
  • [5] Alessio Gambi, Gunel Jahangirova, Vincenzo Riccio & Fiorella Zampetti (2022): SBST tool competition 2022. In: Proceedings of the 15th Workshop on Search-Based Software Testing, pp. 25–32, 10.1145/3526072.3527538.
  • [6] Dmytro Humeniuk, Giuliano Antoniol & Foutse Khomh (2022): AmbieGen tool at the SBST 2022 Tool Competition. In: Proceedings of the 15th Workshop on Search-Based Software Testing, pp. 43–46, 10.1145/3526072.3527531.
  • [7] Dmytro Humeniuk, Foutse Khomh & Giuliano Antoniol (2023): AmbieGen: A Search-based Framework for Autonomous Systems Testing. arXiv preprint arXiv:2301.01234, 10.48550/arXiv.2301.01234.
  • [8] Olivier Michel (2004): Cyberbotics ltd. webots™: professional mobile robot simulation. International Journal of Advanced Robotic Systems 1(1), p. 5, 10.5772/5618.
  • [9] Francesco Mondada, Michael Bonani, Xavier Raemy, James Pugh, Christopher Cianci, Adam Klaptocz, Stephane Magnenat, Jean-Christophe Zufferey, Dario Floreano & Alcherio Martinoli (2009): The e-puck, a robot designed for education in engineering. In: Proceedings of the 9th conference on autonomous robot systems and competitions, IPCB: Instituto Politécnico de Castelo Branco, pp. 59–65.
  • [10] Ana Pavel, Octavian Arsene & Catalin Buiu (2010): Enzymatic numerical P systems-a new class of membrane computing systems. In: 2010 IEEE Fifth International Conference on Bio-Inspired Computing: Theories and Applications (BIC-TA), IEEE, pp. 1331–1336, 10.1109/BICTA.2010.5645071.
  • [11] Gheorghe Păun (2002): Membrane computing: an introduction. Springer Science & Business Media, 10.1007/978-3-642-56196-2.
  • [12] Gheorghe Păun & Radu Păun (2006): Membrane computing and economics: Numerical P systems. Fundamenta Informaticae 73(1-2), pp. 213–227. Available at http://content.iospress.com/articles/fundamenta-informaticae/fi73-1-2-20.
  • [13] Gheorghe Păun, Grzegorz Rozenberg & Arto Salomaa, editors (2010): The Oxford Handbook of Membrane Computing. Oxford University Press.
  • [14] Webots reference manual https://cyberbotics.com/doc/reference/proto.
  • [15] A. G. Florea and C. Buiu, “PeP - an open-source software simulator of Numerical P systems and Numerical P systems with Enzymes,” 2017. [Online]. Available: https://github.com/andrei91ro/pep.
  • [16] Github simulation results folder https://github.com/radubobe/Research/tree/main/Modelling%20and%20testing%20robot%20controllers%20using%20ENPS/Simulation%20results.
  • [17] Darrell Whitley, Soraya Rana, John Dzubera & Keith E Mathias (1996): Evaluating evolutionary algorithms. Artificial intelligence 85(1-2), pp. 245–276, 10.1016/0004-3702(95)00124-7.