Model for selecting a route for the transport of hazardous materials using a fuzzy logic system

: Introduction/purpose: The paper presents a model for the selection of a route for the transport of hazardous materials using fuzzy logic systems, as a type of artificial intelligence systems. The system presented in the paper is a system for assistance in the de-cisionmaking process of the traffic service authorities when choosing one of several possible routes on a particular path when transporting hazardous materials. Methods: The route evaluation is performed on the basis of five criteria. Each input variable is represented by three membership functions, and the output variable is defined by five membership functions. All rules in a fuzzy logic system are determined by applying the method of weight premise aggregation (ATPP), which allows the formation of a data-base based on experience and intuition. Based on the number of input variables and the number of their membership functions, the basic base of 243 rules is defined. Three experts from the Ministry of Defense were interviewed to determine the weighting co-efficients of the membership functions, and the values of the coefficients were determined using the Full Consistency Method (FUCOM). Results: A user program which enables the practical application of this model has been created for the developed fuzzy logic system. Conclusion: The user platform was developed in the Matlab 2008b software package.


INTRODUCTION
When managing the transport of hazardous materials (hazmat), special attention is paid to mitigate the negative consequences of transport, especially those that affect the safety of the population and the environment.One of the main problems of transport management is the selection of a route for the transport of hazmat, due to the harmfulness and possible consequences of accidental situations.With the development of technology, there is an increasing application of modern software systems based on artificial intelligence in solving the problem of transporting hazmat.Artificial intelligence offers possibilities for the development of automatic control systems, route optimization systems, as well as decision support systems.Although this technology has been present for some time, the possibility of its application in the transport of hazmat has not been fully researched.
The Ministry of Defense and the Serbian Armed Forces have not yet developed a model based on artificial intelligence that solves the problems of hazmat routing.The paper presents a model for the selection of a route for the transport of hazardous materials using fuzzy logic systems, as a type of artificial intelligence systems.The system presented in the paper is a system for assistance in the decisionmaking process of the traffic service authorities when choosing one of several possible routes on a particular path when transporting hazmat.The evaluation of the route is performed on the basis of five criteria, which are: the length of the route, the exposure of the population, the impact on the environment, the reaction speed of rescue services, and the probability of a traffic accident.These criteria were defined after a literature analysis and the interviews with experts from the Ministry of Defense.After entering the value of the input criteria in the user form, calculation and evaluation are performed.A preference to the entered route is given as an output from the fuzzy system.
The presented model was tested during the selection of a route for the transport of motor fuel.Three routes were considered for a given distance.After the calculation and evaluation of individual routes, the values of the output variables of the fuzzy system were obtained in the user form and the preference for a route was obtained in the form of a numerical value and a linguistic descriptor (Kayapinar Kaya, 2020).Based on the system output values for each route, the ranking and selection of the route with the highest preference value was performed.A user program has been created for the developed fuzzy logic system, which enables the practical application of this model.The user platform was developed in the Matlab 2008b software package.
The rest of the paper is structured throughout several other sections.In the second section, there is a review of the literature related to the problems of hazmat transport and routing.The third section presents the development of a new fuzzy logic system for hazmat routing.The fourth section is a case study presenting the problem in detail and the fuzzy logic system to solve it.Finally, there are concluding considerations with further research suggestions moving in several different directions.

LITERATURE REVIEW
A large number of authors deal with the problems of transport and routing of hazmat.Solutions to these problems are widely used in civilian structures, using modern software and information systems as decisionmaking support.Despite a good basis, due to more frequent transport of hazmat, explosives, propellants, etc., they have not found a wider application in the military system.The most common methods and criteria used in solving such problems are described below.
According to Starčević and Gošić (2014), the first step in managing the transport of hazmat is to determine the dangerous substance being transported and the consequences it has on the population and the environment.Then, it is important to determine the amount of dangerous goods transported, as well as the flows of dangerous goods between its source and destination, based on which the load of dangerous goods can be carried out and restrictions that may affect the choice of transport route (physical restrictions, ecological zones, restrictions within the framework of legal regulations, etc.).In the next phase, alternatives and criteria for route selection are defined, on the basis of which those that meet all previously set requirements are selected from the set of roads that serve sources and destinations.After defining the potential route and sections within it for the transport of oil and oil derivatives, the risk assessment process is carried out for each of the sections separately.The parameters for the analysis were divided into two groups.The first group includes: road category, geometric characteristics of the road, access control, existence of level crossings, condition of the road, size of the traffic flow, participation of trucks in the traffic flow, congestion in the traffic flow, and traffic accidents.The second group of parameters consists of: population density, land use, population response to the incident situation, environmental impact, road drainage system, response time of rescue services (ambulance, fire and police), speed limit, and climatic influences (weather conditions).Depending on the probability of occurrence and the consequences of incident situations, risk assessment is performed by forming a risk matrix for each section and comparing the risk with the allowed values.If the risk degree on all sections is satisfying, the transport can be performed by the chosen route.
In order to establish a more precise method for determining possible risks on certain sections, various dispersive models are used.The concentration level can be calculated as a function of distance and the measured weather (climate change) parameters can be used in the GPM (Gausian plume model) and the GIS (Geographic Information System).In their paper Zhang et al. (2000), applied an approach from the aspect of expected consequences.Risk is defined as a consequence of possible side effects (injuries, diseases, death) and effects on the population.As the risk factor for each section on the network must be calculated for the transport of hazmat, the use of the GPM (instead of the length of the section) as a factor is used to determine the point and degree of pollution spreading.In order to simplify the method, rasterization is performed using a GIS system where a certain space is transformed into a mosaic network of rectangles, or pixels.The network is organized in the form of layers (maps), where each of them represents a certain characteristic so that each pixel on each layer represents the same location.Each pixel has its own number of rows and columns, transferred to the Cartesian coordinate system, x= column × cell size (pixels) and y= row × cell size.Using the coordinate system, the distance and the direction are calculated.
According to Milovanović et al. (2012), the method for determining the optimal route for the transport of hazmat consists of eleven steps and can be applied to all groups of hazardous substances except for the substances from the seventh group (radioactive substances).The first step involves defining the type of hazardous substance, the characteristics of the hazard, and the zone of influence of hazardous substances.Then, the total amount of hazardous material being transported is defined as well as the amount at the source.The third step includes determining the source and the destination, followed by the formation of the initial-final matrix of vehicle movement and then determining the load of roads with hazmat.The next step includes the analysis of the established restrictions, both legal and ecological (ecological zones, sensitive natural areas), after which alternatives, acceptable routes, continuity of routes, alternative routes and slowdowns that may occur on the selected routes are defined.The seventh step of the method is to define the criteria for choosing the optimal route.The basic criteria used was the existing source and destination locations, the roads most commonly used to transport hazmat, the use of roads reserved for the movement of trucks, the minimization of the transport route between the source and the destination, and the reduction of potentially endangered areas.The next step is to define the parameters for the risk analysis which include the parameters of the impact of the possibility of the occurrence of an incident situation and the parameters of the impact of the extent of the consequences of the incident situation.The last three steps are to define the impact of each parameter on the basis of expert monitoring, to implement a method for determining the optimal route as well as to identify, correct, and approve the route.Frank et al. (2000) presented risk mitigation by selecting specific routes and elimination by using the SDSS (Spatial Decision Support System).The cycling system is the coverage of real roads on the territories of the target countries, as well as a multitude of loading and unloading points (laid and civilian points).The system is designed for route selection over long distances.In order to minimize costs and travel time, long-distance transportation should be done by highways, which means passing through populated areas and high exposure of the population to risk.Settlements can be avoided by using slower and bypass roads.Using the SDSS, several alternative transport routes are generated based on one optimizing criterion.The most commonly used approach is a combination of several criteria and their transformation into one criterion.This criterion is usually a linear function of the risk to the population, distance, travel time and the probability of an incident situation.Another approach is the choice of routes with multiple goals, where by minimizing travel time and exposing the population to risk, a larger number of routes are obtained, which include a large number of bypass routes suitable for practical application.Nevertheless, this approach is considered impractical.Another approach is to minimize one cost attribute while limiting the sum of other cost attributes.For example, travel time, as a direct cause of final costs, is minimized while other attributes -population exposure, distance, possibility, and consequences of the incident -are constant.
In their paper Barilla et al. (2009), discussed the problem of integration of different sources of risk, different hazards and different elements exposed to risk and their sensitivity.The method is based on the application of a multi-criteria and multi-attribute analysis.Factors related to the economic problems of hazmat transport are considered to ensure the economic sustainability of transport, while human factors and natural hazards are taken as risk factors, and the population and facilities will be considered as elements exposed to risk.The applied model determines a possible risk on each route and, based on the set criteria, it selects a route with minimal risk.The criteria considered in this method are: minimization of travel time, transport route, risk to the population, risk to the urban environment, and risks related to natural hazards.As a product of this methodology, various solutions are obtained, representing a specific tool for decision-making support.
Using MOMR (Multiple Objective Mathematical Programming), Castillo (2004) estimated different and conflicting goals in order to calculate the optimal route for the transport of hazmat regarding the optimizing criterion.The optimizing criterion is flexible and depends on who participates in the decision making and its requirements.The objectives used as route optimization criteria are to minimize travel time, transport route, population risk, urban risk, and natural hazards.Pamučar et al. (2016) combine adaptive neural networks (ANFIS-Adaptive Neuro Fuzzy Inference System) and the Dijkstra's algorithm as a method for calculating the optimal route for the transport of hazmat through urban areas.In the first phase of the ANFIS-D method, a transport network is formed in the urban area and the input criteria are defined on the basis of which the values of branches in the network are determined.The criteria taken to define the value of branches in the network are: speed of response of emergency services, risk associated with environmental impact, risk of traffic accidents, consequences of traffic accidents, risk associated with infrastructure facilities, and risk of terrorist attacks.To define the values of the branches in the network, an adaptive neural network is formed where the input data are the previously listed criteria.In the second phase, the initial fuzzy logic system is constructed and the adaptive neural network is trained using the Artificial Bee Colony (ABC), where the value of a specific branch in the network is obtained as an output.The algorithm is repeated until each branch in the network is assigned a value.After determining the value of the branches using the Dijkstra algorithm, the optimal route for the transport of dangerous goods is determined.
In his paper Milovanović (2012), considers the problems in the selection of routes for the transport of hazmat from the aspect of the analysis of individual and social risk, as well as the levels of absolute and specific risks.A specific risk is derived quantity that estimates the percentage of damage of a certain element exposed to risk that can be expected in an incident situation, while an absolute risk is a quantification of a specific risk expressed as the product of the specific risk value and the element exposed to risk.The individual risk degree means the rate of suffering of an individual, as a member of the social community, who is constantly exposed to hazmat on an annual basis.Social risk is defined as the cumulative value of the probability of an accident with several casualties in the zone of hazmat influence.Based on the research and the methods applied in Italy, the USA and the Netherlands, the author improves these methods through 11 steps.The first five steps include the first phase of risk management, hazard identification, and consequence analysis.They include determining the hazmat type, determining the hazmat quantity, determining the source and the destination points, and forming a matrix of original target movements of vehicles, determining the load on the road network restrictions.The sixth and seventh steps include defining alternatives for the analysis (which are acceptable routes, continuity of the route, alternative routes, possible delays during transport) and defining the criteria for route selection.After these two steps, routes are obtained that meet all the requirements and needs for the transport of hazmat.However, the obtained routes must be checked from the aspect of the allowed degree of risk.Risk assessment is performed by defining the parameters for risk analysis (the parameters that affect the probability of an incident situation and the parameters related to the size of the consequences) and then it is necessary to connect each parameter with the size of the risk and determine its weighting factor.The size of weight factors was determined by surveying experts in the field of transport of hazmat, who stated the degree of the influence of the parameters on the choice of a route for transport of dangerous goods on a scale from 0 to 4, where 0 represents a value where a parameter has no influence on route selection and 4 represents a parameter that has a critical impact.After the above, a risk assessment is performed for each of the sections of the selected routes, where by comparing the obtained values with the allowed level of risk, a decision is made whether the observed section is suitable for transport of hazmat or not.This comparison of values for each section on a particular route leaves the possibility of defining alternative sections that would connect the previous and the next section between which there was a section that is not acceptable in terms of risk level or mitigate the consequences or reduce the posibility of incident in order to reduce risk.Thus, the section will re-enter the process of considering eligibility for the transport of hazmat.Based on the previous review of the literature that considers different methods for selection and optimization of the route for transport of hazmat, it was determined that the authors used different criteria.Based on that, the criteria used in this research were defined.The most commonly used criteria in selecting the optimal route for the transport of dangerous goods are shown in Table 1.In this research, a fuzzy logic system was used to create a model for the selection of a route for the transport of hazmat in the Ministry of Defense and the Serbian Armed Forces (SAF), as one of the models of artificial intelligence, because it is the basis for decision making in a dynamic environment.The analysis of the literature showed that there is no software based on artificial intelligence that is used to select a route for the transport of dangerous goods in the Ministry of Defense and the SAF.Based on the analysis of the literature and the interviewing of experts from the Ministry of Defense, the criteria that represent the input variables in the software based on artificial intelligence are defined.The criteria and their descriptions are presented in Table 2.The distance (expressed in km) that the vehicle travels when transporting hazardous materials 2 Impact/Exposure of the population Degree of the impact of the consequences of incident situations on the population.
3 Environmental impact Degree of the impact of the consequences of incident situations on the environment.

4
Speed of response of rescue services (ambulance, firefighters, police) The time during which city services (fire services, emergency services and police) react in case of incidents.The average response time is taken as the input parameter.

Probability of a traffic accident
The impact of road sections on which due to the characteristics of the section (terrain configuration, traffic density, railway crossings, traffic quality, enemy action, etc.) exists an increased risk of a traffic accident.

FUZZY LOGIC SYSTEM
Fuzzy logic is used to model complex systems in which it is difficult to determine the interdependence between individual elements of the system by applying other methods.The creator of fuzzy logic is considered to be Lotfi Zadeh (1975aZadeh ( , 1975bZadeh ( , 1975c)), who in 1973 first spoke about the use of mathematical tools to represent spoken language and human knowledge by introducing the terms fuzzy rule and linguistic variable into the theory of automatic control.Fuzzy logic itself is based on the theory of fuzzy sets that were introduced with the basic goal of representing and modeling uncertainty in linguistics in a mathematically formalized way.Unlike classical sets where an element either belongs or does not belong to a defined set, a fuzzy set is a set of elements with similar characteristics, where the membership of an element can be any real number in the interval [0.1].The main difference between these two types of sets is that classical sets always have a unique membership function, while for a fuzzy set there are infinitely many different membership functions by which it can be described.
Fuzzy relations are used to represent the conection between elements that are valid to some degree.
In the case of binary relations, e.g."<" (Less), two elements can either satisfy or not satisfy the relation (Precup et al, 2020).In relations that are not binary (which is often the case), for example: there is a weak connection, there is a middle connection, there is a close connection, the strength of the relation is expressed by expressions that show gradualness.The fuzzy relation between the elements is satisfied to a certain extent, which is expressed as a number from the interval [0.1].
One of the basic rules of fuzzy logic is fuzzy composition, where the composition of two fuzzy relations gives a new relation.The composition must satisfy transitivity, associativity, and symmetry.A fuzzy statement contains linguistic values, and the truth of the statement is a number from the interval [0.1] ( Vesković et al, 2020).
Fuzzy reasoning does not contradict the rules of logical reasoning, but it cannot use them in their original form, because the result of logical reasoning is only a part of possible conclusions when using fuzzy sets and fuzzy variables.The complex rule of reasoning was proposed by Zadeh (Zadeh, 1965) and it symbolically reads: x R y means that x and y are connected by a fuzzy relation R (x, y).If we denote "x is A" by the fuzzy set A, then the meaning of "y is B" can be calculated as (Kushwaha et al, 2020): (1)  = ⸰ which represents the composition of the fuzzy set and a fuzzy relation.
The rules used in the fuzzy system, obtained on the basis of expert knowledge, can be expressed using a certain number of linguistic rules in spoken or artificial language words and serve as a link between the inputs and outputs of the fuzzy system.All rules consist of two parts: the IF part which represents the input state and the fuzzy proposition represents the premise, and the THEN part which represents the output state and the fuzzy proposition represents the conclusion.The if-then rules are interrelated with the expression else.In addition to this conjunction, they also can be connected by the conjunction and.There are two ways to define the rules that differ in that part.The first way is the classic rule format proposed by Zadeh, and the second rule format was proposed by Takagi and Sugeno.
The classic rule format: Rule: IF<fuzzy statement>THEN<fuzzy statement where the fuzzy statement may be an atomic statement or a complex statement, e.g.
The Tagaki-Sugeno rule format: Unlike the classic format, the Takagi-Sugeno format contains a fuzzy statement only in the IF part of the rule, and the THEN part is defined by a function whose arguments are input fuzzy variables.A special case is when a constant is used instead of a function, e.g.

and v is 12
More than one rule needs to be defined to describe a particular fuzzy system.These rules are executed in parallel, connected by an operator else (union), so the execution of n parallel rules can be expressed using the fuzzy relation: ( where R k refers to the k-th rule. When the classical implication fuzzy system is used, only true variables are considered, while untruths are not considered.In the case of using the Takagi-Sugeno format, the implication is already defined in the THEN part (function or constant).
A number of rules for defining a fuzzy system in which words describe the solution to a problem is called a rule base or expert rules.In reality, the input variables are usually represented by a number, and the output value is obtained in the numerical form.Since the given system is described verbally (qualitatively) through production rules, first, numerical values are converted (fuzzyfied) by applying a fuzzy logical operation.After that, they are processed by the mechanism of approximate reasoning in the fuzzy system through the phases of aggregation, activation, and accumulation, and the numerical output value is obtained by the process of defuzzyfication.
Aggregation is a phase in which certain values of the membership function are added to the measured numerical value, i.e. it is a process by which it is determined with which degree of confidence (truth level) an input numerical value belongs to a given fuzzy set.In the case where there is only one input, aggregation is equivalent to fuzzyfication.
Activation is the conclusion drawn in the THEN part of the rule.There are two methods of activation, MIN (minimum) and PROD (product) methods.The MIN method performs truncation, while the PROD method performs scaling, proportional reduction of the conclusion.
In the process of accumulation, all activated conclusions are accumulated.Accumulation is usually realized through two methods: MAX and SUM.By applying the MAX method, the final shape is obtained as the union of two fuzzy sets, while by applying the SUM method the final contours are obtained as the algebraic sum of the contours obtained by the activation process.If the obtained sum is greater than one, then it is normalized to the value of one.When the type of approximate reasoning mechanism is specified, then it is the MIN-MAX or PROD-SUM method.
Defuzzyfication is the operation of converting the resulting fuzzy set into a real number.Just as fuzzy systems can be divided into two groups, so can defuzzyfication methods be divided into Mamdani and Sugeno (or Takagi-Sugeno).Since mathematical defuzzyfication is represented as mapping a vector (value of a linguistic variable) into a real number, there is a reduction of information.Information reduction occurs because different values of a linguistic variable can be mapped to the same converted real number.Therefore, it is necessary to be very careful when choosing a method for defuzzyfication, because there is no method that is optimal for all cases.
The analysis of input-output mappings is performed in order to notice the influence of the choice of membership functions and their arrangement on the shape of the output, the set of possible solutions (Badi et al, 2019).The dependence of one output on another one can be shown by a graph of the function, and its analysis helps in selecting the membership function and forming rules.The shape of the curve on the graph can be controlled to some extent by manipulating the membership functions.

MODELING A FUZZY LOGIC SYSTEM FOR ROUTE SELECTION FOR TRANSPORT OF DANGEROUS GOODS
Based on the described concept, the basis is created to model the system of interdependence of input criteria as a complex fuzzy system for the selection of a route for the transport of hazardous materials.It goes through several phases in order to reach the final solution, which in general modeling represents system design, optimization and application.In the fuzzy model, the stages gone through to reach a final solution can be defined as: • Problem analysis, • Defining linguistic variables, • Selection of membership functions, • Forming a database of rules, • Selection of inference and defasing methods, and • Application of a fuzzy model.

Problem analysis
A detailed analysis of the problem, when modeling a fuzzy logic system, is performed to determine the number of variables and their interdependence.In case the problem is complex, the system can be divided into several smaller subsystems, the goal and purpose of each subsystem is determined, after which the way of connecting these subsystems and the priorities between them are determined.

Defining liguistic variables
As previously explained, linguistic variables take values from spoken language or are artificially synthesized and represented by fuzzy sets.It is pointed out that the designed fuzzy system contains five linguistic variables, as follows: • Route length, • Exposure of the population, • Environmental impact, • Response speed of rescue services, and • Probability of a traffic accident, including the output linguistic variable Route preference.The values of the input variables include the intervals listed in the Table 3.
Once the linguistic variables have been defined, the number and type of membership functions need to be determined for all input and output variables.The higher the number of membership functions, the higher is the number of rules, which can make it difficult to set up the system, so it is advisable to start with the smallest number of functions, in accordance with the nature of the variable.Reducing the number of functions must not be done to the harm of the quality of the description of the variable.
Based on that, it was decided that in the model each input variable (route length, population exposure, environmental impact, speed of response of rescue services and probability of an accident) has three membership functions, and the output variable (route preference) five membership functions.The linguistic values of all input variables are Small, Medium and Large, while the values of the output linguistic variable are Very Small, Small, Medium, Large, and Very Large.
A larger number of linguistic values were not needed since it is a decision support system, so it does not require enormous precision.With three linguistic values, a satisfactory gradual change in output values was achieved, which limits the number of rules to 243 and enters the domain that the expert can control.

Selection of a membership functions
An important phase in modeling a fuzzy logic system is the choice of membership functions and their arrangement on the membership interval.In the initial phase of system design, triangular functions were chosen as membership functions.However, their adjustment does not provide sufficient system sensitivity.Therefore, Gaussian bells functions were used in the system as they well describe the input and output variables and allow for satisfactory system sensitivity.Figure 1 and Figure 2 show the membership functions of the input and output variables.The values of the membership functions of the input variables are shown in Table 4, where the first number in the interval represents the left and right distributions of the Gaussian curve along the abscissa, and the second number represents the value at which the Gaussian curve reaches the maximum.

Forming a database of rules
Linguistic rules are constructed as a link between inputs and outputs.In complex systems, one of the major problems is the lack of a standard and systematic method for transforming expert knowledge or experience into fuzzy rules (Pamučar & Ćirović, 2013;Jovanović et al, 2014).Another problem is the lack of a universal method for determining the optimal number of rules, given that many factors influence such a decision, and this is important for the speed of the system.
The expert domain is primarily entered through production rules.Initially, it is important that for each combination of input values of linguistic variables, the expert suggests an appropriate output value (Ćirović et al, 2014).As the system has five input linguistic variables (n=5) with three linguistic values each (M=3), they can be combined in the database with a total of M n = 3 5 = 243 rules.
All rules for the fuzzy logic system are determined by applying the aggregation weight premise rules method (ATPP), Božanić and Pamučar (2014).There are many methods for constructing a rule base of a fuzzy logic system from a known set of numerical values, but the ATPP method allows the creation of a rule base based on experience and intuition.The steps of the ATPP methods are as folows: Step 1: Determination of the weight coefficients of the membership functions of the input variables.
For the weight coefficients of the membership functions, the condition applies: (3) ∑    ()  =1 =    where: (j) -weight coefficient of the membership function, j = 1, ..., m, (m total number of membership functions), Most often, w (xi) (j) is determined based on the subjective assessment of the expert modeling a fuzzy logic system.However, in addition to subjective assessment, the weight coefficient of the membership function can be determined by group decision-making and the aggregation of experts.The distribution of the weight coefficients of the membership functions should reflect reality as much as possible.In this particular case, w (xi) (j) was determined by interviewing experts and applying the FUCOM (Full Consistency Method) method (Pamučar et al, 2018;Bozanic et al, 2019;Fazlollahtabar et al, 2019;Puška et al, 2019;Erceg & Mularifović, 2019;Durmić, 2019;Nenadić, 2019;Žižović & Pamucar, 2019;Bozanic et al, 2020;Durmić et al, 2020).Three experts were interviewed, and the results of the calculation of the weight coefficients are shown in Table 5. Lingo software was used to solve this problem and for the calculation.
Expert 1 -min ε Step 2: Generate an initial "incomplete" rule base with the maximum number of combinations N input (X i ) variables and the output variable (Y) are described with different numbers of the membership functions.Starting from that, it is necessary to determine the maximum number of rules, i.e. the maximum number of combinations (c) by which the membership functions can be combined.The initial rule base contains only the premises (the IF part of the rule) or the combinations of all membership functions of the input variables of the fuzzy logical system (x i (j) ).The initial "incomplete" base of the R rule is displayed in the form of a matrix as: Step 3: Generating a "complete" rule base by assigning appropriate conclusions (y i (r) ) to premises (x i (j) ).Generating a complete rule base begins with the formation of a matrix R 'in which combinations of input pairs are replaced by weighting coefficients (w (xi) (j) ). (8 2 (1) … (1) 1 (2) 1 (2) 3 (2) … (2) 1 (3) 2 (3) After forming the matrix R ', the elements of the matrix are summed in rows: where y + represents the upper limit of the confidence interval [y -, y + ] of the output variable Y.After this, it is necessary to determine the degree of belonging of the real number w j to the membership function y (r) of the output variable Y (10)  () = max�  ∩ μ  () � Step 4: Optimization of the number of rules, elimination of redundant rules.
When generating the rule base, each pair of the membership functions (x i (j) ) of the input variables (X i ) is associated with the corresponding membership function (y (r) ) of the output variable (Y).After defining the rule base, redundant rules that unnecessarily burden the system are eliminated.Elimination is performed when there are two or more rules that have similar or the same combination of the membership functions of the input / output variables.In this case, what is left is a rule whose sum of weight coefficients of the membership functions, contained in the rule, is higher.

If we mark:
A

Selection of inference and defasing methods
The most commonly used methods for direct inference are MIN-MAX and PROD-SUM (Mamdani method).In the initial phase of system development, the MIN-MAX method was used.This method is a common choice when it is not important to manage the entire confidence interval of the output variable.However, a large number of system simulations have shown that the MIN-MAX method is unsuitable.One of the basic requirements was to achieve a satisfactory level of system sensitivity, which means that with certain small changes in the input, the output from the fuzzy system must also have small changes, which could not be achieved by applying the MIN-MAX method.Figure 3 and Figure 4 show the graphical representations of the solution according to the MIN-MAX method in the form of the interdependence of the solution and two input variables.The settings could not achieve the desired shape, and even if the desired shape was obtained, it would be valid only for certain values of the input variables.It can be seen from the figure that the system obtained using the MIN-MAX method is very insensitive.The insensitivity of the system is represented by the plateaus on the figures.
The settings could not achieve the desired shape, and even if the desired shape was obtained, it would be valid only for certain values of the input variables.By changing the parameters, the surface would look even less acceptable, and thus the system would be even less sensitive.In order to increase the sensitivity of the system, the PROD-SUM method of direct inference was used, as the best offered by the Matlab software package.The reasoning process in a fuzzy logic system takes place by the fuzzyfication of the values of the input variables at the very beginning.In the fuzzyfication process, the membership functions defined for the input variables are applied to the actual value of the input variable to determine the degree of affiliation for the premise of each of the rules in the database.For example, if the Route Length is described by the linguistic descriptor Low, Exposure of the Population described as Medium, Environmental Impact as Medium, Response Speed of Rescue Services as Medium, and Probability of a Traffic Accident described as High.After obtaining these values, the expert system performs the analysis in accordance with the previously defined limits, which represent the membership functions of individual variables.Each variable consists of several fuzzy sets and the purpose of fazzyfication is to determine which fuzzy set "belongs" to each input variable and to represent this affiliation with numerical values in the interval [0,1].
After the fuzzyfication of the input values, the analysis of these values is performed as well as their comparison with the sets of values of the premise of the rule from the rule base.In the case of this system, all rules were activated when entering values.By activating the rules, intermediate solutions are obtained.The union of fuzzy sets is applied to the obtained intermediate results, and on that occasion the resulting fuzzy set is obtained.
The method of the center of gravity (COG) was chosen for the method of defuzzyfication.In the case of a discrete confidence interval, defuzzyfication is calculated according to: where μ i -fuzzy set obtained after the accumulation phase; n -the number of discretization levels of the specified fuzzy set per x; x i -i-th discrete value; and μ(x i )-fuzzyfied value of x i .

APPLICATION OF THE FUZZY SYSTEM
The application of the system is one of the components in the system life cycle.The model should be applied and, if necessary, certain corrections, changes and improvements should be made again, which is relatively easy in a fuzzy system.
A user program has been created for the developed fuzzy logic system, which enables the practical application of this model.The user platform was developed in the Matlab 2008b software package.
Entering "PP" in the command line of the Matlab software package starts the program for selecting the route for the transport of hazardous materials.The user form is shown in Figure 7.The values can be entered by typing or moving the slider keys.By pressing the "Pokreni" (Run) button, the calculation is performed.The output from the fuzzy system is shown in the lower part as a numerical and linguistic value of the preference according to the entered route.
The designed model was tested during the selection of a route for the transport of fuel.Three transport routes were considered and they represent alternatives.
Table 6 shows the values of the input variables in the fuzzy logic system for each route.The values were determined based on a subjective assessment of the model designer.
system, the PROD-SUM method of direct inference was used.The system itself was tested on the choice of route for the transport of motor fuel.One of the advantages of using this system is that the system is adaptive, which is reflected in the ability to configure the base of fuzzy rules.Fuzzy inference rules are essential for managing the transport of hazmat, due to the descriptive approach and the heuristic solution of the problem.Due to the application of the fuzzy logic model, the limitations of conventional evaluation methods are overcome.The solution obtained by applying the fuzzy logic model is obtained on the basis of simple aggregation of criteria values.Also, this system is implemented as a user program within the Matlab software package.As such, it is suitable for application in a dynamic environment and real-time decision making.The described system leaves room for further research that should move the direction of identifying additional parameters that may affect the choice of a route for the transport of dangerous goods and the implementation of additional decision criteria in the presented model.

Figure 2 .
Figure 2. Membership functions of the output variable Рис. 2. Функции принадлежности выходной переменной Слика 2. Функције припадности излазне променљиве -route length, B -exsposure of the population, C -environmental inpact, D -response speed of rescue services, E -probability of a traffic accident, and F -route preference, then the role example is: IF (A is Large) AND (B is Small) AND (C is Medium) AND (D is Medium) AND (E is Small) THEN (F is Large).

Figure 5 and
Figure 5 and Figure 6 graphically show a set of possible solutions of the input variables using the PROD-SUM method.

Table 2 .
Defined criteria for the selection of a route for the transport of hazardousmaterials in the Ministry of De-

Table 3 .
Intervals of input and uotput linguistic varialbes

Table 4 .
Values of the mambership functions of the input varables

Table 5 .
Weight coefficients of the input variables