Inheritance diagram for ObjCryst::OptimizationObj:
Public Methods | |
OptimizationObj (const string name="") | |
Constructor. | |
virtual | ~OptimizationObj () |
Destructor. | |
virtual void | RandomizeStartingConfig () |
Randomize starting configuration. Only affects limited and periodic parameters. | |
virtual void | Optimize (long &nbSteps, const bool silent=false, const REAL finalcost=0, const REAL maxTime=-1)=0 |
Launch optimization for N steps. | |
void | FixAllPar () |
Fix all parameters. | |
void | SetParIsFixed (const string &parName, const bool fix) |
Fix one parameter. | |
void | SetParIsFixed (const RefParType *type, const bool fix) |
Fix one family of parameters. | |
void | UnFixAllPar () |
UnFix All parameters. | |
void | SetParIsUsed (const string &parName, const bool use) |
Set a parameter to be used. | |
void | SetParIsUsed (const RefParType *type, const bool use) |
Set a family of parameters to be used. | |
void | SetLimitsRelative (const string &parName, const REAL min, const REAL max) |
Change the relative limits for a parameter from its name. | |
void | SetLimitsRelative (const RefParType *type, const REAL min, const REAL max) |
Change the relative limits for a family of parameter. | |
void | SetLimitsAbsolute (const string &parName, const REAL min, const REAL max) |
Change the absolute limits for a parameter from its name. | |
void | SetLimitsAbsolute (const RefParType *type, const REAL min, const REAL max) |
Change the absolute limits for a family of parameter. | |
REAL | GetLogLikelihood () |
The optimized (minimized, actually) function. | |
void | StopAfterCycle () |
Stop after the current cycle. USed for interactive refinement. | |
virtual void | DisplayReport () |
Show report to the user during refinement. Used for GUI update. | |
void | AddRefinableObj (RefinableObj &) |
Add a refined object. All sub-objects are also added. | |
virtual void | XMLOutput (ostream &os, int indent=0) const=0 |
Output a description of the object in XML format to a stream. | |
virtual void | XMLInput (istream &is, const XMLCrystTag &tag)=0 |
Input in XML format from a stream, restoring the set of refined objects and the associated cost functions. Note that the corresponding objects must have been loaded in memory before, else shit happens. | |
const string & | GetName () const |
Get the name for this object. | |
void | SetName (const string &) |
Set the name for this object. | |
virtual const string | GetClassName () const |
Get the name for this class type. | |
virtual void | Print () const |
Print some information about this object. | |
void | RestoreBestConfiguration () |
Restore the Best configuration. | |
bool | IsOptimizing () const |
Are we busy optimizing ? | |
void | TagNewBestConfig () const |
During a global optimization, tell all objects that the current config is the latest "best" config. | |
REAL | GetLastOptimElapsedTime () const |
Get the elapsed time (in seconds) during the last optimization. | |
Protected Methods | |
void | PrepareRefParList () |
Prepare mRefParList for the refinement. | |
void | InitRandomSeedFromTime () const |
Initialize random seed from time. | |
virtual void | InitOptions () |
Initialization of options. | |
virtual void | UpdateDisplay () |
Update Display (if any display is available), when a new 'relevant' configuration is reached. | |
void | BuildRecursiveRefObjList () |
(Re)build OptimizationObj::mRecursiveRefinedObjList, if an object has been added or modified. | |
Protected Attributes | |
RefinableObj | mRefParList |
The refinable par list used during refinement. | |
string | mName |
Name of the GlobalOptimization object. | |
string | mSaveFileName |
File name where refinement info is saved (NOT USED so far...). | |
long | mNbTrial |
Number of trials so far. | |
REAL | mBestCost |
Best value of the cost function so far. | |
long | mBestParSavedSetIndex |
Index of the 'best' saved parameter set. | |
unsigned long | mContext |
The current 'context', in the case the optimization is run in different parallel contexts. | |
map< unsigned long, map< const RefinableObj *, LogLikelihoodStats > > | mvContextObjStats |
Statistics for each context. | |
map< const RefinableObj *, DynamicObjWeight > | mvObjWeight |
Weights for each objects in each context. | |
bool | mIsOptimizing |
True if a refinement is being done. For multi-threaded environment. | |
bool | mStopAfterCycle |
If true, then stop at the end of the cycle. Used in multi-threaded environment. | |
ObjRegistry< RefinableObj > | mRefinedObjList |
The refined objects. | |
ObjRegistry< RefinableObj > | mRecursiveRefinedObjList |
The refined objects, recursively including all sub-objects. | |
RefObjOpt | mXMLAutoSave |
Periodic save of complete environment as an xml file. | |
REAL | mLastOptimTime |
The time elapsed after the last optimization, in seconds. |
This is an abstract base class, derived for Monte-Cralo type algorithms (Simulated Annealing & Parallel Tempering), and hopefully soon for Genetic Algorithms.
|
(Re)build OptimizationObj::mRecursiveRefinedObjList, if an object has been added or modified. If no object has been added and no sub-object has been added/removed, then nothing is done. |
|
The optimized (minimized, actually) function. This function is the weighted sum of the chosen Cost Functions for the refined objects. |
|
Initialize random seed from time.
For internal use only.
|
|
Launch optimization for N steps.
Implemented in ObjCryst::MonteCarloObj. |
|
Prepare mRefParList for the refinement.
For internal use only.
|
|
Update Display (if any display is available), when a new 'relevant' configuration is reached. This calls all RefinableObj::UpdateDisplay() |
|
Output a description of the object in XML format to a stream. This saves the list of refined object and the cost functions, as well as options for the refinement. The refined objects are not saved, so this must be done somewhere else (they must be reloaded before this object). Implemented in ObjCryst::MonteCarloObj. |
|
The refined objects, recursively including all sub-objects. This is mutable, since it is a function of mRefinedObjList only. |
|
The refinable par list used during refinement. Only a condensed version of all objects. This is useful to keep an history of modifications, and to restore previous values.
|