Index: /cpp/frams/neuro/impl/neuroimpl-body-sdk.h
===================================================================
--- /cpp/frams/neuro/impl/neuroimpl-body-sdk.h	(revision 790)
+++ /cpp/frams/neuro/impl/neuroimpl-body-sdk.h	(revision 791)
@@ -8,88 +8,87 @@
 #include <frams/neuro/neuroimpl.h>
 
-class NI_Gyro: public NeuroImpl
+class NI_Gyro : public NeuroImpl
 {
 public:
-NeuroImpl* makeNew(){return new NI_Gyro();} // for NeuroFactory
-int lateinit() {if (!neuro->joint) return 0; simorder=0; return 1;}
-void go() {setState(0);}
+	NeuroImpl* makeNew(){ return new NI_Gyro(); } // for NeuroFactory
+	int lateinit() { if (!neuro->joint) return 0; simorder = 0; return 1; }
+	void go() { setState(0); }
 };
 
 extern ParamEntry NI_Touch_tab[];
-class NI_Touch: public NeuroImpl
+class NI_Touch : public NeuroImpl
 {
 public:
-double range;
-NeuroImpl* makeNew(){return new NI_Touch();} // for NeuroFactory
-int lateinit() {if (!neuro->part) return 0; simorder=0; return 1;}
-void go() {setState(0);}
-NI_Touch():range(1) {paramentries=NI_Touch_tab;}
+	double range;
+	NeuroImpl* makeNew(){ return new NI_Touch(); } // for NeuroFactory
+	int lateinit() { if (!neuro->part) return 0; simorder = 0; return 1; }
+	void go() { setState(0); }
+	NI_Touch() :range(1) { paramentries = NI_Touch_tab; }
 };
 
-class NI_Smell: public NeuroImpl
+class NI_Smell : public NeuroImpl
 {
 public:
-NeuroImpl* makeNew(){return new NI_Smell();} // for NeuroFactory
-void go() {setState(0);}
-int lateinit() {if (!neuro->part) return 0; simorder=0; return 1;}
+	NeuroImpl* makeNew(){ return new NI_Smell(); } // for NeuroFactory
+	void go() { setState(0); }
+	int lateinit() { if (!neuro->part) return 0; simorder = 0; return 1; }
 };
 
 extern ParamEntry NI_BendMuscle_tab[];
-class NI_BendMuscle: public NeuroImpl
+class NI_BendMuscle : public NeuroImpl
 {
 public:
-double power,bendrange;
-NeuroImpl* makeNew(){return new NI_BendMuscle();} // for NeuroFactory
-NI_BendMuscle() {paramentries=NI_BendMuscle_tab;}
-int lateinit() {if (!neuro->joint) return 0; simorder=2; return 1;}
-void go() {}
+	double power, bendrange;
+	NeuroImpl* makeNew(){ return new NI_BendMuscle(); } // for NeuroFactory
+	NI_BendMuscle() { paramentries = NI_BendMuscle_tab; }
+	int lateinit() { if (!neuro->joint) return 0; simorder = 2; return 1; }
+	void go() {}
 };
 
 extern ParamEntry NI_RotMuscle_tab[];
-class NI_RotMuscle: public NeuroImpl
+class NI_RotMuscle : public NeuroImpl
 {
 public:
-double power;
-NeuroImpl* makeNew(){return new NI_RotMuscle();} // for NeuroFactory
-NI_RotMuscle() {paramentries=NI_RotMuscle_tab;}
-int lateinit() {if (!neuro->joint) return 0; simorder=2; return 1;}
-void go() {}
+	double power;
+	NeuroImpl* makeNew(){ return new NI_RotMuscle(); } // for NeuroFactory
+	NI_RotMuscle() { paramentries = NI_RotMuscle_tab; }
+	int lateinit() { if (!neuro->joint) return 0; simorder = 2; return 1; }
+	void go() {}
 };
 
 extern ParamEntry NI_LinearMuscle_tab[];
-class NI_LinearMuscle: public NeuroImpl
+class NI_LinearMuscle : public NeuroImpl
 {
 public:
-double power;
-NeuroImpl* makeNew(){return new NI_RotMuscle();} // for NeuroFactory
-NI_LinearMuscle() {paramentries=NI_RotMuscle_tab;}
-int lateinit() {if (!neuro->joint) return 0; simorder=2; return 1;}
-void go() {}
+	double power;
+	NeuroImpl* makeNew(){ return new NI_RotMuscle(); } // for NeuroFactory
+	NI_LinearMuscle() { paramentries = NI_RotMuscle_tab; }
+	int lateinit() { if (!neuro->joint) return 0; simorder = 2; return 1; }
+	void go() {}
 };
 
-class NI_Sticky: public NeuroImpl
+class NI_Sticky : public NeuroImpl
 {
 public:
-double power;
-NeuroImpl* makeNew(){return new NI_Sticky();} // for NeuroFactory
-int lateinit() {if (!neuro->part) return 0; simorder=0; return 1;}
-void go() {}
+	double power;
+	NeuroImpl* makeNew(){ return new NI_Sticky(); } // for NeuroFactory
+	int lateinit() { if (!neuro->part) return 0; simorder = 0; return 1; }
+	void go() {}
 };
 
-class NI_WaterDetect: public NeuroImpl
+class NI_WaterDetect : public NeuroImpl
 {
 public:
-NeuroImpl* makeNew(){return new NI_WaterDetect();} // for NeuroFactory
-int lateinit() {if (!neuro->part) return 0; simorder=0; return 1;}
-void go() {setState(0);}
+	NeuroImpl* makeNew(){ return new NI_WaterDetect(); } // for NeuroFactory
+	int lateinit() { if (!neuro->part) return 0; simorder = 0; return 1; }
+	void go() { setState(0); }
 };
 
-class NI_Energy: public NeuroImpl
+class NI_Energy : public NeuroImpl
 {
 public:
-NeuroImpl* makeNew(){return new NI_Energy();} // for NeuroFactory
-void go() {setState(0);}
+	NeuroImpl* makeNew(){ return new NI_Energy(); } // for NeuroFactory
+	void go() { setState(0); }
 };
 
 #endif
-
Index: /cpp/frams/neuro/impl/neuroimpl-channels.cpp
===================================================================
--- /cpp/frams/neuro/impl/neuroimpl-channels.cpp	(revision 790)
+++ /cpp/frams/neuro/impl/neuroimpl-channels.cpp	(revision 791)
@@ -8,28 +8,28 @@
 void NI_Channelize::go()
 {
-setChannelCount(getInputCount());
-for(int i=0;i<getInputCount();i++)
-	setState(getWeightedInputState(i),i);
+	setChannelCount(getInputCount());
+	for (int i = 0; i < getInputCount(); i++)
+		setState(getWeightedInputState(i), i);
 }
 
 void NI_ChMux::go()
 {
-int c=getInputChannelCount(1);
-if (c<2) {setState(getWeightedInputState(1)); return;}
-double s=getWeightedInputState(0);
-s=(max(-1.0,min(1.0,s))+1.0)/2.0; // 0..1
-int i1;
-i1=(int)(s*(c-1)); i1=max(0,min(i1,c-2));
-double sw=1.0/(c-1);
-double s1=sw*i1;
-double w1=fabs((s-s1)/sw);
-double w2=1.0-w1;
-double is1=getWeightedInputState(1,i1);
-double is2=getWeightedInputState(1,i1+1);
-setState(is1*w2 + is2*w1);
+	int c = getInputChannelCount(1);
+	if (c < 2) { setState(getWeightedInputState(1)); return; }
+	double s = getWeightedInputState(0);
+	s = (max(-1.0, min(1.0, s)) + 1.0) / 2.0; // 0..1
+	int i1;
+	i1 = (int)(s*(c - 1)); i1 = max(0, min(i1, c - 2));
+	double sw = 1.0 / (c - 1);
+	double s1 = sw*i1;
+	double w1 = fabs((s - s1) / sw);
+	double w2 = 1.0 - w1;
+	double is1 = getWeightedInputState(1, i1);
+	double is2 = getWeightedInputState(1, i1 + 1);
+	setState(is1*w2 + is2*w1);
 }
 
 void NI_ChSel::go()
 {
-setState(getWeightedInputState(0,ch));
+	setState(getWeightedInputState(0, ch));
 }
Index: /cpp/frams/neuro/impl/neuroimpl-channels.h
===================================================================
--- /cpp/frams/neuro/impl/neuroimpl-channels.h	(revision 790)
+++ /cpp/frams/neuro/impl/neuroimpl-channels.h	(revision 791)
@@ -8,27 +8,27 @@
 #include <frams/neuro/neuroimpl.h>
 
-class NI_Channelize: public NeuroImpl
+class NI_Channelize : public NeuroImpl
 {
 public:
-NeuroImpl* makeNew(){return new NI_Channelize();} // for NeuroFactory
-void go();
+	NeuroImpl* makeNew(){ return new NI_Channelize(); } // for NeuroFactory
+	void go();
 };
 
-class NI_ChMux: public NeuroImpl
+class NI_ChMux : public NeuroImpl
 {
 public:
-NeuroImpl* makeNew(){return new NI_ChMux();} // for NeuroFactory
-void go();
+	NeuroImpl* makeNew(){ return new NI_ChMux(); } // for NeuroFactory
+	void go();
 };
 
 extern ParamEntry NI_ChSel_tab[];
 
-class NI_ChSel: public NeuroImpl
+class NI_ChSel : public NeuroImpl
 {
 public:
-int ch; // channel
-NI_ChSel():ch(0) {paramentries=NI_ChSel_tab;}
-NeuroImpl* makeNew(){return new NI_ChSel();} // for NeuroFactory
-void go();
+	int ch; // channel
+	NI_ChSel() :ch(0) { paramentries = NI_ChSel_tab; }
+	NeuroImpl* makeNew(){ return new NI_ChSel(); } // for NeuroFactory
+	void go();
 };
 
@@ -36,4 +36,2 @@
 #endif
 
-
-
Index: /cpp/frams/neuro/impl/neuroimpl-fuzzy-f0.cpp
===================================================================
--- /cpp/frams/neuro/impl/neuroimpl-fuzzy-f0.cpp	(revision 790)
+++ /cpp/frams/neuro/impl/neuroimpl-fuzzy-f0.cpp	(revision 791)
@@ -14,25 +14,25 @@
 int FuzzyF0String::convertStrToSets(const SString& str, double numbers[], int nrOfSets)
 {
-  int pos=0;
-  SString t;
-  int have=0;
-  int maxnumbers=4*nrOfSets; //number of semicolons should be equal 4*nrOfSets
+	int pos = 0;
+	SString t;
+	int have = 0;
+	int maxnumbers = 4 * nrOfSets; //number of semicolons should be equal 4*nrOfSets
 
-  while (str.getNextToken(pos,t,';'))
-    if (have>=maxnumbers)
-      break;
-    else
-      numbers[have++]=atof(t.c_str());
+	while (str.getNextToken(pos, t, ';'))
+		if (have >= maxnumbers)
+			break;
+		else
+			numbers[have++] = atof(t.c_str());
 
-  //check if number of read numbers (separated with semicolon) is equal to declared
-  if (have != 4*nrOfSets)
-    return -1; //number of sets found is lower than declared!
+	//check if number of read numbers (separated with semicolon) is equal to declared
+	if (have != 4 * nrOfSets)
+		return -1; //number of sets found is lower than declared!
 
-  //check corectness of sets - must not be decreasing
-  for(int i=0;i<nrOfSets;i++)
-    if((numbers[4*i]>numbers[4*i+1])||(numbers[4*i+1]>numbers[4*i+2])||(numbers[4*i+2]>numbers[4*i+3]))
-      return -2; //error
+	//check corectness of sets - must not be decreasing
+	for (int i = 0; i < nrOfSets; i++)
+		if ((numbers[4 * i] > numbers[4 * i + 1]) || (numbers[4 * i + 1] > numbers[4 * i + 2]) || (numbers[4 * i + 2] > numbers[4 * i + 3]))
+			return -2; //error
 
-  return 0;
+	return 0;
 }
 
@@ -47,34 +47,34 @@
 int FuzzyF0String::countInputsOutputs(const char* str, int ruldef[], int rulesNr)
 { //ruledef will remember counted number of inputs and outputs for every rule
-  const char* t;
-  int separators=0, inouts=0;
+	const char* t;
+	int separators = 0, inouts = 0;
 
-  for(t=str;*t;t++)
-  {
-    while(isdigit(*t))
-      t++; //only count, does not care about numbers now
-    if (!*t)
-      break; //end of the string - get out of 'for' loop
-    if ( (*t==';')||(*t==':')||(*t=='/') ) //found sth different than digit - it must be a separator
-    {
-      separators++; //one of separators
-      if (*t!=';') // end of [conditional part of] rule
-      {
-	if (inouts >= 2*rulesNr) //more rules declared in string than declared in rulesNr
-	  return -2;
-        ruldef[inouts]=(separators+1)/2; //cause fuzzy sets - for 1 in/out there are 2 semicolons
-	separators=0;  //begin counting number of in/out from zero
-	inouts++; //next part of rule / or next rule
-      }
-    }
-    else // illegal character
-      return -1;
-  }
+	for (t = str; *t; t++)
+	{
+		while (isdigit(*t))
+			t++; //only count, does not care about numbers now
+		if (!*t)
+			break; //end of the string - get out of 'for' loop
+		if ((*t == ';') || (*t == ':') || (*t == '/')) //found sth different than digit - it must be a separator
+		{
+			separators++; //one of separators
+			if (*t != ';') // end of [conditional part of] rule
+			{
+				if (inouts >= 2 * rulesNr) //more rules declared in string than declared in rulesNr
+					return -2;
+				ruldef[inouts] = (separators + 1) / 2; //cause fuzzy sets - for 1 in/out there are 2 semicolons
+				separators = 0;  //begin counting number of in/out from zero
+				inouts++; //next part of rule / or next rule
+			}
+		}
+		else // illegal character
+			return -1;
+	}
 
-  //check, if nr of found rules is equal to declared
-  if (inouts == 2*rulesNr) //each rule has a conditional part (inputs) and decisional part (outputs)
-    return 0;
-  else
-    return -5; // ShowMessage("Inconsistent number of rules!");
+	//check, if nr of found rules is equal to declared
+	if (inouts == 2 * rulesNr) //each rule has a conditional part (inputs) and decisional part (outputs)
+		return 0;
+	else
+		return -5; // ShowMessage("Inconsistent number of rules!");
 }
 
@@ -83,53 +83,56 @@
 int FuzzyF0String::convertStrToRules(const SString& str, const int ruledef[], int **rules, int setsNr, int rulesNr, int &maxOutputNr)
 {
-  int pos=0, j, k, len=str.len();
-  int dNr=0, sNr=0;
-  int inNr, outNr; //number of inputs/outputs and corresponding fuzzy sets
-  SString t;
-  bool conditional=true; //which part of rule: conditional or decisional
+	int pos = 0, j, k, len = str.len();
+	int dNr = 0, sNr = 0;
+	int inNr, outNr; //number of inputs/outputs and corresponding fuzzy sets
+	SString t;
+	bool conditional = true; //which part of rule: conditional or decisional
 
-  maxOutputNr=0; //sets maximum output nr found in rules string
+	maxOutputNr = 0; //sets maximum output nr found in rules string
 
-  //check corectness of the string: number semicolon ... separated with colon or slash
-  while(pos<len)
-  {
-    while((pos<len)&&(isdigit(str.charAt(pos)))) pos++;
-    if(!(pos<len))
-      break; //end of the string
-    if(str.charAt(pos)!=';')
-      if((str.charAt(pos)==':')&&(conditional))
-        {sNr++; conditional=false;}
-      else if((str.charAt(pos)=='/')&&(!conditional))
-        {dNr++; conditional=true;}
-      else
-        return -4; //error - illegal character
-    pos++;
-  }
-  if( (dNr!=sNr) || (dNr!=rulesNr) )
-    return -5; //error - wrong number of rules
+	//check corectness of the string: number semicolon ... separated with colon or slash
+	while (pos < len)
+	{
+		while ((pos < len) && (isdigit(str.charAt(pos)))) pos++;
+		if (!(pos < len))
+			break; //end of the string
+		if (str.charAt(pos) != ';')
+			if ((str.charAt(pos) == ':') && (conditional))
+			{
+			sNr++; conditional = false;
+			}
+			else if ((str.charAt(pos) == '/') && (!conditional))
+			{
+				dNr++; conditional = true;
+			}
+			else
+				return -4; //error - illegal character
+			pos++;
+	}
+	if ((dNr != sNr) || (dNr != rulesNr))
+		return -5; //error - wrong number of rules
 
-  pos=0;
+	pos = 0;
 
-  for(j=0;j<rulesNr;j++)
-  { //sum of inputs and outputs
-    inNr = 2*ruledef[2*j];
-    outNr = 2*ruledef[2*j+1];
-    for(k=0;k<inNr+outNr;k++)
-    {
-      t = ""; //clear previous value
-      //cuts next integer values
-      while ( (pos<len)&&(isdigit(str.charAt(pos))) )
-        t += str.charAt(pos++);
-      pos++;
-      rules[j][k]=atol(t.c_str()); //convert cut out string into number
-      //fuzzy sets - odd index table - are counted from 0,
-      //so if 5 fuzzy sets declared, values acceptable are 0,1,2,3,4
-      if ( ((k%2)!=0) && (rules[j][k] >= setsNr) )
-      	return -1;
-      if((k>=inNr)&&((k%2)==0))
-        maxOutputNr=max(maxOutputNr,rules[j][k]);
-    }
-  }
-  return 0;
+	for (j = 0; j < rulesNr; j++)
+	{ //sum of inputs and outputs
+		inNr = 2 * ruledef[2 * j];
+		outNr = 2 * ruledef[2 * j + 1];
+		for (k = 0; k < inNr + outNr; k++)
+		{
+			t = ""; //clear previous value
+			//cuts next integer values
+			while ((pos < len) && (isdigit(str.charAt(pos))))
+				t += str.charAt(pos++);
+			pos++;
+			rules[j][k] = atol(t.c_str()); //convert cut out string into number
+			//fuzzy sets - odd index table - are counted from 0,
+			//so if 5 fuzzy sets declared, values acceptable are 0,1,2,3,4
+			if (((k % 2) != 0) && (rules[j][k] >= setsNr))
+				return -1;
+			if ((k >= inNr) && ((k % 2) == 0))
+				maxOutputNr = max(maxOutputNr, rules[j][k]);
+		}
+	}
+	return 0;
 }
-
Index: /cpp/frams/neuro/impl/neuroimpl-fuzzy-f0.h
===================================================================
--- /cpp/frams/neuro/impl/neuroimpl-fuzzy-f0.h	(revision 790)
+++ /cpp/frams/neuro/impl/neuroimpl-fuzzy-f0.h	(revision 791)
@@ -3,6 +3,6 @@
 // See LICENSE.txt for details.
 
-/// this is a module included into neuroimpl-fuzzy
-/// it converts string parameters - fuzzy sets and fuzzy rules - into appropriate variables
+/// This is a module included into neuroimpl-fuzzy.
+/// It converts string parameters (fuzzy sets and fuzzy rules) into appropriate variables.
 
 #ifndef _neuroimpl_fuzzy_f0_h
@@ -14,8 +14,8 @@
 class FuzzyF0String
 {
-  public:
-  static int convertStrToSets(const SString& str, double numbers[], int nrOfSets);
-  static int countInputsOutputs(const char* str, int ruldef[], int rulesNr);
-  static int convertStrToRules(const SString& str, const int ruledef[], int **rules, int setsNr, int rulesNr, int &maxOutputNr);
+public:
+	static int convertStrToSets(const SString& str, double numbers[], int nrOfSets);
+	static int countInputsOutputs(const char* str, int ruldef[], int rulesNr);
+	static int convertStrToRules(const SString& str, const int ruledef[], int **rules, int setsNr, int rulesNr, int &maxOutputNr);
 };
 
Index: /cpp/frams/neuro/impl/neuroimpl-fuzzy.cpp
===================================================================
--- /cpp/frams/neuro/impl/neuroimpl-fuzzy.cpp	(revision 790)
+++ /cpp/frams/neuro/impl/neuroimpl-fuzzy.cpp	(revision 791)
@@ -9,75 +9,75 @@
 int NI_FuzzyNeuro::countOuts(const Model *m, const Neuro *fuzzy)
 {
-  int outputs=0;
-  for(int i=0;i<m->getNeuroCount();i++)
-     for(int in=0;in<m->getNeuro(i)->getInputCount();in++)
-        if (m->getNeuro(i)->getInput(in)==fuzzy) outputs++;
-  return outputs;
+	int outputs = 0;
+	for (int i = 0; i < m->getNeuroCount(); i++)
+		for (int in = 0; in < m->getNeuro(i)->getInputCount(); in++)
+			if (m->getNeuro(i)->getInput(in) == fuzzy) outputs++;
+	return outputs;
 }
 
 int NI_FuzzyNeuro::lateinit()
 {
-  int i, maxOutputNr;
-
-  //check correctness of given parameters: string must not be null, sets&rules number > 0
-  if((fuzzySetsNr<1)||(rulesNr<1)||(fuzzySetString.len()==0)||(fuzzyRulesString.len()==0))
-    return 0; //error
-
-  // this part contains transformation of fuzzy sets
-  fuzzySets = new double[4*fuzzySetsNr]; //because every fuzzy set consist of 4 numbers
-  // converts fuzzy string from f0 to table of fuzzy numbers type 'double'
-  // (fill created space with numbers taken from string)
-  // also checks whether number of fuzzy sets in the string equals declared in the definition
-  if (FuzzyF0String::convertStrToSets(fuzzySetString, fuzzySets, fuzzySetsNr) != 0)
-    return 0; //error
-
-  // this part contains transformation of fuzzy rules and defuzzyfication parameters
-  rulesDef = new int[2*rulesNr];    //for each rule remembers number of inputs and outputs
-  //check correctness of string and fill in the rulesDef
-  if (FuzzyF0String::countInputsOutputs(fuzzyRulesString.c_str(), rulesDef, rulesNr) == 0)
-  {
-    defuzzParam = new double[rulesNr]; // parameters used in defuzyfication process
-    // create space for rules according to rulesDef
-    rules = new int*[rulesNr];   //list of rules...
-    for (i=0; i<rulesNr; i++)    //...that contains rules body
-    {
-      rules[i] = new int[2*(rulesDef[2*i]+rulesDef[2*i+1])];  //each rule can have different number of inputs and outputs
-      defuzzParam[i] = 0; //should be done a little bit earlier, but why do not use this loop?
-    }
-    // fill created space with numbers taken from string
-    if (FuzzyF0String::convertStrToRules(fuzzyRulesString, rulesDef, rules, fuzzySetsNr, rulesNr, maxOutputNr) != 0)
-      return 0; //error
-  }
-  else
-    return 0; //error
-
-  setChannelCount(countOuts(neuro->owner, neuro));
-  return 1; //success
+	int i, maxOutputNr;
+
+	//check correctness of given parameters: string must not be null, sets&rules number > 0
+	if ((fuzzySetsNr < 1) || (rulesNr < 1) || (fuzzySetString.len() == 0) || (fuzzyRulesString.len() == 0))
+		return 0; //error
+
+	// this part contains transformation of fuzzy sets
+	fuzzySets = new double[4 * fuzzySetsNr]; //because every fuzzy set consist of 4 numbers
+	// converts fuzzy string from f0 to table of fuzzy numbers type 'double'
+	// (fill created space with numbers taken from string)
+	// also checks whether number of fuzzy sets in the string equals declared in the definition
+	if (FuzzyF0String::convertStrToSets(fuzzySetString, fuzzySets, fuzzySetsNr) != 0)
+		return 0; //error
+
+	// this part contains transformation of fuzzy rules and defuzzyfication parameters
+	rulesDef = new int[2 * rulesNr];    //for each rule remembers number of inputs and outputs
+	//check correctness of string and fill in the rulesDef
+	if (FuzzyF0String::countInputsOutputs(fuzzyRulesString.c_str(), rulesDef, rulesNr) == 0)
+	{
+		defuzzParam = new double[rulesNr]; // parameters used in defuzyfication process
+		// create space for rules according to rulesDef
+		rules = new int*[rulesNr];   //list of rules...
+		for (i = 0; i < rulesNr; i++)    //...that contains rules body
+		{
+			rules[i] = new int[2 * (rulesDef[2 * i] + rulesDef[2 * i + 1])];  //each rule can have different number of inputs and outputs
+			defuzzParam[i] = 0; //should be done a little bit earlier, but why do not use this loop?
+		}
+		// fill created space with numbers taken from string
+		if (FuzzyF0String::convertStrToRules(fuzzyRulesString, rulesDef, rules, fuzzySetsNr, rulesNr, maxOutputNr) != 0)
+			return 0; //error
+	}
+	else
+		return 0; //error
+
+	setChannelCount(countOuts(neuro->owner, neuro));
+	return 1; //success
 }
 
 NI_FuzzyNeuro::~NI_FuzzyNeuro()
 {
-  if(rules) //delete rows and columns of **rules
-  {
-    for (int i=0; i<rulesNr; i++) SAFEDELETEARRAY(rules[i])
-    SAFEDELETEARRAY(rules)
-  }
-  SAFEDELETEARRAY(defuzzParam)
-  SAFEDELETEARRAY(rulesDef)
-  SAFEDELETEARRAY(fuzzySets)
+	if (rules) //delete rows and columns of **rules
+	{
+		for (int i = 0; i < rulesNr; i++) SAFEDELETEARRAY(rules[i])
+			SAFEDELETEARRAY(rules)
+	}
+	SAFEDELETEARRAY(defuzzParam)
+		SAFEDELETEARRAY(rulesDef)
+		SAFEDELETEARRAY(fuzzySets)
 }
 
 int NI_FuzzyNeuro::GetFuzzySetParam(int set_nr, double &left, double &midleft, double &midright, double &right)
 {
-  if ( (set_nr>=0) && (set_nr<fuzzySetsNr) )
-  {
-    left = fuzzySets[4*set_nr];
-    midleft = fuzzySets[4*set_nr+1];
-    midright = fuzzySets[4*set_nr+2];
-    right = fuzzySets[4*set_nr+3];
-    return 0;
-  }
-  else
-    return 1;
+	if ((set_nr >= 0) && (set_nr < fuzzySetsNr))
+	{
+		left = fuzzySets[4 * set_nr];
+		midleft = fuzzySets[4 * set_nr + 1];
+		midright = fuzzySets[4 * set_nr + 2];
+		right = fuzzySets[4 * set_nr + 3];
+		return 0;
+	}
+	else
+		return 1;
 }
 
@@ -85,8 +85,8 @@
 void NI_FuzzyNeuro::go()
 {
-  if (Fuzzyfication()!=0)
-    return;
-  if (Defuzzyfication()!=0)
-    return;
+	if (Fuzzyfication() != 0)
+		return;
+	if (Defuzzyfication() != 0)
+		return;
 }
 
@@ -97,23 +97,23 @@
 int NI_FuzzyNeuro::Fuzzyfication()
 {
-  int i, j, nrIn, inputNr, nrFuzzySet;
-  double minimumCut; // actual minimal level of cut (= min. membership function)
-
-  // sets defuzzyfication parameters for each rule:
-  for (i=0; i<rulesNr; i++)
-  {
-    nrIn = rulesDef[2*i]; // nr of inputs in rule #i
-    minimumCut = 2; // the highest value of membership function is 1.0, so this value will definitely change
-    for (j=0; (j<nrIn)&&(minimumCut>0); j++) //minimumCut can not be <0, so if =0 then stop calculations
-    {
-      nrFuzzySet = rules[i][j*2 + 1]; // j*2 moves pointer through each output, +1 moves to nr of fuzzy set
-      inputNr = rules[i][j*2]; // as above but gives input number
-      minimumCut = min( minimumCut, TrapeziumFuzz(nrFuzzySet, getWeightedInputState(inputNr))); // value of membership function for this input and given fuzzy set
-    }
-    if ( (minimumCut>1) || (minimumCut<0) )
-      return 1;
-    defuzzParam[i] = minimumCut;
-  }
-  return 0;
+	int i, j, nrIn, inputNr, nrFuzzySet;
+	double minimumCut; // actual minimal level of cut (= min. membership function)
+
+	// sets defuzzyfication parameters for each rule:
+	for (i = 0; i < rulesNr; i++)
+	{
+		nrIn = rulesDef[2 * i]; // nr of inputs in rule #i
+		minimumCut = 2; // the highest value of membership function is 1.0, so this value will definitely change
+		for (j = 0; (j < nrIn) && (minimumCut>0); j++) //minimumCut can not be <0, so if =0 then stop calculations
+		{
+			nrFuzzySet = rules[i][j * 2 + 1]; // j*2 moves pointer through each output, +1 moves to nr of fuzzy set
+			inputNr = rules[i][j * 2]; // as above but gives input number
+			minimumCut = min(minimumCut, TrapeziumFuzz(nrFuzzySet, getWeightedInputState(inputNr))); // value of membership function for this input and given fuzzy set
+		}
+		if ((minimumCut>1) || (minimumCut < 0))
+			return 1;
+		defuzzParam[i] = minimumCut;
+	}
+	return 0;
 }
 
@@ -127,31 +127,31 @@
 double NI_FuzzyNeuro::TrapeziumFuzz(int which_fuzzy_set, double input_val)
 {
-  double range=0, left=0, midleft=0, midright=0, right=0;
-
-  if ( (which_fuzzy_set < 0) || (which_fuzzy_set > fuzzySetsNr) )
-    return -2;
-  if ( (input_val < -1) || (input_val > 1) )
-    return -3;
-
-  if (GetFuzzySetParam(which_fuzzy_set, left, midleft, midright, right) != 0)
-    return -4;
-
-  if ( (input_val < left) || (input_val > right) ) // greather than right value
-    return 0;
-  else if ( (input_val >= midleft) && (input_val <= midright) ) // in the core of fuzzy set
-    return 1;
-  else if ( (input_val >= left) && (input_val < midleft) ) // at the left side of trapezium
-  {
-    range = fabs(midleft - left);
-    return fabs(input_val-left)/((range>0)?range:1); // quotient of distance between input and extreme left point of trapezium and range of rising side, or 1
-  }
-  else if ( (input_val > midright) && (input_val <= right) ) // at the right side of trapezium
-  {
-    range = fabs(right - midright);
-    return fabs(right-input_val)/((range>0)?range:1); // quotient of distance between input and extreme right point of trapezium and range of falling side, or 1
-  };
-
-  // should not occur
-  return 0;
+	double range = 0, left = 0, midleft = 0, midright = 0, right = 0;
+
+	if ((which_fuzzy_set < 0) || (which_fuzzy_set > fuzzySetsNr))
+		return -2;
+	if ((input_val < -1) || (input_val > 1))
+		return -3;
+
+	if (GetFuzzySetParam(which_fuzzy_set, left, midleft, midright, right) != 0)
+		return -4;
+
+	if ((input_val < left) || (input_val > right)) // greather than right value
+		return 0;
+	else if ((input_val >= midleft) && (input_val <= midright)) // in the core of fuzzy set
+		return 1;
+	else if ((input_val >= left) && (input_val < midleft)) // at the left side of trapezium
+	{
+		range = fabs(midleft - left);
+		return fabs(input_val - left) / ((range > 0) ? range : 1); // quotient of distance between input and extreme left point of trapezium and range of rising side, or 1
+	}
+	else if ((input_val > midright) && (input_val <= right)) // at the right side of trapezium
+	{
+		range = fabs(right - midright);
+		return fabs(right - input_val) / ((range > 0) ? range : 1); // quotient of distance between input and extreme right point of trapezium and range of falling side, or 1
+	};
+
+	// should not occur
+	return 0;
 
 }
@@ -165,45 +165,46 @@
 int NI_FuzzyNeuro::Defuzzyfication()
 {
-  int i, j, nrIn, nrOut, out, set, outputsNr;
-  double *numerators, *denominators, midleft, midright, unimp;
-
-  outputsNr = getChannelCount();
-
-  numerators = new double[outputsNr];
-  denominators = new double[outputsNr];
-
-  for(i=0;i<outputsNr;i++) numerators[i] = denominators[i] = 0;
-
-  // for each rule...
-  for (i=0; i<rulesNr; i++)
-  {
-    nrIn = rulesDef[2*i]; // number of inputs in rule #i
-    nrOut = rulesDef[2*i + 1]; // number of outputs in rule #i
-    // ...calculate each output's product of middle fuzzy set value and minimum membership function (numerator) and sum of minimum membership function (denominator)
-    for (j=0; j<nrOut; j++)
-    {
-      out = rules[i][2*nrIn + 2*j]; //number of j-output
-      set = rules[i][2*nrIn + 2*j + 1]; //number of fuzzy set attributed to j-output
-      if (GetFuzzySetParam(set, unimp, midleft, midright, unimp) != 0) // gets range of core of given fuzzy set
-        { SAFEDELETEARRAY(denominators) SAFEDELETEARRAY(numerators) return 1; }
-      //defuzzParam[i] = minimum membership function for rule #i - calculated in fuzzyfication block
-      // defuzzyfication method of singletons (high): (fuzzy set modal value) * (minimum membership value)
-      numerators[out] += ((midleft + midright)/2.0) * defuzzParam[i];
-      denominators[out] += defuzzParam[i];
-    }
-  }
-
-  for (i=0; i<outputsNr; i++)
-  {
-    if (denominators[i] == 0)
-      setState(0, i);
-    else
-      setState(numerators[i]/denominators[i], i);
-  }
-
-  SAFEDELETEARRAY(denominators)
-  SAFEDELETEARRAY(numerators)
-
-  return 0;
-}
-
+	int i, j, nrIn, nrOut, out, set, outputsNr;
+	double *numerators, *denominators, midleft, midright, unimp;
+
+	outputsNr = getChannelCount();
+
+	numerators = new double[outputsNr];
+	denominators = new double[outputsNr];
+
+	for (i = 0; i < outputsNr; i++) numerators[i] = denominators[i] = 0;
+
+	// for each rule...
+	for (i = 0; i < rulesNr; i++)
+	{
+		nrIn = rulesDef[2 * i]; // number of inputs in rule #i
+		nrOut = rulesDef[2 * i + 1]; // number of outputs in rule #i
+		// ...calculate each output's product of middle fuzzy set value and minimum membership function (numerator) and sum of minimum membership function (denominator)
+		for (j = 0; j < nrOut; j++)
+		{
+			out = rules[i][2 * nrIn + 2 * j]; //number of j-output
+			set = rules[i][2 * nrIn + 2 * j + 1]; //number of fuzzy set attributed to j-output
+			if (GetFuzzySetParam(set, unimp, midleft, midright, unimp) != 0) // gets range of core of given fuzzy set
+			{
+				SAFEDELETEARRAY(denominators) SAFEDELETEARRAY(numerators) return 1;
+			}
+			//defuzzParam[i] = minimum membership function for rule #i - calculated in fuzzyfication block
+			// defuzzyfication method of singletons (high): (fuzzy set modal value) * (minimum membership value)
+			numerators[out] += ((midleft + midright) / 2.0) * defuzzParam[i];
+			denominators[out] += defuzzParam[i];
+		}
+	}
+
+	for (i = 0; i < outputsNr; i++)
+	{
+		if (denominators[i] == 0)
+			setState(0, i);
+		else
+			setState(numerators[i] / denominators[i], i);
+	}
+
+	SAFEDELETEARRAY(denominators)
+		SAFEDELETEARRAY(numerators)
+
+		return 0;
+}
Index: /cpp/frams/neuro/impl/neuroimpl-fuzzy.h
===================================================================
--- /cpp/frams/neuro/impl/neuroimpl-fuzzy.h	(revision 790)
+++ /cpp/frams/neuro/impl/neuroimpl-fuzzy.h	(revision 791)
@@ -20,51 +20,51 @@
 private:
 
-  double *fuzzySets;    /// list of four digits which represents fuzzy sets: [0]-l, [1]-m, [2]-n, [3]-r, ...  fuzzySet[4*i] = left, fuzzySet[4*i + 1] = midleft, fuzzySet[4*i + 2] = midright, fuzzySet[4*i + 3] = right
+	double *fuzzySets;    /// list of four digits which represents fuzzy sets: [0]-l, [1]-m, [2]-n, [3]-r, ...  fuzzySet[4*i] = left, fuzzySet[4*i + 1] = midleft, fuzzySet[4*i + 2] = midright, fuzzySet[4*i + 3] = right
 
-  /** Determines, which fuzzy set is connected with each input of neuron. For instance third rule:
-  *   'IF input3 = fuzzy set #3 AND input5 = fuzzy set #1 then output2 = fuzzy set #6 AND output7 = fuzzy set #5'
-  *   the variables shoul have values as shown below:
-  *   RulesDef[4]=2; RulesDef[5]=2; //rule 3: 2 inputs, 2 outputs
-  *   Rules[2][0]=3, Rules[2][1]=3, Rules[2][2]=5, Rules[2][3]=1, Rules[2][4]=2, Rules[2][5]=6, Rules[2][6]=7, Rules[2][3]=5
-  */
-  int *rulesDef;    ///list of rules definitions: nr of inputs in rule 1, nr of outputs in rule 1, ... and so on for each rule
-  int **rules;      ///list of rules body: input nr, fuzzy set nr, ... , output nr, fuzzy set nr, ... and so on for each rule
+	/** Determines, which fuzzy set is connected with each input of neuron. For instance third rule:
+	*   'IF input3 = fuzzy set #3 AND input5 = fuzzy set #1 then output2 = fuzzy set #6 AND output7 = fuzzy set #5'
+	*   the variables shoul have values as shown below:
+	*   RulesDef[4]=2; RulesDef[5]=2; //rule 3: 2 inputs, 2 outputs
+	*   Rules[2][0]=3, Rules[2][1]=3, Rules[2][2]=5, Rules[2][3]=1, Rules[2][4]=2, Rules[2][5]=6, Rules[2][6]=7, Rules[2][3]=5
+	*/
+	int *rulesDef;    ///list of rules definitions: nr of inputs in rule 1, nr of outputs in rule 1, ... and so on for each rule
+	int **rules;      ///list of rules body: input nr, fuzzy set nr, ... , output nr, fuzzy set nr, ... and so on for each rule
 
-  /**
-  *  Sets defuzzyfication parameters: determines - for each rule - cut level <0;1> (minimum membership function of current rule).
-  *  In fact, defuzzParam remembers the values from 'first layer' - fuzzyfication layer (see neuron at documentation)
-  *  i.e. rule 1: defuzzParam[0] = 0.3522
-  */
-  double *defuzzParam; /// i.e.: defuzParam[5] = 0.455 means that rule #6 has got a minimum membership function (of given inputs set for this rule) at value 0.455 (it's cut level)
+	/**
+	*  Sets defuzzyfication parameters: determines - for each rule - cut level <0;1> (minimum membership function of current rule).
+	*  In fact, defuzzParam remembers the values from 'first layer' - fuzzyfication layer (see neuron at documentation)
+	*  i.e. rule 1: defuzzParam[0] = 0.3522
+	*/
+	double *defuzzParam; /// i.e.: defuzParam[5] = 0.455 means that rule #6 has got a minimum membership function (of given inputs set for this rule) at value 0.455 (it's cut level)
 
 protected:
 
-  ///Fuzzy functions
-  double TrapeziumFuzz(int which_fuzzy_set, double input_val);
-  int Fuzzyfication();
-  int Defuzzyfication();
-  int GetFuzzySetParam(int set_nr, double &left, double &midleft, double &midright, double &right);
+	///Fuzzy functions
+	double TrapeziumFuzz(int which_fuzzy_set, double input_val);
+	int Fuzzyfication();
+	int Defuzzyfication();
+	int GetFuzzySetParam(int set_nr, double &left, double &midleft, double &midright, double &right);
 
 public:
 
-  int fuzzySetsNr;      /// number of fuzzy sets
-  int rulesNr;      ///number of rules
-  SString fuzzySetString; /// strings containing all fuzzy sets given in f0
-  SString fuzzyRulesString; /// strings containing all fuzzy rules given in f0
+	int fuzzySetsNr;      /// number of fuzzy sets
+	int rulesNr;      ///number of rules
+	SString fuzzySetString; /// strings containing all fuzzy sets given in f0
+	SString fuzzyRulesString; /// strings containing all fuzzy rules given in f0
 
-  NI_FuzzyNeuro() {paramentries=NI_FuzzyNeuro_tab; fuzzySets=defuzzParam=NULL; rulesDef=NULL; rules=NULL;}
-  ~NI_FuzzyNeuro();
-  NeuroImpl* makeNew() { return new NI_FuzzyNeuro(); };
-  void go();
-  int lateinit();
-  /** Function build model based on given genotype and conts number of neurons connected with fuzzy neuro,
-    also checks number of fuzzy neuron inputs.
-    \param genotype genotype to be scanned
-    \param inputs number of fuzzy neuron inputs
-    \param output number of fuzzy neuron outputs (= number of neurons connected to fuzzy neuron)
-    @return success or failure
-  **/
-  static int countOuts(const Model *m, const Neuro *fuzzy);
-  
+	NI_FuzzyNeuro() { paramentries = NI_FuzzyNeuro_tab; fuzzySets = defuzzParam = NULL; rulesDef = NULL; rules = NULL; }
+	~NI_FuzzyNeuro();
+	NeuroImpl* makeNew() { return new NI_FuzzyNeuro(); };
+	void go();
+	int lateinit();
+	/** Function build model based on given genotype and conts number of neurons connected with fuzzy neuro,
+	  also checks number of fuzzy neuron inputs.
+	  \param genotype genotype to be scanned
+	  \param inputs number of fuzzy neuron inputs
+	  \param output number of fuzzy neuron outputs (= number of neurons connected to fuzzy neuron)
+	  @return success or failure
+	  **/
+	static int countOuts(const Model *m, const Neuro *fuzzy);
+
 };
 
Index: /cpp/frams/neuro/impl/neuroimpl-simple.cpp
===================================================================
--- /cpp/frams/neuro/impl/neuroimpl-simple.cpp	(revision 790)
+++ /cpp/frams/neuro/impl/neuroimpl-simple.cpp	(revision 791)
@@ -12,36 +12,36 @@
 int NI_StdNeuron::lateinit()
 {
-istate=newstate+neuro->state; // neuro->state -> random initialization
-calcOutput();
-neuro->state=newstate;
-return 1;
+	istate = newstate + neuro->state; // neuro->state -> random initialization
+	calcOutput();
+	neuro->state = newstate;
+	return 1;
 }
 
 void NI_StdNeuron::calcInternalState()
 {
-double sum=getWeightedInputSum();
-velocity=force*(sum-istate)+inertia*velocity;
-istate+=velocity;
-if (istate>NEURO_MAX) istate=NEURO_MAX;
-else if (istate<-NEURO_MAX) istate=-NEURO_MAX;
+	double sum = getWeightedInputSum();
+	velocity = force*(sum - istate) + inertia*velocity;
+	istate += velocity;
+	if (istate > NEURO_MAX) istate = NEURO_MAX;
+	else if (istate < -NEURO_MAX) istate = -NEURO_MAX;
 }
 
 void NI_StdNeuron::go()
 {
-calcInternalState();
-calcOutput();
+	calcInternalState();
+	calcOutput();
 }
 
 void NI_StdNeuron::calcOutput()
 {
-double s=istate * sigmo;
-if (s<-30.0) setState(-1);
-else setState(2.0/(1.0+exp(-s))-1.0); // -1...1
+	double s = istate * sigmo;
+	if (s < -30.0) setState(-1);
+	else setState(2.0 / (1.0 + exp(-s)) - 1.0); // -1...1
 }
 
 void NI_StdUNeuron::calcOutput()
 {
-double s=istate * sigmo;
-if (s<-30.0) setState(0);
-else setState(1.0/(1.0+exp(-s))); // 0...1
+	double s = istate * sigmo;
+	if (s < -30.0) setState(0);
+	else setState(1.0 / (1.0 + exp(-s))); // 0...1
 }
Index: /cpp/frams/neuro/impl/neuroimpl-simple.h
===================================================================
--- /cpp/frams/neuro/impl/neuroimpl-simple.h	(revision 790)
+++ /cpp/frams/neuro/impl/neuroimpl-simple.h	(revision 791)
@@ -11,39 +11,43 @@
 extern ParamEntry NI_StdNeuron_tab[];
 
-class NI_StdNeuron: public NeuroImpl
+class NI_StdNeuron : public NeuroImpl
 {
-  protected:
-double istate, velocity;
-void calcInternalState();
-virtual void calcOutput();
-  public:
-double inertia,force,sigmo;
-NI_StdNeuron():velocity(0),inertia(0),force(0),sigmo(0)
-	{paramentries=NI_StdNeuron_tab;}
-NeuroImpl* makeNew(){return new NI_StdNeuron();} // for NeuroFactory
-int lateinit();
-void go();
+protected:
+	double istate, velocity;
+	void calcInternalState();
+	virtual void calcOutput();
+public:
+	double inertia, force, sigmo;
+	NI_StdNeuron() :velocity(0), inertia(0), force(0), sigmo(0)
+	{
+		paramentries = NI_StdNeuron_tab;
+	}
+	NeuroImpl* makeNew(){ return new NI_StdNeuron(); } // for NeuroFactory
+	int lateinit();
+	void go();
 };
 
 extern ParamEntry NI_StdUNeuron_tab[];
 
-class NI_StdUNeuron: public NI_StdNeuron
+class NI_StdUNeuron : public NI_StdNeuron
 {
-  public:
-NI_StdUNeuron()
-	{paramentries=NI_StdUNeuron_tab;}
-NeuroImpl* makeNew(){return new NI_StdUNeuron();} // for NeuroFactory
-void calcOutput();
+public:
+	NI_StdUNeuron()
+	{
+		paramentries = NI_StdUNeuron_tab;
+	}
+	NeuroImpl* makeNew(){ return new NI_StdUNeuron(); } // for NeuroFactory
+	void calcOutput();
 };
 
-class NI_Const: public NeuroImpl
+class NI_Const : public NeuroImpl
 {
 public:
-NeuroImpl* makeNew(){return new NI_Const();} // for NeuroFactory
-int lateinit()
+	NeuroImpl* makeNew(){ return new NI_Const(); } // for NeuroFactory
+	int lateinit()
 	{
-	neuro->state=newstate=1.0;
-	simorder=0;
-	return 1;
+		neuro->state = newstate = 1.0;
+		simorder = 0;
+		return 1;
 	}
 };
@@ -51,19 +55,19 @@
 class NI_Diff : public NeuroImpl
 {
-double previous;      
-  public:
-NeuroImpl* makeNew() { return new NI_Diff(); };
+	double previous;
+public:
+	NeuroImpl* makeNew() { return new NI_Diff(); };
 
-void go()
+	void go()
 	{
-	double s=getWeightedInputSum();
-	setState(s-previous);
-	previous=s;
+		double s = getWeightedInputSum();
+		setState(s - previous);
+		previous = s;
 	}
-int lateinit()
+	int lateinit()
 	{
-	NeuroImpl::lateinit();
-	previous=neuro->state;
-	return 1;
+		NeuroImpl::lateinit();
+		previous = neuro->state;
+		return 1;
 	}
 };
@@ -71,7 +75,7 @@
 class NI_Random : public NeuroImpl
 {
-  public:
-NeuroImpl* makeNew() { return new NI_Random(); };
-void go() {setState(rnd01*2.0-1.0);}
+public:
+	NeuroImpl* makeNew() { return new NI_Random(); };
+	void go() { setState(rnd01*2.0 - 1.0); }
 };
 
@@ -80,16 +84,17 @@
 class NI_Sinus : public NeuroImpl
 {
-  public:
-double f0,t;
-NeuroImpl* makeNew() { return new NI_Sinus(); };
-NI_Sinus():f0(0),t(0)
-	{paramentries=NI_Sinus_tab;}
-void go()
+public:
+	double f0, t;
+	NeuroImpl* makeNew() { return new NI_Sinus(); };
+	NI_Sinus() :f0(0), t(0)
 	{
-	t+=f0+getWeightedInputSum();
-	setState(sin(t));
+		paramentries = NI_Sinus_tab;
+	}
+	void go()
+	{
+		t += f0 + getWeightedInputSum();
+		setState(sin(t));
 	}
 };
 
 #endif
-
