Example #1
0
 public void ReadStatusFlagsAndUpdateResult()
 {
     // set status flags
     if (MatlabInterface.MatlabVariableToInteger(ClassifierUniqueId + ".WaitingForTrainingResponse", false).Equals(0))
     {
         _waitingForTrainingResponse = false;
     }
     else
     {
         _waitingForTrainingResponse = true;
     }
     // update/fetch the result
     if (MatlabInterface.MatlabVariableToInteger(ClassifierUniqueId + ".ObjectFound", false).Equals(0))
     {
         Result = false;
     }
     else
     {
         Result = true;
     }
     // inform all
     if (NewResultAvailable != null)
     {
         NewResultAvailable(this, new EventArgs());
     }
 }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="inputVariable"></param>
        /// <param name="inputVariableValue"></param>
        /// <returns></returns>
        public ClassCategory GetDecision(PatternClassificationInput inputVariable, int inputVariableValue)
        {
            // MatlabInterface.Execute request
            MatlabInterface.Execute("inputClassifierDecision = " + ClassifierUniqueId + ".InputNodeClassifiers(" + inputVariable.ClassifierMatlabIndex + ").getDecision(" + inputVariableValue + ");");
            // fetch value and return
            var intResult = MatlabInterface.MatlabVariableToInteger("inputClassifierDecision", true);
            var c         = _classificationCategories[intResult - 1];

            return(c);
        }
        private ClassCategory GetDecisionFromMatlabObj()
        {
            // execute request
            Execute(ClassifierUniqueId + " = " + ClassifierUniqueId + ".getDecision(evaluateTheseValues);");
            Execute("Decision = " + ClassifierUniqueId + ".Decision;");
            // get result
            //var categoryNumber = Cognition.MatlabVariableToInteger(ClassifierUniqueId + ".Decision", false)
            var categoryNumber = MatlabInterface.MatlabVariableToInteger("Decision", false);
            var cat            = _classificationCategories[categoryNumber - 1];

            return(cat);
        }