// \****************************************************** // Datei EasyScheduler.h // Autor: Peter Unruh, basierend auf der PG-Version // \****************************************************** #ifndef SA_ParScheduler_H #define SA_ParScheduler_H //#include "iostream.h" #include "iostream" #include #include "constants.h" #include "SA_Scheduler.h" // \****************************************************** // Klasse EasyScheduler : // cooling schedule, Statistiken // \****************************************************** class SA_ParScheduler : public SA_Scheduler { private: SA_Output saparoutput; // Anzahl der versuchten und akzeptierten Uebergaenge sowie Mittelwert der Endloesung: // used for communitaction in cluster via MPI struct { float tot_iter,tot_acc,StartE,E; } in,out; // float CoolingRatio, // T(n+1) = T(0)*exp(CoolingRatio,n) // // MinAccRatio, // if >=0 frozen_count will be incremented bei AcceptRatio < MinAccRatio // subchainfactor; // the multiplier for the subchainlength // // bool StrictShort; // should the length of subchain be shortened strictly (/ncluster) // // or not (/sqr(ncluster) ). // // unsigned long // MaxChainLength, // Maximale laenge der Teilkette // MaxChainLength0,// - // - bei Anzahl der Cluster == 1 // frozen_count, // frozen_limit; // // float * LastSolutions, // Ein Puffer fuer Frozen-Bestimmung // FrozenSum, // Summe der letzten Loesungen // Mean; // Mittelwert der letzten Loesungen // int pos; // erste freie Position im Puffer // int full; // TRUE <=> Puffer voll // void Enqueue(); // protected: void SetScheduler(SA_Scheduler *); public: SA_ParScheduler(); ~SA_ParScheduler(); SA_Output *GetSchedulerOutput(); // int ReadConfig(std::istream &); virtual void CreateLog(std::ostream & output, MPI_Comm comm); // virtual int Equilibrium()=0; virtual void UpdateTemperature()=0; virtual int Frozen()=0; // // void SetCoolingRatio(float a) {CoolingRatio = a;} // void SetFrozenLimit(unsigned long lim); // //virtual void ShowConfig(std::ostream & ); // // Hier :: falls nicht in .cfg-Datei gesetzt, subchainlengt und initialtemperature ermittel double AartsWarmingUp(SA_Problem & P, SA_Solution &, SA_Solution &,long, MPI_Comm); virtual void WarmingUp(SA_Problem & P, SA_Solution &s, SA_Solution &b,MPI_Comm); }; #endif