%
% API Documentation for Peach - Computational Intelligence for Python
% Module peach.fuzzy.control
%
% Generated by epydoc 3.0beta1
% [Mon Dec 21 08:51:35 2009]
%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                          Module Description                           %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}|(}
\section{Module peach.fuzzy.control}

    \label{peach:fuzzy:control}

This package implements fuzzy controllers, of fuzzy inference systems.

There are two types of controllers implemented in this package. The Mamdani
controller is the traditional approach, where input (or controlled) variables
are fuzzified, a set of decision rules determine the outcome in a fuzzified way,
and a defuzzification method is applied to obtain the numerical result.

The Sugeno controller operates in a similar way, but there is no defuzzification
step. Instead, the value of the output (or manipulated) variable is determined
by parametric models, and the final result is determined by a weighted average
based on the decision rules. This type of controller is also known as parametric
controller.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                               Variables                               %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  \subsection{Variables}

\begin{longtable}{|p{.30\textwidth}|p{.62\textwidth}|l}
\cline{1-2}
\cline{1-2} \centering \textbf{Name} & \centering \textbf{Description}& \\
\cline{1-2}
\endhead\cline{1-2}\multicolumn{3}{r}{\small\textit{continued on next page}}\\\endfoot\cline{1-2}
\endlastfoot\raggedright \_\-\_\-d\-o\-c\-\_\-\_\- & \raggedright \textbf{Value:}
{\tt \texttt{...}}&\\
\cline{1-2}
\raggedright M\-A\-M\-D\-A\-N\-I\-\_\-I\-N\-F\-E\-R\-E\-N\-C\-E\- & \raggedright \textbf{Value:}
{\tt MamdaniImplication, MamdaniAglutination}&\\
\cline{1-2}
\raggedright P\-R\-O\-B\-\_\-I\-N\-F\-E\-R\-E\-N\-C\-E\- & \raggedright \textbf{Value:}
{\tt ProbabilisticImplication, ProbabilisticAglutination}&\\
\cline{1-2}
\raggedright P\-R\-O\-B\-\_\-N\-O\-R\-M\-S\- & \raggedright \textbf{Value:}
{\tt ProbabilisticAnd, ProbabilisticOr, ProbabilisticNot}&\\
\cline{1-2}
\raggedright Z\-A\-D\-E\-H\-\_\-N\-O\-R\-M\-S\- & \raggedright \textbf{Value:}
{\tt ZadehAnd, ZadehOr, ZadehNot}&\\
\cline{1-2}
\raggedright c\-o\-s\- & \raggedright \textbf{Value:}
{\tt {\textless}ufunc 'cos'{\textgreater}}&\\
\cline{1-2}
\raggedright e\-x\-p\- & \raggedright \textbf{Value:}
{\tt {\textless}ufunc 'exp'{\textgreater}}&\\
\cline{1-2}
\raggedright p\-i\- & \raggedright \textbf{Value:}
{\tt 3.14159265359}&\\
\cline{1-2}
\end{longtable}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                           Class Description                           %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Controller \textit{(class)}|(}
\subsection{Class Controller}

    \label{peach:fuzzy:control:Controller}
\begin{tabular}{cccccc}
% Line for object, linespec=[False]
\multicolumn{2}{r}{\settowidth{\BCL}{object}\multirow{2}{\BCL}{object}}
&&
  \\\cline{3-3}
  &&\multicolumn{1}{c|}{}
&&
  \\
&&\multicolumn{2}{l}{\textbf{peach.fuzzy.control.Controller}}
\end{tabular}

\textbf{Known Subclasses:} peach.fuzzy.control.Mamdani

Basic Mamdani controller

This class implements a standard Mamdani controller. A controller based on
fuzzy logic has a somewhat complex behaviour, so it is not explained here.
There are numerous references that can be consulted.

It is essential to understand the format that decision rules must follow to
obtain correct behaviour of the controller. A rule is a tuple given by:
\begin{quote}{\ttfamily \raggedright \noindent
((mx0,~mx1,~...,~mxn),~my)
}\end{quote}

where \texttt{mx0} is a membership function of the first input variable, \texttt{mx1}
is a membership function of the second input variable and so on; and \texttt{my}
is a membership function or a fuzzy set of the output variable.

Notice that \texttt{mx}'s are \emph{functions} not fuzzy sets! They will be applied to
the values of the input variables given in the function call, so, if they
are anything different from a membership function, an exception will be
raised. Please, consult the examples to see how they must be used.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                Methods                                %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  \subsubsection{Methods}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_init\_\_}(\textit{self}, \textit{yrange}, \textit{rules}=\texttt{\texttt{[}\texttt{]}}, \textit{defuzzy}=\texttt{{\textless}function Centroid at 0x885ecdc{\textgreater}}, \textit{norm}=\texttt{{\textless}function ZadehAnd at 0x885eaac{\textgreater}}, \textit{conorm}=\texttt{{\textless}function ZadehOr at 0x885eae4{\textgreater}}, \textit{negation}=\texttt{{\textless}function ZadehNot at 0x885eb1c{\textgreater}}, \textit{imply}=\texttt{{\textless}function MamdaniImplication at 0x885eb54{\textgreater}}, \textit{aglutinate}=\texttt{{\textless}function MamdaniAglutination at 0x885eb8c{\textgreater}})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Creates and initialize the controller.
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{xxxxxxxxxx}

          \item[yrange]

The range of the output variable. This must be given as a set of
points belonging to the interval where the output variable is
defined, not only the start and end points. It is strongly suggested
that the interval is divided in some (eg.: 100) points equally
spaced;
          \item[rules]

The set of decision rules, as defined above. If none is given, an
empty set of rules is assumed;
          \item[defuzzy]

The defuzzification method to be used. If none is given, the
Centroid method is used;
          \item[norm]

The norm (\texttt{and} operation) to be used. Defaults to Zadeh and.
          \item[conorm]

The conorm (\texttt{or} operation) to be used. Defaults to Zadeh or.
          \item[negation]

The negation (\texttt{not} operation) to be used. Defaults to Zadeh not.
          \item[imply]

The implication method to be used. Defaults to Mamdani implication.
          \item[aglutinate]

The aglutination method to be used. Defaults to Mamdani
aglutination.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

      Overrides: object.\_\_init\_\_

    \end{boxedminipage}

    \label{peach:fuzzy:control:Controller:__gety}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Controller \textit{(class)}!peach.fuzzy.control.Controller.\_\_gety \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_gety}(\textit{self})

    \end{boxedminipage}

    \label{peach:fuzzy:control:Controller:__getrules}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Controller \textit{(class)}!peach.fuzzy.control.Controller.\_\_getrules \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_getrules}(\textit{self})

    \end{boxedminipage}

    \label{peach:fuzzy:control:Controller:set_norm}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Controller \textit{(class)}!peach.fuzzy.control.Controller.set\_norm \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{set\_norm}(\textit{self}, \textit{f})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Sets the norm (\texttt{and}) to be used.

This method must be used to change the behavior of the \texttt{and} operation
of the controller.
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{x}

          \item[f]

The function can be any function that takes two numerical values and
return one numerical value, that corresponds to the \texttt{and} result.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

    \label{peach:fuzzy:control:Controller:set_conorm}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Controller \textit{(class)}!peach.fuzzy.control.Controller.set\_conorm \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{set\_conorm}(\textit{self}, \textit{f})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Sets the conorm (\texttt{or}) to be used.

This method must be used to change the behavior of the \texttt{or} operation
of the controller.
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{x}

          \item[f]

The function can be any function that takes two numerical values and
return one numerical value, that corresponds to the \texttt{or} result.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

    \label{peach:fuzzy:control:Controller:set_negation}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Controller \textit{(class)}!peach.fuzzy.control.Controller.set\_negation \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{set\_negation}(\textit{self}, \textit{f})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Sets the negation (\texttt{not}) to be used.

This method must be used to change the behavior of the \texttt{not} operation
of the controller.
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{x}

          \item[f]

The function can be any function that takes one numerical value and
return one numerical value, that corresponds to the \texttt{not} result.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

    \label{peach:fuzzy:control:Controller:set_implication}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Controller \textit{(class)}!peach.fuzzy.control.Controller.set\_implication \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{set\_implication}(\textit{self}, \textit{f})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Sets the implication to be used.

This method must be used to change the behavior of the implication
operation of the controller.
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{x}

          \item[f]

The function can be any function that takes two numerical values and
return one numerical value, that corresponds to the implication
result.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

    \label{peach:fuzzy:control:Controller:set_aglutination}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Controller \textit{(class)}!peach.fuzzy.control.Controller.set\_aglutination \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{set\_aglutination}(\textit{self}, \textit{f})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Sets the aglutination to be used.

This method must be used to change the behavior of the aglutination
operation of the controller.
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{x}

          \item[f]

The function can be any function that takes two numerical values and
return one numerical value, that corresponds to the aglutination
result.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

    \label{peach:fuzzy:control:Controller:add_rule}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Controller \textit{(class)}!peach.fuzzy.control.Controller.add\_rule \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{add\_rule}(\textit{self}, \textit{rule})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Adds a decision rule to the knowledge base.

It is essential to understand the format that decision rules must follow
to obtain correct behaviour of the controller. A rule is a tuple must
have the following format:
\begin{quote}{\ttfamily \raggedright \noindent
((mx0,~mx1,~...,~mxn),~my)
}\end{quote}

where \texttt{mx0} is a membership function of the first input variable,
\texttt{mx1} is a membership function of the second input variable and so on;
and \texttt{my} is a membership function or a fuzzy set of the output
variable.

Notice that \texttt{mx}'s are \emph{functions} not fuzzy sets! They will be
applied to the values of the input variables given in the function call,
so, if they are anything different from a membership function, an
exception will be raised when the controller is used. Please, consult
the examples to see how they must be used.
    \vspace{1ex}

    \end{boxedminipage}

    \label{peach:fuzzy:control:Controller:add_table}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Controller \textit{(class)}!peach.fuzzy.control.Controller.add\_table \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{add\_table}(\textit{self}, \textit{lx1}, \textit{lx2}, \textit{table})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Adds a table of decision rules in a two variable controller.

Typically, fuzzy controllers are used to control two variables. In that
case, the set of decision rules are given in the form of a table, since
that is a more compact format and very easy to visualize. This is a
convenience function that allows to add decision rules in the form of a
table. Notice that the resulting knowledge base will be the same if this
function is used or the \texttt{add{\_}rule} method is used with every single
rule. The second method is in general easier to read in a script, so
consider well.
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{xxxxx}

          \item[lx1]

The set of membership functions to the variable \texttt{x1}, or the
lines of the table
          \item[lx2]

The set of membership functions to the variable \texttt{x2}, or the
columns of the table
          \item[table]

The consequent of the rule where the condition is the line \texttt{and}
the column. These can be the membership functions or fuzzy sets.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

    \label{peach:fuzzy:control:Controller:eval}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Controller \textit{(class)}!peach.fuzzy.control.Controller.eval \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{eval}(\textit{self}, \textit{r}, \textit{xs})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Evaluates one decision rule in this controller

Takes a rule from the controller and evaluates it given the values of
the input variables.
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{xx}

          \item[r]

The rule in the standard format, or an integer number. If \texttt{r} is
an integer, then the \texttt{r} th rule in the knowledge base will be
evaluated.
          \item[xs]

A tuple, a list or an array containing the values of the input
variables. The dimension must be coherent with the given rule.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

      \textbf{Return Value}
      \begin{quote}

This method evaluates each membership function in the rule for each
given value, and \texttt{and} 's the results to obtain the condition. If
the condition is zero, a tuple \texttt{(0.0, None) is returned. Otherwise,
the condition is `{}`imply} ed in the membership function of the output
variable. A tuple containing \texttt{(condition, imply)} (the membership
value associated to the condition and the result of the implication)
is returned.
      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

    \label{peach:fuzzy:control:Controller:eval_all}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Controller \textit{(class)}!peach.fuzzy.control.Controller.eval\_all \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{eval\_all}(\textit{self}, *\textit{xs})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Evaluates all the rules and aglutinates the results.

Given the values of the input variables, evaluate and apply every rule
in the knowledge base (with the \texttt{eval} method) and aglutinates the
results.
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{xx}

          \item[xs]

A tuple, a list or an array with the values of the input variables.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

      \textbf{Return Value}
      \begin{quote}

A fuzzy set containing the result of the evaluation of every rule in
the knowledge base, with the results aglutinated.
      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

    \label{peach:fuzzy:control:Controller:__call__}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Controller \textit{(class)}!peach.fuzzy.control.Controller.\_\_call\_\_ \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_call\_\_}(\textit{self}, *\textit{xs})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Apply the controller to the set of input variables

Given the values of the input variables, evaluates every decision rule,
aglutinates the results and defuzzify it. Returns the response of the
controller.
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{xx}

          \item[xs]

A tuple, a list or an array with the values of the input variables.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

      \textbf{Return Value}
      \begin{quote}

The response of the controller.
      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__delattr__}
    \index{object.\_\_delattr\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_delattr\_\_}(\textit{...})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

x.{\_}{\_}delattr{\_}{\_}('name') {\textless}=={\textgreater} del x.name
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__getattribute__}
    \index{object.\_\_getattribute\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_getattribute\_\_}(\textit{...})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

x.{\_}{\_}getattribute{\_}{\_}('name') {\textless}=={\textgreater} x.name
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__hash__}
    \index{object.\_\_hash\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_hash\_\_}(\textit{x})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

hash(x)
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__new__}
    \index{object.\_\_new\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_new\_\_}(\textit{T}, \textit{S}, \textit{...})

      \textbf{Return Value}
      \begin{quote}
\begin{alltt}
a new object with type S, a subtype of T
\end{alltt}

      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__reduce__}
    \index{object.\_\_reduce\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_reduce\_\_}(\textit{...})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

helper for pickle
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__reduce_ex__}
    \index{object.\_\_reduce\_ex\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_reduce\_ex\_\_}(\textit{...})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

helper for pickle
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__repr__}
    \index{object.\_\_repr\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_repr\_\_}(\textit{x})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

repr(x)
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__setattr__}
    \index{object.\_\_setattr\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_setattr\_\_}(\textit{...})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

x.{\_}{\_}setattr{\_}{\_}('name', value) {\textless}=={\textgreater} x.name = value
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__str__}
    \index{object.\_\_str\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_str\_\_}(\textit{x})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

str(x)
    \vspace{1ex}

    \end{boxedminipage}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                              Properties                               %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  \subsubsection{Properties}

\begin{longtable}{|p{.30\textwidth}|p{.62\textwidth}|l}
\cline{1-2}
\cline{1-2} \centering \textbf{Name} & \centering \textbf{Description}& \\
\cline{1-2}
\endhead\cline{1-2}\multicolumn{3}{r}{\small\textit{continued on next page}}\\\endfoot\cline{1-2}
\endlastfoot\raggedright y\- & \raggedright Property that returns the output variable interval. Not writable

\textbf{Value:}
{\tt {\textless}property object at 0x887be3c{\textgreater}}&\\
\cline{1-2}
\raggedright r\-u\-l\-e\-s\- & \raggedright Property that returns the list of decision rules. Not writable

\textbf{Value:}
{\tt {\textless}property object at 0x887be64{\textgreater}}&\\
\cline{1-2}
\raggedright \_\-\_\-c\-l\-a\-s\-s\-\_\-\_\- & \raggedright \textbf{Value:}
{\tt {\textless}attribute '\_\_class\_\_' of 'object' objects{\textgreater}}&\\
\cline{1-2}
\end{longtable}

    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Controller \textit{(class)}|)}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                           Class Description                           %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Mamdani \textit{(class)}|(}
\subsection{Class Mamdani}

    \label{peach:fuzzy:control:Mamdani}
\begin{tabular}{cccccccc}
% Line for object, linespec=[False, False]
\multicolumn{2}{r}{\settowidth{\BCL}{object}\multirow{2}{\BCL}{object}}
&&
&&
  \\\cline{3-3}
  &&\multicolumn{1}{c|}{}
&&
&&
  \\
% Line for peach.fuzzy.control.Controller, linespec=[False]
\multicolumn{4}{r}{\settowidth{\BCL}{peach.fuzzy.control.Controller}\multirow{2}{\BCL}{peach.fuzzy.control.Controller}}
&&
  \\\cline{5-5}
  &&&&\multicolumn{1}{c|}{}
&&
  \\
&&&&\multicolumn{2}{l}{\textbf{peach.fuzzy.control.Mamdani}}
\end{tabular}

\texttt{Mandani} is an alias to \texttt{Controller}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                Methods                                %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  \subsubsection{Methods}

    \label{peach:fuzzy:control:Controller:__call__}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Controller \textit{(class)}!peach.fuzzy.control.Controller.\_\_call\_\_ \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_call\_\_}(\textit{self}, *\textit{xs})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Apply the controller to the set of input variables

Given the values of the input variables, evaluates every decision rule,
aglutinates the results and defuzzify it. Returns the response of the
controller.
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{xx}

          \item[xs]

A tuple, a list or an array with the values of the input variables.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

      \textbf{Return Value}
      \begin{quote}

The response of the controller.
      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__delattr__}
    \index{object.\_\_delattr\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_delattr\_\_}(\textit{...})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

x.{\_}{\_}delattr{\_}{\_}('name') {\textless}=={\textgreater} del x.name
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__getattribute__}
    \index{object.\_\_getattribute\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_getattribute\_\_}(\textit{...})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

x.{\_}{\_}getattribute{\_}{\_}('name') {\textless}=={\textgreater} x.name
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__hash__}
    \index{object.\_\_hash\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_hash\_\_}(\textit{x})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

hash(x)
    \vspace{1ex}

    \end{boxedminipage}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_init\_\_}(\textit{self}, \textit{yrange}, \textit{rules}=\texttt{\texttt{[}\texttt{]}}, \textit{defuzzy}=\texttt{{\textless}function Centroid at 0x885ecdc{\textgreater}}, \textit{norm}=\texttt{{\textless}function ZadehAnd at 0x885eaac{\textgreater}}, \textit{conorm}=\texttt{{\textless}function ZadehOr at 0x885eae4{\textgreater}}, \textit{negation}=\texttt{{\textless}function ZadehNot at 0x885eb1c{\textgreater}}, \textit{imply}=\texttt{{\textless}function MamdaniImplication at 0x885eb54{\textgreater}}, \textit{aglutinate}=\texttt{{\textless}function MamdaniAglutination at 0x885eb8c{\textgreater}})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Creates and initialize the controller.
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{xxxxxxxxxx}

          \item[yrange]

The range of the output variable. This must be given as a set of
points belonging to the interval where the output variable is
defined, not only the start and end points. It is strongly suggested
that the interval is divided in some (eg.: 100) points equally
spaced;
          \item[rules]

The set of decision rules, as defined above. If none is given, an
empty set of rules is assumed;
          \item[defuzzy]

The defuzzification method to be used. If none is given, the
Centroid method is used;
          \item[norm]

The norm (\texttt{and} operation) to be used. Defaults to Zadeh and.
          \item[conorm]

The conorm (\texttt{or} operation) to be used. Defaults to Zadeh or.
          \item[negation]

The negation (\texttt{not} operation) to be used. Defaults to Zadeh not.
          \item[imply]

The implication method to be used. Defaults to Mamdani implication.
          \item[aglutinate]

The aglutination method to be used. Defaults to Mamdani
aglutination.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

      Overrides: object.\_\_init\_\_

    \end{boxedminipage}

    \label{object:__new__}
    \index{object.\_\_new\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_new\_\_}(\textit{T}, \textit{S}, \textit{...})

      \textbf{Return Value}
      \begin{quote}
\begin{alltt}
a new object with type S, a subtype of T
\end{alltt}

      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__reduce__}
    \index{object.\_\_reduce\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_reduce\_\_}(\textit{...})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

helper for pickle
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__reduce_ex__}
    \index{object.\_\_reduce\_ex\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_reduce\_ex\_\_}(\textit{...})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

helper for pickle
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__repr__}
    \index{object.\_\_repr\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_repr\_\_}(\textit{x})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

repr(x)
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__setattr__}
    \index{object.\_\_setattr\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_setattr\_\_}(\textit{...})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

x.{\_}{\_}setattr{\_}{\_}('name', value) {\textless}=={\textgreater} x.name = value
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__str__}
    \index{object.\_\_str\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_str\_\_}(\textit{x})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

str(x)
    \vspace{1ex}

    \end{boxedminipage}

    \label{peach:fuzzy:control:Controller:add_rule}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Controller \textit{(class)}!peach.fuzzy.control.Controller.add\_rule \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{add\_rule}(\textit{self}, \textit{rule})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Adds a decision rule to the knowledge base.

It is essential to understand the format that decision rules must follow
to obtain correct behaviour of the controller. A rule is a tuple must
have the following format:
\begin{quote}{\ttfamily \raggedright \noindent
((mx0,~mx1,~...,~mxn),~my)
}\end{quote}

where \texttt{mx0} is a membership function of the first input variable,
\texttt{mx1} is a membership function of the second input variable and so on;
and \texttt{my} is a membership function or a fuzzy set of the output
variable.

Notice that \texttt{mx}'s are \emph{functions} not fuzzy sets! They will be
applied to the values of the input variables given in the function call,
so, if they are anything different from a membership function, an
exception will be raised when the controller is used. Please, consult
the examples to see how they must be used.
    \vspace{1ex}

    \end{boxedminipage}

    \label{peach:fuzzy:control:Controller:add_table}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Controller \textit{(class)}!peach.fuzzy.control.Controller.add\_table \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{add\_table}(\textit{self}, \textit{lx1}, \textit{lx2}, \textit{table})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Adds a table of decision rules in a two variable controller.

Typically, fuzzy controllers are used to control two variables. In that
case, the set of decision rules are given in the form of a table, since
that is a more compact format and very easy to visualize. This is a
convenience function that allows to add decision rules in the form of a
table. Notice that the resulting knowledge base will be the same if this
function is used or the \texttt{add{\_}rule} method is used with every single
rule. The second method is in general easier to read in a script, so
consider well.
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{xxxxx}

          \item[lx1]

The set of membership functions to the variable \texttt{x1}, or the
lines of the table
          \item[lx2]

The set of membership functions to the variable \texttt{x2}, or the
columns of the table
          \item[table]

The consequent of the rule where the condition is the line \texttt{and}
the column. These can be the membership functions or fuzzy sets.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

    \label{peach:fuzzy:control:Controller:eval}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Controller \textit{(class)}!peach.fuzzy.control.Controller.eval \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{eval}(\textit{self}, \textit{r}, \textit{xs})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Evaluates one decision rule in this controller

Takes a rule from the controller and evaluates it given the values of
the input variables.
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{xx}

          \item[r]

The rule in the standard format, or an integer number. If \texttt{r} is
an integer, then the \texttt{r} th rule in the knowledge base will be
evaluated.
          \item[xs]

A tuple, a list or an array containing the values of the input
variables. The dimension must be coherent with the given rule.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

      \textbf{Return Value}
      \begin{quote}

This method evaluates each membership function in the rule for each
given value, and \texttt{and} 's the results to obtain the condition. If
the condition is zero, a tuple \texttt{(0.0, None) is returned. Otherwise,
the condition is `{}`imply} ed in the membership function of the output
variable. A tuple containing \texttt{(condition, imply)} (the membership
value associated to the condition and the result of the implication)
is returned.
      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

    \label{peach:fuzzy:control:Controller:eval_all}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Controller \textit{(class)}!peach.fuzzy.control.Controller.eval\_all \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{eval\_all}(\textit{self}, *\textit{xs})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Evaluates all the rules and aglutinates the results.

Given the values of the input variables, evaluate and apply every rule
in the knowledge base (with the \texttt{eval} method) and aglutinates the
results.
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{xx}

          \item[xs]

A tuple, a list or an array with the values of the input variables.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

      \textbf{Return Value}
      \begin{quote}

A fuzzy set containing the result of the evaluation of every rule in
the knowledge base, with the results aglutinated.
      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

    \label{peach:fuzzy:control:Controller:set_aglutination}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Controller \textit{(class)}!peach.fuzzy.control.Controller.set\_aglutination \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{set\_aglutination}(\textit{self}, \textit{f})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Sets the aglutination to be used.

This method must be used to change the behavior of the aglutination
operation of the controller.
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{x}

          \item[f]

The function can be any function that takes two numerical values and
return one numerical value, that corresponds to the aglutination
result.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

    \label{peach:fuzzy:control:Controller:set_conorm}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Controller \textit{(class)}!peach.fuzzy.control.Controller.set\_conorm \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{set\_conorm}(\textit{self}, \textit{f})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Sets the conorm (\texttt{or}) to be used.

This method must be used to change the behavior of the \texttt{or} operation
of the controller.
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{x}

          \item[f]

The function can be any function that takes two numerical values and
return one numerical value, that corresponds to the \texttt{or} result.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

    \label{peach:fuzzy:control:Controller:set_implication}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Controller \textit{(class)}!peach.fuzzy.control.Controller.set\_implication \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{set\_implication}(\textit{self}, \textit{f})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Sets the implication to be used.

This method must be used to change the behavior of the implication
operation of the controller.
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{x}

          \item[f]

The function can be any function that takes two numerical values and
return one numerical value, that corresponds to the implication
result.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

    \label{peach:fuzzy:control:Controller:set_negation}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Controller \textit{(class)}!peach.fuzzy.control.Controller.set\_negation \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{set\_negation}(\textit{self}, \textit{f})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Sets the negation (\texttt{not}) to be used.

This method must be used to change the behavior of the \texttt{not} operation
of the controller.
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{x}

          \item[f]

The function can be any function that takes one numerical value and
return one numerical value, that corresponds to the \texttt{not} result.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

    \label{peach:fuzzy:control:Controller:set_norm}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Controller \textit{(class)}!peach.fuzzy.control.Controller.set\_norm \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{set\_norm}(\textit{self}, \textit{f})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Sets the norm (\texttt{and}) to be used.

This method must be used to change the behavior of the \texttt{and} operation
of the controller.
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{x}

          \item[f]

The function can be any function that takes two numerical values and
return one numerical value, that corresponds to the \texttt{and} result.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                              Properties                               %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  \subsubsection{Properties}

\begin{longtable}{|p{.30\textwidth}|p{.62\textwidth}|l}
\cline{1-2}
\cline{1-2} \centering \textbf{Name} & \centering \textbf{Description}& \\
\cline{1-2}
\endhead\cline{1-2}\multicolumn{3}{r}{\small\textit{continued on next page}}\\\endfoot\cline{1-2}
\endlastfoot\raggedright \_\-\_\-c\-l\-a\-s\-s\-\_\-\_\- & \raggedright \textbf{Value:}
{\tt {\textless}attribute '\_\_class\_\_' of 'object' objects{\textgreater}}&\\
\cline{1-2}
\raggedright r\-u\-l\-e\-s\- & \raggedright Property that returns the list of decision rules. Not writable

\textbf{Value:}
{\tt {\textless}property object at 0x887be64{\textgreater}}&\\
\cline{1-2}
\raggedright y\- & \raggedright Property that returns the output variable interval. Not writable

\textbf{Value:}
{\tt {\textless}property object at 0x887be3c{\textgreater}}&\\
\cline{1-2}
\end{longtable}

    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Mamdani \textit{(class)}|)}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                           Class Description                           %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Parametric \textit{(class)}|(}
\subsection{Class Parametric}

    \label{peach:fuzzy:control:Parametric}
\begin{tabular}{cccccc}
% Line for object, linespec=[False]
\multicolumn{2}{r}{\settowidth{\BCL}{object}\multirow{2}{\BCL}{object}}
&&
  \\\cline{3-3}
  &&\multicolumn{1}{c|}{}
&&
  \\
&&\multicolumn{2}{l}{\textbf{peach.fuzzy.control.Parametric}}
\end{tabular}

\textbf{Known Subclasses:} peach.fuzzy.control.Sugeno

Basic Parametric controller

This class implements a standard parametric (or Takagi-Sugeno) controller. A
controller based on fuzzy logic has a somewhat complex behaviour, so it is
not explained here. There are numerous references that can be consulted.

It is essential to understand the format that decision rules must follow to
obtain correct behaviour of the controller. A rule is a tuple given by:
\begin{quote}{\ttfamily \raggedright \noindent
((mx0,~mx1,~...,~mxn),~(a0,~a1,~...,~an))
}\end{quote}

where \texttt{mx0} is a membership function of the first input variable, \texttt{mx1}
is a membership function of the second input variable and so on; and \texttt{a0}
is the linear parameter, \texttt{a1} is the parameter associated with the first
input variable, \texttt{a2} is the parameter associated with the second input
variable and so on. The response to the rule is calculated by:
\begin{quote}{\ttfamily \raggedright \noindent
y~=~a0~+~a1*x1~+~a2*x2~+~...~+~an*xn
}\end{quote}

Notice that \texttt{mx}'s are \emph{functions} not fuzzy sets! They will be applied to
the values of the input variables given in the function call, so, if they
are anything different from a membership function, an exception will be
raised. Please, consult the examples to see how they must be used.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                Methods                                %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  \subsubsection{Methods}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_init\_\_}(\textit{self}, \textit{rules}=\texttt{\texttt{[}\texttt{]}}, \textit{norm}=\texttt{{\textless}function ProbabilisticAnd at 0x885ebc4{\textgreater}}, \textit{conorm}=\texttt{{\textless}function ProbabilisticOr at 0x885ebfc{\textgreater}}, \textit{negation}=\texttt{{\textless}function ProbabilisticNot at 0x885ec34{\textgreater}})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Creates and initializes the controller.
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{xxxxxxxx}

          \item[rules]

List containing the decision rules for the controller. If not given,
an empty set of decision rules is used.
          \item[norm]

The norm (\texttt{and} operation) to be used. Defaults to Probabilistic
and.
          \item[conorm]

The conorm (\texttt{or} operation) to be used. Defaults to Probabilistic
or.
          \item[negation]

The negation (\texttt{not} operation) to be used. Defaults to
Probabilistic not.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

      Overrides: object.\_\_init\_\_

    \end{boxedminipage}

    \label{peach:fuzzy:control:Parametric:__getrules}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Parametric \textit{(class)}!peach.fuzzy.control.Parametric.\_\_getrules \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_getrules}(\textit{self})

    \end{boxedminipage}

    \label{peach:fuzzy:control:Parametric:add_rule}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Parametric \textit{(class)}!peach.fuzzy.control.Parametric.add\_rule \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{add\_rule}(\textit{self}, \textit{rule})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Adds a decision rule to the knowledge base.

It is essential to understand the format that decision rules must follow
to obtain correct behaviour of the controller. A rule is a tuple given
by:
\begin{quote}{\ttfamily \raggedright \noindent
((mx0,~mx1,~...,~mxn),~(a0,~a1,~...,~an))
}\end{quote}

where \texttt{mx0} is a membership function of the first input variable,
\texttt{mx1} is a membership function of the second input variable and so on;
and \texttt{a0} is the linear parameter, \texttt{a1} is the parameter associated
with the first input variable, \texttt{a2} is the parameter associated with
the second input variable and so on.

Notice that \texttt{mx}'s are \emph{functions} not fuzzy sets! They will be
applied to the values of the input variables given in the function call,
so, if they are anything different from a membership function, an
exception will be raised. Please, consult the examples to see how they
must be used.
    \vspace{1ex}

    \end{boxedminipage}

    \label{peach:fuzzy:control:Parametric:eval}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Parametric \textit{(class)}!peach.fuzzy.control.Parametric.eval \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{eval}(\textit{self}, \textit{r}, \textit{xs})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Evaluates one decision rule in this controller

Takes a rule from the controller and evaluates it given the values of
the input variables. The format of the rule is as given, and the
response to the rule is calculated by:
\begin{quote}{\ttfamily \raggedright \noindent
y~=~a0~+~a1*x1~+~a2*x2~+~...~+~an*xn
}\end{quote}
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{xx}

          \item[r]

The rule in the standard format, or an integer number. If \texttt{r} is
an integer, then the \texttt{r} th rule in the knowledge base will be
evaluated.
          \item[xs]

A tuple, a list or an array containing the values of the input
variables. The dimension must be coherent with the given rule.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

      \textbf{Return Value}
      \begin{quote}

This method evaluates each membership function in the rule for each
given value, and \texttt{and} 's the results to obtain the condition. If
the condition is zero, a tuple \texttt{(0.0, 0.0) is returned. Otherwise,
the result as given above is calculate, and a tuple containing
`{}`(condition, result)} (the membership value associated to the
condition and the result of the calculation) is returned.
      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

    \label{peach:fuzzy:control:Parametric:__call__}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Parametric \textit{(class)}!peach.fuzzy.control.Parametric.\_\_call\_\_ \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_call\_\_}(\textit{self}, *\textit{xs})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Apply the controller to the set of input variables

Given the values of the input variables, evaluates every decision rule,
and calculates the weighted average of the results. Returns the response
of the controller.
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{xx}

          \item[xs]

A tuple, a list or an array with the values of the input variables.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

      \textbf{Return Value}
      \begin{quote}

The response of the controller.
      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__delattr__}
    \index{object.\_\_delattr\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_delattr\_\_}(\textit{...})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

x.{\_}{\_}delattr{\_}{\_}('name') {\textless}=={\textgreater} del x.name
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__getattribute__}
    \index{object.\_\_getattribute\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_getattribute\_\_}(\textit{...})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

x.{\_}{\_}getattribute{\_}{\_}('name') {\textless}=={\textgreater} x.name
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__hash__}
    \index{object.\_\_hash\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_hash\_\_}(\textit{x})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

hash(x)
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__new__}
    \index{object.\_\_new\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_new\_\_}(\textit{T}, \textit{S}, \textit{...})

      \textbf{Return Value}
      \begin{quote}
\begin{alltt}
a new object with type S, a subtype of T
\end{alltt}

      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__reduce__}
    \index{object.\_\_reduce\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_reduce\_\_}(\textit{...})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

helper for pickle
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__reduce_ex__}
    \index{object.\_\_reduce\_ex\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_reduce\_ex\_\_}(\textit{...})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

helper for pickle
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__repr__}
    \index{object.\_\_repr\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_repr\_\_}(\textit{x})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

repr(x)
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__setattr__}
    \index{object.\_\_setattr\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_setattr\_\_}(\textit{...})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

x.{\_}{\_}setattr{\_}{\_}('name', value) {\textless}=={\textgreater} x.name = value
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__str__}
    \index{object.\_\_str\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_str\_\_}(\textit{x})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

str(x)
    \vspace{1ex}

    \end{boxedminipage}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                              Properties                               %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  \subsubsection{Properties}

\begin{longtable}{|p{.30\textwidth}|p{.62\textwidth}|l}
\cline{1-2}
\cline{1-2} \centering \textbf{Name} & \centering \textbf{Description}& \\
\cline{1-2}
\endhead\cline{1-2}\multicolumn{3}{r}{\small\textit{continued on next page}}\\\endfoot\cline{1-2}
\endlastfoot\raggedright r\-u\-l\-e\-s\- & \raggedright Property that returns the list of decision rules. Not writable

\textbf{Value:}
{\tt {\textless}property object at 0x887bedc{\textgreater}}&\\
\cline{1-2}
\raggedright \_\-\_\-c\-l\-a\-s\-s\-\_\-\_\- & \raggedright \textbf{Value:}
{\tt {\textless}attribute '\_\_class\_\_' of 'object' objects{\textgreater}}&\\
\cline{1-2}
\end{longtable}

    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Parametric \textit{(class)}|)}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                           Class Description                           %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Sugeno \textit{(class)}|(}
\subsection{Class Sugeno}

    \label{peach:fuzzy:control:Sugeno}
\begin{tabular}{cccccccc}
% Line for object, linespec=[False, False]
\multicolumn{2}{r}{\settowidth{\BCL}{object}\multirow{2}{\BCL}{object}}
&&
&&
  \\\cline{3-3}
  &&\multicolumn{1}{c|}{}
&&
&&
  \\
% Line for peach.fuzzy.control.Parametric, linespec=[False]
\multicolumn{4}{r}{\settowidth{\BCL}{peach.fuzzy.control.Parametric}\multirow{2}{\BCL}{peach.fuzzy.control.Parametric}}
&&
  \\\cline{5-5}
  &&&&\multicolumn{1}{c|}{}
&&
  \\
&&&&\multicolumn{2}{l}{\textbf{peach.fuzzy.control.Sugeno}}
\end{tabular}

\texttt{Sugeno} is an alias to \texttt{Parametric}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                Methods                                %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  \subsubsection{Methods}

    \label{peach:fuzzy:control:Parametric:__call__}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Parametric \textit{(class)}!peach.fuzzy.control.Parametric.\_\_call\_\_ \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_call\_\_}(\textit{self}, *\textit{xs})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Apply the controller to the set of input variables

Given the values of the input variables, evaluates every decision rule,
and calculates the weighted average of the results. Returns the response
of the controller.
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{xx}

          \item[xs]

A tuple, a list or an array with the values of the input variables.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

      \textbf{Return Value}
      \begin{quote}

The response of the controller.
      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__delattr__}
    \index{object.\_\_delattr\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_delattr\_\_}(\textit{...})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

x.{\_}{\_}delattr{\_}{\_}('name') {\textless}=={\textgreater} del x.name
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__getattribute__}
    \index{object.\_\_getattribute\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_getattribute\_\_}(\textit{...})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

x.{\_}{\_}getattribute{\_}{\_}('name') {\textless}=={\textgreater} x.name
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__hash__}
    \index{object.\_\_hash\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_hash\_\_}(\textit{x})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

hash(x)
    \vspace{1ex}

    \end{boxedminipage}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_init\_\_}(\textit{self}, \textit{rules}=\texttt{\texttt{[}\texttt{]}}, \textit{norm}=\texttt{{\textless}function ProbabilisticAnd at 0x885ebc4{\textgreater}}, \textit{conorm}=\texttt{{\textless}function ProbabilisticOr at 0x885ebfc{\textgreater}}, \textit{negation}=\texttt{{\textless}function ProbabilisticNot at 0x885ec34{\textgreater}})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Creates and initializes the controller.
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{xxxxxxxx}

          \item[rules]

List containing the decision rules for the controller. If not given,
an empty set of decision rules is used.
          \item[norm]

The norm (\texttt{and} operation) to be used. Defaults to Probabilistic
and.
          \item[conorm]

The conorm (\texttt{or} operation) to be used. Defaults to Probabilistic
or.
          \item[negation]

The negation (\texttt{not} operation) to be used. Defaults to
Probabilistic not.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

      Overrides: object.\_\_init\_\_

    \end{boxedminipage}

    \label{object:__new__}
    \index{object.\_\_new\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_new\_\_}(\textit{T}, \textit{S}, \textit{...})

      \textbf{Return Value}
      \begin{quote}
\begin{alltt}
a new object with type S, a subtype of T
\end{alltt}

      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__reduce__}
    \index{object.\_\_reduce\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_reduce\_\_}(\textit{...})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

helper for pickle
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__reduce_ex__}
    \index{object.\_\_reduce\_ex\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_reduce\_ex\_\_}(\textit{...})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

helper for pickle
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__repr__}
    \index{object.\_\_repr\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_repr\_\_}(\textit{x})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

repr(x)
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__setattr__}
    \index{object.\_\_setattr\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_setattr\_\_}(\textit{...})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

x.{\_}{\_}setattr{\_}{\_}('name', value) {\textless}=={\textgreater} x.name = value
    \vspace{1ex}

    \end{boxedminipage}

    \label{object:__str__}
    \index{object.\_\_str\_\_ \textit{(function)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{\_\_str\_\_}(\textit{x})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

str(x)
    \vspace{1ex}

    \end{boxedminipage}

    \label{peach:fuzzy:control:Parametric:add_rule}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Parametric \textit{(class)}!peach.fuzzy.control.Parametric.add\_rule \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{add\_rule}(\textit{self}, \textit{rule})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Adds a decision rule to the knowledge base.

It is essential to understand the format that decision rules must follow
to obtain correct behaviour of the controller. A rule is a tuple given
by:
\begin{quote}{\ttfamily \raggedright \noindent
((mx0,~mx1,~...,~mxn),~(a0,~a1,~...,~an))
}\end{quote}

where \texttt{mx0} is a membership function of the first input variable,
\texttt{mx1} is a membership function of the second input variable and so on;
and \texttt{a0} is the linear parameter, \texttt{a1} is the parameter associated
with the first input variable, \texttt{a2} is the parameter associated with
the second input variable and so on.

Notice that \texttt{mx}'s are \emph{functions} not fuzzy sets! They will be
applied to the values of the input variables given in the function call,
so, if they are anything different from a membership function, an
exception will be raised. Please, consult the examples to see how they
must be used.
    \vspace{1ex}

    \end{boxedminipage}

    \label{peach:fuzzy:control:Parametric:eval}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Parametric \textit{(class)}!peach.fuzzy.control.Parametric.eval \textit{(method)}}

    \vspace{0.5ex}

    \begin{boxedminipage}{\textwidth}

    \raggedright \textbf{eval}(\textit{self}, \textit{r}, \textit{xs})

    \vspace{-1.5ex}

    \rule{\textwidth}{0.5\fboxrule}

Evaluates one decision rule in this controller

Takes a rule from the controller and evaluates it given the values of
the input variables. The format of the rule is as given, and the
response to the rule is calculated by:
\begin{quote}{\ttfamily \raggedright \noindent
y~=~a0~+~a1*x1~+~a2*x2~+~...~+~an*xn
}\end{quote}
    \vspace{1ex}

      \textbf{Parameters}
      \begin{quote}
        \begin{Ventry}{xx}

          \item[r]

The rule in the standard format, or an integer number. If \texttt{r} is
an integer, then the \texttt{r} th rule in the knowledge base will be
evaluated.
          \item[xs]

A tuple, a list or an array containing the values of the input
variables. The dimension must be coherent with the given rule.
        \end{Ventry}

      \end{quote}

    \vspace{1ex}

      \textbf{Return Value}
      \begin{quote}

This method evaluates each membership function in the rule for each
given value, and \texttt{and} 's the results to obtain the condition. If
the condition is zero, a tuple \texttt{(0.0, 0.0) is returned. Otherwise,
the result as given above is calculate, and a tuple containing
`{}`(condition, result)} (the membership value associated to the
condition and the result of the calculation) is returned.
      \end{quote}

    \vspace{1ex}

    \end{boxedminipage}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                              Properties                               %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

  \subsubsection{Properties}

\begin{longtable}{|p{.30\textwidth}|p{.62\textwidth}|l}
\cline{1-2}
\cline{1-2} \centering \textbf{Name} & \centering \textbf{Description}& \\
\cline{1-2}
\endhead\cline{1-2}\multicolumn{3}{r}{\small\textit{continued on next page}}\\\endfoot\cline{1-2}
\endlastfoot\raggedright \_\-\_\-c\-l\-a\-s\-s\-\_\-\_\- & \raggedright \textbf{Value:}
{\tt {\textless}attribute '\_\_class\_\_' of 'object' objects{\textgreater}}&\\
\cline{1-2}
\raggedright r\-u\-l\-e\-s\- & \raggedright Property that returns the list of decision rules. Not writable

\textbf{Value:}
{\tt {\textless}property object at 0x887bedc{\textgreater}}&\\
\cline{1-2}
\end{longtable}

    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}!peach.fuzzy.control.Sugeno \textit{(class)}|)}
    \index{peach \textit{(package)}!peach.fuzzy \textit{(package)}!peach.fuzzy.control \textit{(module)}|)}


\documentclass[a4paper,11pt]{article}
%\documentclass[a4\mfrakpa\mfrakper,11\mfrakpt]{scrartcl}

\input{../preambles/preamble}
\input{../preambles/unicode}

\setmainlanguage{english}
\setotherlanguages{german,greek,russian}

\input{../preambles/math-single}
\input{../preambles/math-brac}
\input{../preambles/math-thm}
\input{../preambles/phys-chem}

% \setromanfont[Mappping=tex-text]{Linux Libertine O}
% \setsansfont[Mapping=tex-text]{DejaVu Sans}
% \setmonofont[Mapping=tex-text]{DejaVu Sans Mono}

\usepackage[%style=authoryear-icomp,
			backend=biber]{biblatex}
\addbibresource{./cosmo-perturb.bib}

\title{Cosmological Perturbations}
\author{Yi-Fan Wang (王\ 一帆)}
%\date{}

\begin{document}
\maketitle

Most of the conventions and notations in \cite[ch.~5]{Weinberg2008} will be
followed.

Suppose the metric can be expanded up to the linear
order as
\begin{align}
g = g^{(0)} + \epsilon g^{(1)} + \rfun{\Omicron}{\epsilon^2}.
\end{align}
The background metric $g^{(0)}$ takes the Robertson--Walker form
\begin{align}
g^{(0)}_{\mu\nu}\,\dd x^\mu\,\dd x^\nu =
-\rfun{N^2}{t}\,\dd t^2 + \rfun{a^2}{t}\,\dd \Omega_\text{3F}^2,
\end{align}
in which $\dd\Omega_\text{3F}^2 =
\dd\chi^2 + \chi^2\rbr{\dd\theta^2 + \sin^2\theta\,\dd \phi^2}$ is the
dimensionless flat spatial metric.
The linear perturbation can be decomposed into scalar, vector and
tensor parts
\begin{align}
g^{(1)}_{00} &= -E, \\
g^{(1)}_{i0} = g^{(1)}_{i0} &= F_{,i}+G_i, \\
g^{(1)}_{ij} &= A \delta_{ij} + B_{,i,j}+C_{i,j}+C_{j,i}+D_{ij}.
\end{align}

Here one has some weird condition, where the contractions do not follow the
one-up-one-down tradition
\begin{align}
C_{i,i} = G_{i,i} = 0,
\quad
D_{ij,i} = 0,
\quad
D_{ii} = 0.
\end{align}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Metric perturbation under diffeomorphism}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Consider a diffeomorphism generated by $\xi^\mu$
\begin{align}
x^\mu \to \overline{x}^\mu = x^\mu - \epsilon \xi^\mu.
\end{align}
The generator $\xi^\mu$ can in turn be decomposed into $\xi_0 = \zeta$,
$\xi_i
= \xi^\text{S}_{,i} + \xi^\text{V}_{i}$.

One has here again some weird condition, where the contractions do not follow
the one-up-one-down tradition
\begin{align}
\xi^\text{V}_{i,i} = 0.
\end{align}

The Lie derivative of the metric $\BbbL_{\xi} g$ is
\begin{align}
\rbr{\BbbL_{\xi} g}_{\mu\nu} =
\xi^\lambda g_{\mu\nu,\lambda} +
\xi^{\lambda}{}_{,\mu} g_{\lambda\nu} +
\xi^{\lambda}{}_{,\nu} g_{\mu\lambda}.
\end{align}
In components and expansion, these are
\begin{align}
\rbr{\BbbL_{\xi} g}_{00} &=
2\dot\zeta - 2\zeta \frac{\dot{N}}{N} + \rfun{\Omicron}{\epsilon}, \\
\rbr{\BbbL_{\xi} g}_{i0} = \rbr{\BbbL_{\xi} g}_{0i} &=
\rbr{\zeta-2\frac{\dot{a}}{a}\xi^\text{S}+\dot{\xi}^\text{S}}_{,i} +
\rbr{-2\frac{\dot{a}}{a}\xi^\text{V}_{i}+\dot{\xi}^\text{V}_{i}}
+ \rfun{\Omicron}{\epsilon}, \\
\rbr{\BbbL_{\xi} g}_{ji} = \rbr{\BbbL_{\xi} g}_{ij} &=
-\frac{2a\dot{a}}{N^2} \zeta \delta_{ij} + 2\xi^\text{S}_{,i,j}
+ \xi^\text{V}_{i,j} + \xi^\text{V}_{j,i} + \rfun{\Omicron}{\epsilon}.
\end{align}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Scalar perturbations}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{align}
-N^2 - \epsilon E + \rfun{\Omicron}{\epsilon^2} \to
-N^2 - \epsilon E + \epsilon\rbr{2\dot\zeta -
2\zeta\frac{\dot{N}}{N}}
+ \rfun{\Omicron}{\epsilon^2},
\end{align}
so one can write
\begin{align}
\BbbL_\xi E = -2 \dot{\zeta} + 2 \zeta \frac{\dot{N}}{N}.
\end{align}
Similarly one can read-off
\begin{align}
\BbbL_\xi F &= \zeta - 2\frac{\dot{a}}{a}\xi^\text{S} + \dot{\xi}^\text{S}, \\
\BbbL_\xi A &= -\frac{2a\dot{a}}{N^2}\zeta, \\
\BbbL_\xi B &= 2\xi^\text{S}.
\end{align}

The four scalar perturbations are generated by $\zeta$ and $\xi^\text{S}$,
so that only two independent perturbations exists. It is clear that
\begin{align}
\BbbL_\xi\rbr{\frac{F}{a}-\frde{}{t}\frac{B}{2a}} = \frac{\zeta}{a}.
\end{align}
One can verify that
\begin{align}
\BbbL_\xi\cbr{\frac{E}{2N}+
\frde{}{t}\sbr{\frac{a}{N}\rbr{\frac{F}{a}-\frde{}{t}\frac{B}{2a}}}} &= 0, \\
\BbbL_\xi\cbr{\frac{A}{2}+
\frac{a^2 \dot{a}}{N^2}\rbr{\frac{F}{a}-\frde{}{t}\frac{B}{2a}}} &= 0.
\end{align}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Vector perturbations}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Tensor perturbations}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Scalar field perturbation under diffeomorphism}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\printbibliography

\end{document}


% Author: Dominik Harmim <harmim6@gmail.com>

\documentclass[a4paper, 10pt, twocolumn]{article}

\usepackage[british]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[left=2cm, top=2cm, text={17cm, 25cm}]{geometry}
\usepackage[unicode, colorlinks, hypertexnames=false, citecolor=red]{hyperref}
\usepackage{times}
\usepackage{graphicx}
\usepackage{amsmath}

\setlength{\parindent}{0pt}
\setlength{\parskip}{.5 \bigskipamount}

\begin{document}
    \twocolumn[
        \begin{@twocolumnfalse}
            \begin{center}
                {\Large
                    Brno University of Technology \\
                    Faculty of Information Technology \\
                }
                {\includegraphics[width=.4 \linewidth]{img/FIT_logo.pdf}} \\

                {\LARGE
                    Cryptography \\
                    2.~Project\,--\,RSA \\[.4cm]
                }

                {\large
                    Dominik Harmim (xharmi00) \\
                    \texttt{xharmi00@stud.fit.vutbr.cz} \\
                    \today
                }
            \end{center}
        \end{@twocolumnfalse}
    ]

    \section{Introduction}

    The goal of this project is to implement the RSA algorithm\,---\,an
    asymmetry cryptography algorithm. The program that should be created
    should be able to generate parameters of the RSA, encrypt and decrypt
    messages, and break the algorithm using factorisation of the public
    modulus. The program is implemented in~C++ and it is used arithmetic
    library GMP\footnote{Arithmetic library
    \textbf{GMP}\,--\,\url{https://gmplib.org}.} for the computation with
    large numbers. In the following chapters, there are briefly described
    the methods and algorithms used. Appropriate bibliography and other
    sources are mentioned as well.

    \section{Encryption and Decryption}

    An encryption and decryption is implemented by~\cite{pkcrypt}. The
    private transformation~$ D $~and the public transformation~$ E $~are
    defined as follows: $ D(c) = m = c^d\,\mod n $; $ E(m) = c = m^e\,\mod
    n $, where~$ m $~is a~decrypted message, $ c $~is an encrypted message,
    $ e $~is the public exponent, $ d $~is the private exponent, and
    $ n $~is the public modulus.

    \section{RSA Parameters Generation}

    The generation of RSA parameters is implemented according
    to~\cite{pkcrypt}. At first, two random prime numbers ($ p $~and~$ q $)
    are generated and $ n = p \cdot q $ and $ h = (p - 1) \cdot (q - 1) $ is
    computed. Then, it is chosen~$ e $~to be an integer in range
    $ (2, h - 1) $ with $ GCD(e, h) = 1 $. Further, it is found the
    multiplicative inverse~$ d $~of~$ e $, modulo~$ h $. Now, $ n $~and~$ e
    $~are public and~$ d $, $ p $, $ q $, $ h $ are secret.

    The computation of a~greatest common divisor (the $ GCD $ function)
    is done using the Euclid's algorithm. The computation of a~multiplicative
    inverse is done using the extended Euclid's algorithm. These algorithms
    are in detail described in~\cite{pkcrypt}.

    For the generation of the prime numbers, it is used the probabilistic
    approach using Solovay-Strassen test with the computation of the
    Jacobi symbol. These algorithms are explained and demonstrated
    in~\cite{pkcrypt, solovay, jacobi}.

    \section{Breaking the Algorithm}

    Breaking of the algorithm is achieved using the factorisation of the
    public modulus. Once the factorisation is done, one of the secret
    prime numbers is obtained and the other one is then easily calculated
    as well as the private exponent. So, the private key is obtained.

    Factorisation of the public modulus is implemented using the
    Pollard Rho Brent Integer Factorisation, see~\cite{brent, brentOnline}.

    \section{Conclusion}

    Within this project, the RSA algorithm has been successfully
    implemented in a~desirable way. It was successfully tested on
    computer \texttt{merlin.fit.vutbr.cz}. It was experimentally
    verified that the program can correctly generate keys for the public
    modulus up to~4096 bits length and that it can break the algorithm
    for the public modulus up to~100 bits length quite fast. The program
    works properly also for longer keys but, as expected, it will take
    more time.

    \bibliographystyle{englishiso}
    \renewcommand{\refname}{Bibliography}
    \bibliography{doc}
\end{document}


\chapter{Radiometry}

Remote sensing is not just a matter of taking pictures, but also --
mostly -- a matter of measuring physical values. In order to properly
deal with physical magnitudes, the numerical values provided by the
sensors have to be calibrated. After that, several indices with
physical meaning can be computed.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Radiometric Indices}
\label{sec:VegetationIndex}
\label{sec:RadiometricIndex}

\subsection{Introduction}

With multispectral sensors, several indices can be computed, combining several
spectral bands to show features that are not obvious using only one band.
Indices can show:
\begin{itemize}
  \item Vegetation (Tab~\ref{tab:vegetationindices})
  \item Soil (Tab~\ref{tab:soilindices})
  \item Water (Tab~\ref{tab:waterindices})
  \item Built up areas (Tab~\ref{tab:builtupindices})
\end{itemize}

A vegetation index is a quantitative measure used to measure biomass
or vegetative vigor, usually formed from combinations of several
spectral bands, whose values are added, divided, or multiplied in
order to yield a single value that indicates the amount or vigor of
vegetation.

Numerous indices are available in OTB and are listed in
table~\ref{tab:vegetationindices} to \ref{tab:builtupindices} with their
references.

\begin{table}[htb]
\centering
\begin{tabular}{|c|l|}
\hline
NDVI &  Normalized Difference Vegetation Index \cite{Rouse1973-NDVI} \\
RVI &  Ratio Vegetation Index \cite{Pearson1972-RVI}\\
PVI & Perpendicular Vegetation Index \cite{Richardson1977-PVI,Wiegand1991-PVI}\\
SAVI & Soil Adjusted Vegetation Index \cite{Huete1988-SAVI} \\
TSAVI & Transformed Soil Adjusted Vegetation Index \cite{Baret1989-TSAVI,Baret1991-TSAVI} \\
MSAVI & Modified Soil Adjusted Vegetation Index  \cite{Qi1994-MSAVI} \\
MSAVI2 & Modified Soil Adjusted Vegetation Index  \cite{Qi1994-MSAVI} \\
GEMI &   Global Environment Monitoring Index \cite{Pinty1992-GEMI} \\
WDVI & Weighted Difference Vegetation Index  \cite{Clevers1988-WDVI,Clevers1991-WDVI} \\
AVI & Angular Vegetation Index  \cite{AVI}\\
ARVI & Atmospherically Resistant  Vegetation Index \cite{ARVI} \\
TSARVI & Transformed Soil Adjusted Vegetation Index   \cite{ARVI} \\
EVI & Enhanced Vegetation Index \cite{Huete1994-EVI,Justice1998-EVI} \\
IPVI & Infrared Percentage Vegetation Index  \cite{Crippen1990-IPVI} \\
TNDVI & Transformed NDVI  \cite{Deering1975-TNDVI} \\
\hline
\end{tabular}
\caption{Vegetation indices}\label{tab:vegetationindices}
\end{table}

\begin{table}[htb]
\centering
\begin{tabular}{|c|l|}
\hline
IR  & Redness Index  \cite{Pouget1990-IRIC} \\
IC  & Color Index  \cite{Pouget1990-IRIC} \\
IB  & Brilliance Index  \cite{Nicoloyanni1990-IB} \\
IB2 & Brilliance Index  \cite{Nicoloyanni1990-IB} \\
\hline
\end{tabular}
\caption{Soil indices}\label{tab:soilindices}
\end{table}

\begin{table}[htb]
\centering
\begin{tabular}{|c|l|}
\hline
SRWI & Simple Ratio Water Index \cite{ZarcoTejada2001-SRWI} \\
NDWI & Normalized Difference Water Index  \cite{Gao1996-NDWI} \\
NDWI2 &  Normalized Difference Water Index \cite{McFeeters1996-NDWI2} \\
MNDWI &  Modified Normalized Difference Water Index  \cite{Xu2006-MNDWI} \\
NDPI &  Normalized Difference Pond Index \cite{Lacaux2007-NDTI} \\
NDTI &  Normalized Difference Turbidity Index  \cite{Lacaux2007-NDTI} \\
SA & Spectral Angle \\
\hline
\end{tabular}
\caption{Water indices}\label{tab:waterindices}
\end{table}

\begin{table}[htb]
\centering
\begin{tabular}{|c|l|}
\hline
NDBI &  Normalized Difference Built Up Index \cite{Zha2003-NDBI} \\
ISU &  Index Surfaces Built \cite{Abdellaoui1997-ISU} \\
\hline
\end{tabular}
\caption{Built-up indices}\label{tab:builtupindices}
\end{table}

The use of the different indices is very similar, and only few example are
given in the next sections.

\subsection{NDVI}
\label{secNDVI}
NDVI was one of the most successful of many attempts to simply and
quickly identify vegetated areas and their {\em condition}, and it remains
the most well-known and used index to detect live green plant canopies
in multispectral remote sensing data. Once the feasibility to detect
vegetation had been demonstrated, users tended to also use the NDVI to
quantify the photosynthetic capacity of plant canopies. This, however,
can be a rather more complex undertaking if not done properly.
\input{NDVIRAndNIRVegetationIndexImageFilter.tex}

\subsection{ARVI}
\label{secARVI}
\input{ARVIMultiChannelRAndBAndNIRVegetationIndexImageFilter.tex}

\subsection{AVI}
\label{secAVI}
\input{AVIMultiChannelRAndGAndNIRVegetationIndexImageFilter.tex}

\section{Atmospheric Corrections}
\label{secAtmosphericCorrections}
\input{AtmosphericCorrectionSequencement.tex}


\chapter*{Summary \& Conclusion}\addcontentsline{toc}{chapter}{Summary \& Conclusion}

In this thesis we have presented a series of works aimed to better understand black hole accretion through numerical simulation.  \chap{numerics} introduced \grdisco, a novel moving mesh GRMHD code for simulating disk-like flows.  In \chap{minidisk} we use \discogr\ to study minidisks in accreting binary systems and identify spiral shock waves as a potentially efficient accretion mechanism.  \chap{scalefit} analyzed GRB afterglow light curves with \scalefit, producing the first evidence that GRBs are viewed off-axis.

To further the numerical study of black hole accretion we developed \grdisco, a new GRMHD extension to the moving-mesh code \disco\ \citep{Duffell16}.  This three dimensional code solves the equations of general relativistic magnetohydrodynamics using sophisticated Riemann solvers and a novel constrained transport algorithm and is efficiently parallelized to run on large computer clusters.  The moving mesh allows the code to take longer time steps while reducing error due to numerical diffusion.  We believe this will be an essential feature for studying the long-term behaviour of realistic accretion disks.  In \chap{numerics} we present \discogr 's numerical algorithm and demonstrate its accuracy on a number of test problems.  \discogr\ is open source and freely available online\footnote{\url{https://github.com/geoffryan/Disco.git}}.

The first use of \discogr\ is a study of minidisks in binary black hole systems, presented in \chap{minidisk}.  The aim of this work was to better understand the dynamics and observational characteristics of minidisks to better inform global simulations of circumbinary accretion and searches for supermassive binary black hole systems.  We find that spiral shocks, excited in the outer minidisk by tidal forces, can propagate to the minidisk interior and efficiently drive accretion.  This allows minidisks to accrete with an effective $\alpha$-parameter $\sim 10^{-2}$ without the need for magnetic fields or other accretion mechanisms.  By ray-tracing through the black hole spacetime we are able to create a synthetic spectrum directly from the radiative losses of the accretion disk.  We find minidisks have a spectrum resembling the standard thin-disk models but with a high energy excess due to shock dissipation near the innermost stable circular orbit.  This mechanism may also be active in x-ray binaries, whose disks are also subject to tidal forces, as well as minidisks.

In \chap{scalefit} we change tactics, using numerical simulation to build a model of GRB afterglows with sufficient fidelity to use in data analysis.  Being a relatively well-understood phenomenon, GRB afterglows can potentially be used to learn much about the GRB central engine.  We analyze 226 afterglow x-ray light curves from the \swiftXRT, about a third of all recorded GRBs from 2005 to 2012.  Our analysis uses high resolution numerical relativistic hydrodynamic simulations to simulate a blast wave propagating in the circumburst medium.  These simulations are fed into a radiative transfer code to calculate a template bank of high fidelity light curves and spectra.  The \scalefit\ package, developed for this work, performs Bayesian parameter estimation on afterglow light curves by fitting them to this template bank.  The jet opening angle $\thO$, the electron spectral index $p$, and for the first time the observer viewing angle $\thobs$ could be constrained in many bursts.  The distribution of $\thO$ is highly asymmetric with a median of 0.097 rad. The electron index $p$ has a median value of $2.3$ over the sample, consistent with previous results.  The distribution of $\thobs$ has a median of $0.57 \thO$ and only thirteen bursts in the entire sample reported $\thobs < 0.2 \thO$.  This provides the first evidence that GRBs are viewed off-axis, lowering inferred total jet energies by up to a factor of four.  This directly impacts the required power of the central engine, thought to be an accreting black hole or rapidly spinning magnetar.

%The development and applications of the methods presented here are ongoing.  The ultimate goal for GR-DISCO is the production of high fidelity, long term simulations of black hole accretion disks.  These simulations, processed through a radiative transfer calculation, could generate a template bank of light curves and spectra.  This would serve as the backbone of a tool like \scalefit, able to constrain the physical parameters of observed accretion disks from a first principles calculation.

This dissertation comprises several works aimed to better understand black hole accretion in a variety of contexts.  \chap{numerics} is primarily methodological, developing a new numerical tool to simulate relativistic accretion disks.  \chap{minidisk} is a detailed a numerical study of a particular system, the minidisks which form during binary black hole accretion.  This study demonstrates the efficacy of spiral shock waves in driving accretion, an effect relevant for minidisks, x-ray binaries, and possibly binary star formation.  \chap{scalefit} uses numerical simulations to develop a model useful to data analysis, providing the first constraints of the gamma-ray burst viewing angle.  Presented here, these works provide a step towards a better unified understanding of black hole accretion.