mirror of
http://43.156.76.180:8026/YuuMJ/EukPhylo.git
synced 2025-12-28 04:20:25 +08:00
52 lines
912 B
C++
52 lines
912 B
C++
#ifndef __WeightUpdateStrategy_j
|
|
#define __WeightUpdateStrategy_j
|
|
|
|
#include <vector>
|
|
using namespace std;
|
|
|
|
class tWeightUpdate;
|
|
|
|
typedef vector<double> const& Weights_cl;
|
|
|
|
class WeightUpdateStrategy_cl {
|
|
public:
|
|
enum WeightUpdateType { None, Random, Adversarial, Prior };
|
|
|
|
WeightUpdateStrategy_cl( WeightUpdateType T,
|
|
double StartT,
|
|
double EndT,
|
|
double CoolFactor,
|
|
bool UsePartialSearch )
|
|
{
|
|
iStart = StartT;
|
|
iEnd = EndT;
|
|
iCool = CoolFactor;
|
|
iType = T;
|
|
iPartial = UsePartialSearch;
|
|
}
|
|
|
|
tWeightUpdate* NewWeights( Weights_cl OrigWeights ) const;
|
|
|
|
double NewTemp( double OldTemp ) const
|
|
{
|
|
double T = OldTemp*iCool;
|
|
if( T <= iEnd )
|
|
T = 0.0;
|
|
return T;
|
|
}
|
|
|
|
bool UsePartialSearch() const
|
|
{
|
|
return iPartial;
|
|
}
|
|
|
|
private:
|
|
double iStart;
|
|
double iEnd;
|
|
double iCool;
|
|
bool iPartial;
|
|
WeightUpdateType iType;
|
|
};
|
|
|
|
#endif
|