/* 
 * Thomas Pantzer: t_woeq.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 T_WOEQ_H
#define T_WOEQ_H


#include "t_deq.h"
#include "trigonom.h"
#include "t_floating_avg.h"
#include "t_special_counter.h"


class t_woeq {
public:
	t_deq *first,*last_BF,*BF,*SE,*BP;
	t_special_counter delay,no_update;

	int count,shift;

        // parameters, change with slider 
        double _epsilon,_Info_TH,_NY,_DRate;

	// extern referenced
        double phi,info;

	double avg_fit,err_sum;
	double pMin;
	double gamma,drift,kappa,v_gamma;

	char ignore_gamma, gamma_correct;


	void Add(t_deq *p);
	void Del(t_deq *p);

        void Init(void);
	void Done(void);

	void ProbUpdate(t_vector &Df, double da_avg, double ds_avg, char f2);
	char GammaUpdate(t_vector &Df, double da_avg, double ds_avg);

// for advanced error functions
	void NeighbourUpdate(void);
	void Use_oldErrorFunc(void);
	
	double Angle_Drift(char reset);
	void Show(t_vertex_2i *vcenter, double size_);
//	void RotatePhi(double &dx, double &dy, double &X, double &Y);
	char *write_log(double da_avg, double ds_avg);

private:
//	t_vertex_2d gamma_pre_pos,prob_pre_pos;
//	int fd_gamma_log;
	double min_info,gamma_threshold;

	t_deq *GetBestFit(void);
        t_deq *GetSmallestError(void);
	t_deq *GetBestProbability(void);

	double ErrSum(t_vector &Df, double ds, double da_avg, double ds_avg);
	double AvgFit(void);

	double Prob_Info(void);
	double Error_Info(void);

	void Norm_Probability(void);

	void Statistics(void);

};



#endif












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