// $Header: /cvs/gled-1.2/Numerica/Glasses/WarmAmoeba.h,v 1.2 2003/09/11 09:23:49 matevz Exp $
#ifndef Numerica_WarmAmoeba_H
#define Numerica_WarmAmoeba_H
#include <Glasses/Eventor.h>
#include <Stones/ZVector.h>
#include <TRandom.h>
class WarmAmoebaMaster {
public:
virtual ~WarmAmoebaMaster() {}
virtual Real_t Foon(const ZVector& x) = 0;
virtual ZVector* InitialState(TRandom& rnd) = 0; // Amoeba deletes it
virtual ZVector* InitialPerturbations(TRandom& rnd) = 0; // Amoeba deletes it
virtual void SetState(const ZVector& x) = 0;
virtual ZMIR* S_SetState(const ZVector& x) = 0;
ClassDef(WarmAmoebaMaster,1)
};
class WarmAmoeba : public Eventor {
private:
WarmAmoebaMaster* hTrueMaster; //!
ZVector* m_P; //! center + simplex vertices
ZVector m_Y; //! values at center + simplex vertices
ZVector m_Psum; //!
ZVector m_PBest; //! Best parameters
Real_t m_y_best; //!
Int_t m_iter; //!
UInt_t m_n; //!
Real_t m_T; //!
Real_t m_T0; //!
void _init();
void _calc_psum();
void _export_algo_values(Operator::Arg* op_arg, bool bestp=false);
Real_t& P(UCIndex_t m, UCIndex_t n) { return m_P[m](n); }
protected:
ZGlass* mWA_Master; // X{GS} L{}
TRandom mRanGen;
// Low level store
// Algorithm parameters, exported part
UInt_t mN; // dimensions X{GS} 7 ValOut(-join=>1)
UInt_t mSeed; // X{GS} 7 Value(-range=>[0,MAX_ID,1])
Real_t mFTol; // Fractional tolerance X{GS} 7 Value(-range=>[0,1],join=>1)
// Set T to T_0 times TFactor:
Real_t mTFactor; // X{GS} 7 Value(-range=>[0,100], join=>1)
// T_n = T_0(1 - n/NumSteps)^alpha
Real_t mAlpha; // X{GS} 7 Value(-range=>[1e-2,100,1,100])
UInt_t mMovesPerT; // X{GS} 7 Value(-range=>[0,1e6,1],-width=>6,-join=>1)
UInt_t mNumSteps; // X{GS} 7 Value(-range=>[0,1e6,1],-width=>6)
Real_t mT0; // X{GS} 7 ValOut(-width=>8, -join=>1)
Real_t mT; // X{GS} 7 ValOut(-width=>8, -range=>[0,100])
Real_t mYBest; // Best value reached X{GS} 7 ValOut(-join=>1)
Real_t mYLast; // Value after last move X{GS} 7 ValOut()
// protected methods
void InitZStuff(); // Should be called from derived class::PreDance()
Real_t Ooze(UCIndex_t ihi, Real_t& yhi, Real_t fac);
void WAMove();
public:
WarmAmoeba(const Text_t* n="WarmAmoeba", const Text_t* t=0);
WarmAmoeba(ZGlass* m, const Text_t* n="WarmAmoeba", const Text_t* t=0);
virtual ~WarmAmoeba();
virtual Operator::Arg* PreDance(Operator::Arg* op_arg=0);
virtual void PostDance(Operator::Arg* op_arg);
virtual void PostBeat(Operator::Arg* op_arg) throw(Operator::Exception);
virtual void Operate(Operator::Arg* op_arg) throw(Operator::Exception);
#include "WarmAmoeba.h7"
ClassDef(WarmAmoeba, 1)
}; // endclass WarmAmoeba
GlassIODef(WarmAmoeba);
#endif
ROOT page - Home page - Class index - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.