/* 
 * Thomas Pantzer: Predict_demo.h, v0.4.7  8.6.99 16:32 
 * 
 * 
 * Copyright 1999 by Thomas Pantzer
 * 
 * Permission to use, copy, modify, and distribute this software for noncommercial 
 * use and without fee is hereby granted, provided that the above copyright notice 
 * appear in all copies and that both that copyright notice and this permission 
 * notice appear in supporting documentation, and that the name of the Author not be 
 * used in advertising or publicity pertaining to distribution of the software 
 * without specific, written prior permission. The Author makes no representations about
 * the suitability of this software for any purpose.  It is provided "as is" 
 * without expressed or implied warranty. 
 * 
 * 
 * pantec@isys2.informatik.uni-leipzig.de   (Thomas Pantzer) 
 * 
 */



#ifndef _predict_DEMO_H
#define _predict_DEMO_H

#include "t_runtime_obj.h"
#include "t_polynom.h"
#include "t_floating_avg.h"



#define n_sensors	18	// anzahl der im algorithmus eingebundenen 
				// pseudosensoren

#define t_depth		24	// max. zeitliche Tiefe bei gestackten Werten, 
				// (Länge des Schieberegisters)


class t_predict_demo : public t_runtime_object {
public:
	virtual void Init(RobotContext *robot);
	void Done(void);

	virtual char start_module(void);
	virtual char stop_module(void);
	virtual char calculate_module(char allow_learn, char any_new);
	virtual char control_module(void);
	virtual void make_logdata(void);
	virtual void make_logstring(void);

// graphic window method
//	virtual void Show(void);

// extra parameter handling
	virtual void Reset(void);
	virtual void Load(char *to_parse);
	virtual void Save(int fd);

//xforms callbacks
	virtual void button_cb(FL_OBJECT *ob,long data);
	virtual void slider_cb(FL_OBJECT *ob,long data);

private:

	t_Polynom	*Poly,*ClearP;
//	double 		tSensor[8][18];

	t_window_stack	sinus,cosin,g_radius;
//	t_window_stack	Sin2,Cos2;
	t_window_stack	Sensor[12],Motor[2];
	

	long 	step;


	int good,bad;
//	char 	online, uselight, wakeup;
//	double  period, epsilon,b[10];
//	t_average	sa,sb,Bias;

	t_average Va,Sl,alpha_a,Dva,ES,EM;

	t_average q_sin[10],q_cos[10],Qv,qx[10],dxka[10],dxpa[10],RNS;

	double EL,ER,a[10],dxk[10],dxp[10],alpha,D[11],V,U;
};


#ifdef _predict_DEMO_G
#define m_extern
#else 
#define m_extern extern
#endif

m_extern t_predict_demo Predict_Demo;

#undef m_extern


#endif







/**/
/**/
/**/
/**/
/**/
/**/
/**/
/**/
/*****  End Of File  ****************************/
