#ifndef Init_per_para_h_DEFINED
#define Init_per_para_h_DEFINED

#include "../const.h"
#include <stdio.h>

#ifdef AIBO_YES
#include <OPENR/OSyslog.h>
#endif

struct Init_per_para {
       

       // Interaction parameters
       int per_random;
       char per_file[MAX_LENGTH_FILE];
       int aibo_imitating;
       int aibo_evolving;
       double joyful_points, sad_points, surprised_points,
              angry_points, fearful_points, disgusted_points;
       double update_thres;
       double update_value;
       int debug_per;



       Init_per_para() {

           char name[MAX_LENGTH_FILE];
           FILE* f;

           sprintf(name, "%s%s", INITPER_FOLDER, INITPER_FILE);
           f = fopen(name, "r+");
           if (f == 0) {
               PRN(("can't open %s\n", name));
           }
           else {
               fscanf(f, "######INTERACTION_PARAMETERS\n");
               fscanf(f, "PersonalityMode::PER_RANDOM %d\n", &per_random);
               fscanf(f, "Personality::PER_FILE %s\n", per_file);
               fscanf(f, "Personality::AIBO_EVOLVING %d\n", &aibo_evolving);
               fscanf(f, "Personality::AIBO_IMITATING %d\n", &aibo_imitating);
               fscanf(f, "InteractionPoints::JOYFUL_POINTS %lf\n", &joyful_points);
               fscanf(f, "InteractionPoints::SAD_POINTS %lf\n", &sad_points);
               fscanf(f, "InteractionPoints::SURPRISED_POINTS %lf\n", &surprised_points);
               fscanf(f, "InteractionPoints::ANGRY_POINTS %lf\n", &angry_points);
               fscanf(f, "InteractionPoints::FEARFUL_POINTS %lf\n", &fearful_points);
               fscanf(f, "InteractionPoints::DISGUSTED_POINTS %lf\n", &disgusted_points);
               fscanf(f, "InteractionThreshold::UPDATE_THRES %lf\n", &update_thres);
               fscanf(f, "InteractionUpdate::UPDATE_VALUE %lf\n", &update_value);
               fscanf(f, "DebugPer %d\n", &debug_per);
    
    
               fclose(f);
           }

       }



};


#endif // Init_per_para_h_DEFINED
