## 4 Creation of Initial Generation  
In this work, a morphology based on the typical expression of sliding mode controllers is employed as an example. However, other morphology could be used as well. Sliding mode control is used because it is known to be robust, can achieve zero steady state error without an integrator and has finite time response.  
It is well known [28; 29] that a typical sliding mode controller for system (1) has the form.  
\[u(e)=f(e)+[k_{s}*sign(\sigma(e))] \tag{4}\]  
where \(k_{s}\) is a constant which will from now on, known as switching gain; the function of the state \(\sigma(e)\) defines the surface \(\sigma(e)=0\) known as the switching or sliding surface and \(f(x)\) is also a function of the state. With the proposed algorithm, it is easy to explore other structures, for example it can be included controllers with the form  
\[u(e)=f(e)\otimes[k_{s}*sign(\sigma(e))] \tag{5}\]  
where all the symbols mean the same than in (4); in addition the operator \(\otimes\in\{+,-,*\}\) is a binary operator chosen at random. Note that morphology (5) is more general than (4).  
Discontinuous right hand systems like the system (1), (5) are slowly to simulate. Due to EA needs a simulation to evaluate each element of a generation, the number of simulations could be big, hence the algorithm execution time could be large in excess. Therefore in some situations can be convenient to approximate the _sign_ function in (5) by a tanh function; So, Expression (5) can be approximated by  
\[u(e)=f(e)\otimes[k_{s}*\tanh(\sigma(e))] \tag{6}\]  
Having the general form of a controller given by (6), the \(i-th\) element of the generation \(k\) can be expressed as  
\[u_{  
the previous forms. Note that there are many nonlinear controllers of the form (6). From the ideas of present and next Sections other morphologies can be implemented.  
A controller with morphology given by (6) can be represented by the tree depicted in Figure 3. It is important to point out that every controller the algorithm generates must have this morphology. To create an element (controller) with the purposed morphology is necessary to:  
* Choice the \(k_{s}\) value
* Choice the \(\otimes\) operator
* Build the function \(f(e)\)
* Build the function \(\sigma(e)\)  
The selection of \(k_{s}\) is straightforward; is just to generate a random number within the interval \([k_{s_{min}},k_{s_{max}}]\). Selection of \(\otimes\) is also direct; it is chosen at random from a list of symbols. To build function \(f(e)\) and \(\sigma(e)\) the process of creating a simple controller, described above is perform. Note, that this is a recursive process. Such process is not difficult to program in high level programming languages such as Python or Lisp-like languages. The code for the algorithm an indeed for all parts of the tool developed in this paper can be consulted in [[https://github.com/control-lab-org/HTSMC](https://github.com/control-lab-org/HTSMC)]([https://github.com/control-lab-org/HTSMC](https://github.com/control-lab-org/HTSMC)) (accessed on 3 July 2023).  
Suppose that \([k_{s_{min}},k_{s_{max}}]=[-2.0,9.0]\) and the depth of trees of \(\sigma(e)\) and \(f(e)\) are \(d_{max}=4\). Then some resulting examples from this process are  
\[u_{0} =[-0.2-(3.2*(e+e))]+[-0.8*\tanh(-1.5*(5.0+(8.1*e)))] \tag{8}\] \[u_{1} =[(3.0*e)+(-0.2+((6.7*e)+e))-[1.0*\tanh((e*e)+(8.1*e))]\] (9) \[u_{2} =[(10*e)]*[7.9*\tanh(5.5*(8.1*(10*e)))] \tag{10}\]