public Fuzzy.Function AddFunctionInCurrentConditionExpressionList(int conditionIndex, int functionIndex) { functionIndexes[conditionIndex].Add(functionIndex); _currentFunction = null; _currentFunction = GetConceptByIndex(conceptIndexes[conditionIndex][functionIndexes[conditionIndex].Count - 1]).Functions[functionIndex]; return(_currentFunction); }
public Fuzzy.Function GetFunctionFromConditionExpression(int conditionIndex, int expressionIndex) { _currentFunction = null; _currentFunction = GetFunctionFromConceptByIndex( GetConceptByIndex(conceptIndexes[conditionIndex][expressionIndex]), functionIndexes[conditionIndex][expressionIndex]); return(_currentFunction); }
public Fuzzy.Function SetFunctionForCurrentConditionExpression(int conditionIndex, int expresssionIndex, int functionIndex) { try { functionIndexes[conditionIndex][expresssionIndex] = functionIndex; _currentFunction = null; _currentFunction = GetConceptByIndex(conceptIndexes[conditionIndex][expresssionIndex]).Functions[functionIndex]; } catch (System.ArgumentOutOfRangeException) { Debug.LogError("@" + GetType() + " - Index exception. Invalid index for condition or expression list"); } return(_currentFunction); }
public int GetFunctionIndexFromConcept(Fuzzy.Function function, Fuzzy.Concept inConcept) { if (inConcept.GetFunction(function)) { for (int i = 0; i < inConcept.Functions.Count; i++) { if (function.Equals(inConcept.Functions[i])) { return(i); } } } return(default(int)); }
public Fuzzy.Function GetFunctionFromConceptByIndex(Fuzzy.Concept concept, int index) { _currentFunction = null; try { _currentFunction = functionDictionary[concept][index]; } catch (KeyNotFoundException) { Debug.LogWarning("@" + GetType() + " - Key exception. Could not find the key inside function dictionary"); } catch (System.IndexOutOfRangeException) { Debug.LogWarning("@" + GetType() + " - Index exception. Invalid index for selected concept's function list"); } return(_currentFunction); }