//
// File name: RecognitionSystem.h
//
// Discription: Base classes
//
// Programmer: Vladimir P. Stasevich (SV)
//
// History: 
//    Created 13.02.2000 (SV)
//

#ifndef RECOGNITIONSYSTEM_H
#define RECOGNITIONSYSTEM_H

#include "RecognitionNet.h"
#include "Sensor.h"

   // Система распознавания
class TRecognitionSystem
{
   protected:
      TRecognitionNet* net;
      TSensor          sensor;

      void DestroyNet();

   public:
      TRecognitionSystem();
      ~TRecognitionSystem();

      char* GetName()
      { 
         if( net )
            return net->GetName();
         else
            return NULL;
      };

      TForces GetDeltaForces()
      { return sensor.GetDeltaForces(robot.GetRealTouchType()); }

      int CreateNewSystem( unsigned numbMiddle );
      int LoadFromFile( const char *fileName );
      int SaveToFile( const char *fileName );

      void Learn( TSituation situation );
      TSituation Recognize();
      int  IsConverged()
      { return net->IsConverged(); };

      int AutoLearn();
};

extern TRecognitionSystem recognitionSystem;

#endif
