A fuzzy logic C++ library
Classes | Functions | Variables
try-fis.cpp File Reference

Visual FIS evaluating. More...

#include "slifis_gapi.hpp"
#include "app_common.hpp"
#include <algorithm>
+ Include dependency graph for try-fis.cpp:

Classes

struct  DATA
 A structure needed to keep access to all the data in the mouse callback (only used in try-fis.cpp). More...

Functions

void Mouse_CB (int event, int x, int, int, void *param)
 Mouse callback for fuzzy-set windows.
void Mouse_CB_rb_2D (int event, int x, int y, int, void *)
 Mouse callback for rule-base window.
void Mouse_CB_rb_text (int event, int x, int y, int, void *)
 Mouse callback for text rule-base window.
void Process (int x, int idx)
 Process mouse event in given window idx.
void Show ()
int main (int argc, char *argv[])
 See file try-fis.cpp.

Variables

DATA data
bool g_ViewIntermediateMf = false
 Show itermediate output function (composed of the different triggered membership functions)

Detailed Description

Visual FIS evaluating.

This app is to be associated to .fis files

Arguments : a SLIFIS file (.fis) OR "-h". This latter shows some build information.

This is a graphical app so one can evaluate output membership function and output value, given input values using mouse. If FIS has 'n' inputs, then n+2 windows will be opened, one for the output membership function, one showing the complete output set of functions, and one per input.

If loaded rulebase has 2 inputs, then it also shows a table representation of rule base, and user can edit this rulebase using the mouse. The modified FIS can also be saved, if needed.

Editing rule base:

What you can NOT do:

This app also supports a single flag: '-h' When called, it will print out build/version information and quit.

Tech: this app outputs some info on stdout. It is designed to be associated with .fis file using the GUI. On Linux desktops, the system WILL NOT open a terminal (unlike what happens using Windows), so all stdout info is lost. Here, a special trick is achieved to re-run the app inside an gnome-terminal (see beggining of main() code).

This trick is from: http://stackoverflow.com/questions/10668958/opening-a-console-from-app


Function Documentation

void Mouse_CB ( int  event,
int  x,
int  y,
int  flags,
void *  param 
)

Mouse callback for fuzzy-set windows.

Mouse CallBack.

Common mouse callback.

References __IN__, __OUT__, GAPI_EVENT_LBUTTONDOWN, GAPI_EVENT_MOUSEMOVE, Process(), and Show().

Referenced by main().

void Mouse_CB_rb_2D ( int  event,
int  x,
int  y,
int  flags,
void *  param 
)
void Mouse_CB_rb_text ( int  event,
int  x,
int  y,
int  flags,
void *  param 
)

Mouse callback for text rule-base window.

References __IN__, __OUT__, slifis_plot::POSITION_INFO::_idx_row, slifis_plot::POSITION_INFO::_pos_type, slifis_plot::POSITION_INFO::_rt_input_idx, slifis::RULE_BASE::AddRule(), slifis::RULE_IDX::AddTerm(), data, slifis::RULE_BASE::DeleteRule(), DATA::fis, GAPI_EVENT_LBUTTONDOWN, GAPI_EVENT_MOUSEMOVE, slifis::SLIFIS::GetInputSet(), slifis::FUZZY_ROOT::GetNbMf(), slifis::RULE_BASE::GetNbRules(), slifis::RULE_IDX::GetNbTerms(), slifis::ROOT_RULE::GetOpType(), slifis::RULE_IDX::GetOutMfIndex(), slifis::SLIFIS::GetOutputSet(), slifis_plot::PLOT_RB_TEXT::GetPositionInfo(), slifis::RULE_BASE::GetRule(), slifis::SLIFIS::GetRuleBase(), slifis_plot::PLOT_RB_TEXT::GetSelectionType(), slifis::RULE_IDX::GetTerms(), slifis_plot::NO_SELECTION, slifis::OPR_AND, slifis::OPR_OR, DATA::plot_rb, DATA::plot_rbt, slifis_plot::RBT_POS_INPUT_NAME, slifis_plot::RBT_POS_INPUT_VALUE, slifis_plot::RBT_POS_INVALID, slifis_plot::RBT_POS_NEW_ROW, slifis_plot::RBT_POS_OUTPUT_VALUE, slifis_plot::RBT_POS_ROW, slifis_plot::RBT_POS_RULE_OP, slifis::RULE_IDX::RemoveTermForInput(), slifis_plot::SELECT_NEW_ROW, slifis_plot::SELECT_OUTPUT, slifis_plot::SELECT_ROW, slifis_plot::SELECT_RULE_OP, slifis_plot::SELECT_TERM_INPUT, slifis_plot::SELECT_TERM_VALUE, slifis_plot::PLOT_RB_TEXT::SelectInput(), slifis_plot::PLOT_RB_TEXT::SelectInputValue(), slifis_plot::PLOT_RB_TEXT::SelectNewRule(), slifis_plot::PLOT_RB_TEXT::SelectOutput(), slifis_plot::PLOT_RB_TEXT::SelectRule(), slifis_plot::PLOT_RB_TEXT::SelectRuleOp(), slifis::ROOT_RULE::SetOpType(), slifis::RULE_IDX::SetOutMfIndex(), Show(), slifis_plot::PLOT_RB_2D::Unselect(), slifis_plot::PLOT_RB_TEXT::Unselect(), and slifis::RULE_IDX::UsesInput().

Referenced by main().

void Process ( int  x,
int  idx 
)
void Show ( )
int main ( int  argc,
char *  argv[] 
)

Variable Documentation

bool g_ViewIntermediateMf = false

Show itermediate output function (composed of the different triggered membership functions)

Referenced by main(), and Process().