Fuzzy Logic Tools  v1.0.5.1
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
utilities.hpp
Go to the documentation of this file.
1 /* Copyright (C) 2004-2015
2  ANTONIO JAVIER BARRAGAN, antonio.barragan@diesia.uhu.es
3  http://uhu.es/antonio.barragan
4 
5  Collaborators:
6  JOSE MANUEL ANDUJAR, andujar@diesia.uhu.es
7 
8  DPTO. DE ING. ELECTRONICA, DE SISTEMAS INFORMATICOS Y AUTOMATICA
9  ETSI, UNIVERSITY OF HUELVA (SPAIN)
10 
11  For more information, please contact with authors.
12 
13  This software is free software: you can redistribute it and/or modify
14  it under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  This software is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  GNU General Public License for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with this program. If not, see <http://www.gnu.org/licenses/>.
25 */
26 
27 #ifndef _UTILITIES_HPP_
28 #define _UTILITIES_HPP_
29 
37 #include <stdlib.h>
38 #include <string.h>
39 
40 #include <flt/system.hpp>
41 
42 #ifndef strcmpi
43  #define strcmpi strcasecmp // Make the change to compile in Windows(MinGW) & GNU/Linux(gcc/g++)
44 #endif
45 
46 namespace FLT // Use the FTL (Fuzzy Logic Tools) namespace
47 {
54  int System2TXT(System &S,
55  const char *file);
56 
82  System TXT2System(const char *file);
83 
92  int printSystem(const char *file,
93  System &S,
94  char *inputs[] = NULL,
95  char *outputs[] = NULL,
96  int accuracy = 10);
97 
105  TNT::Array1D<double> evaluate(const double * const point,
106  System &S,
107  System &C);
108 
117  System initialController(System &Plant);
118 
124  System subSystem(System &S,
125  size_t nrules,
126  size_t *outputs,
127  size_t *rules);
128 
138  TNT::Array2D<double> extractPoints(System &S,
139  unsigned int numMeshPoints = 5,
140  double precision = 1E-3,
141  bool addMesh = false,
142  bool onlyStatePoints = true);
143 
144 } // FLT namespace
145 
146 #endif
System subSystem(System &S, size_t nrules, size_t *outputs, size_t *rules)
Extracts a subsystem from a fuzzy System.
Definition: utilities.cpp:398
Defines a general Takagi-Sugeno fuzzy System.
System TXT2System(const char *file)
Reads a fuzzy System from a text file.
Definition: utilities.cpp:30
TNT::Array2D< double > extractPoints(System &S, unsigned int numMeshPoints=5, double precision=1E-3, bool addMesh=false, bool onlyStatePoints=true)
Extracts the representative points of a fuzzy system.
Definition: utilities.cpp:483
Fuzzy Logic Tools (FLT) namespace.
Definition: derivatives.hpp:41
int System2TXT(System &S, const char *file)
Saves the fuzzy System S in a text file.
Definition: utilities.cpp:10
int printSystem(const char *file, System &S, char *inputs[]=NULL, char *outputs[]=NULL, int accuracy=10)
Writes a fuzzy system in its linguistic form.
Definition: utilities.cpp:49
TNT::Array1D< double > evaluate(const double *const point, System &S, System &C)
Evaluates a closed loop fuzzy system in the given point.
Definition: utilities.cpp:139
System initialController(System &Plant)
Creates a fuzzy Controller from a given plant.
Definition: utilities.cpp:302