universalnetcontroller.h

Go to the documentation of this file.
00001 #ifndef __UNIVERSALNETCONTROLLER_H 00002 #define __UNIVERSALNETCONTROLLER_H 00003 00004 #include <string.h> 00005 #include <stdlib.h> 00006 00007 #include "abstractcontroller.h" 00008 00009 /** 00010 * Abstract class (interface) for robot controller that use the "universalnet" 00011 * 00012 * Implements standart parameters: eps, rho, lamda, epsmodel 00013 */ 00014 class UniversalNetController : public AbstractController { 00015 public: 00016 UniversalNetController(){ 00017 eps=0.1; 00018 rho=0.1; 00019 lambda=0.1; 00020 epsmodel=0.1; 00021 n = 100; 00022 } 00023 00024 virtual paramval getParam(paramkey key){ 00025 if(strcmp(key, "eps")==0) return eps; 00026 else if(strcmp(key, "rho")==0) return rho; 00027 else if(strcmp(key, "lambda")==0) return lambda; 00028 else if(strcmp(key, "epsmodel")==0) return epsmodel; 00029 else if(strcmp(key, "n")==0) return n; 00030 else return AbstractController::getParam(key); 00031 } 00032 00033 virtual void setParam(paramkey key, paramval val){ 00034 if(strcmp(key, "eps")==0) eps=val; 00035 else if(strcmp(key, "rho")==0) rho=val; 00036 else if(strcmp(key, "lambda")==0) lambda=val; 00037 else if(strcmp(key, "epsmodel")==0) epsmodel=val; 00038 else if(strcmp(key, "n")==0) n=val; 00039 else AbstractController::getParam(key); 00040 } 00041 00042 virtual int getParamList(paramkey*& keylist,paramval*& vallist){ 00043 keylist=(paramkey*)malloc(sizeof(paramkey)*5); 00044 vallist=(paramval*)malloc(sizeof(paramval)*5); 00045 keylist[0]="eps"; 00046 keylist[1]="rho"; 00047 keylist[2]="lambda"; 00048 keylist[3]="epsmodel"; 00049 keylist[4]="n"; 00050 vallist[0]=eps; 00051 vallist[1]=rho; 00052 vallist[2]=lambda; 00053 vallist[3]=epsmodel; 00054 vallist[4]=n; 00055 return 4; 00056 } 00057 00058 protected: 00059 paramval eps; 00060 paramval rho; 00061 paramval lambda; 00062 paramval epsmodel; 00063 paramval n; 00064 }; 00065 00066 #endif

Generated on Tue Jan 16 02:14:38 2007 for Robotsystem of the Robot Group Leipzig by doxygen 1.3.8