Inheritance diagram for ObjCryst::MonteCarloObj:
Public Methods | |
MonteCarloObj (const string name="") | |
Constructor. | |
MonteCarloObj (const bool internalUseOnly) | |
Constructor. | |
virtual | ~MonteCarloObj () |
Destructor. | |
void | SetAlgorithmSimulAnnealing (const AnnealingSchedule scheduleTemp, const REAL tMax, const REAL tMin, const AnnealingSchedule scheduleMutation=ANNEALING_CONSTANT, const REAL mutMax=16., const REAL mutMin=.125, const long nbTrialRetry=0, const REAL minCostRetry=0., const long maxNbTrialSinceBest=0) |
Set the refinement method to simulated Annealing. Note that Parellel Tempering is more efficient to get out of local minima, so you sould rather use that method. | |
void | SetAlgorithmParallTempering (const AnnealingSchedule scheduleTemp, const REAL tMax, const REAL tMin, const AnnealingSchedule scheduleMutation=ANNEALING_CONSTANT, const REAL mutMax=16., const REAL mutMin=.125) |
Set the refinement method to Parallel Tempering. | |
virtual void | Optimize (long &nbSteps, const bool silent=false, const REAL finalcost=0, const REAL maxTime=-1) |
Launch optimization for N steps. | |
virtual void | XMLOutput (ostream &os, int indent=0) const |
Output a description of the object in XML format to a stream. | |
virtual void | XMLInput (istream &is, const XMLCrystTag &tag) |
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. | |
virtual const string | GetClassName () const |
Get the name for this class type. | |
Protected Methods | |
virtual void | NewConfiguration (const RefParType *type=gpRefParTypeObjCryst) |
Make a random change in the configuration. | |
virtual void | InitOptions () |
Initialization of options. | |
Protected Attributes | |
RefObjOpt | mGlobalOptimType |
Method used for the global optimization. | |
REAL | mCurrentCost |
Current value of the cost function. | |
RefObjOpt | mSaveDetailledHistory |
Option to save the evolution of all optimized parameters (for testing only ! this is very slow...). | |
string | mHistorySaveFileName |
Save the evolution of refined parameters after optimization ? | |
long | mLastParSavedSetIndex |
Index of the 'last' parameter set. | |
REAL | mTemperature |
Current temperature for annealing. | |
REAL | mTemperatureMax |
Beginning temperature for annealing. | |
REAL | mTemperatureMin |
Lower temperature. | |
RefObjOpt | mAnnealingScheduleTemp |
Schedule for the annealing. | |
REAL | mMutationAmplitude |
Mutation amplitude. | |
REAL | mMutationAmplitudeMax |
Mutation amplitude at the beginning of the optimization. | |
REAL | mMutationAmplitudeMin |
Mutation amplitude at the end of the optimization. | |
RefObjOpt | mAnnealingScheduleMutation |
Schedule for the annealing. | |
long | mNbTrialRetry |
Number of trials before testing if we are below the given minimum cost. | |
REAL | mMinCostRetry |
Cost to reach unless an automatic randomization and retry is done. | |
long | mMaxNbTrialSinceBest |
If more than mMaxNbTrialSinceBest trials have been made since the best configuration has been found, then revert to the best configuration. |
The algorithm is quite simple, whith two type of optimizations, either simulated Annealing or Parallel Tempering, the latter being recommanded for most real-world optimizations.
|
Constructor. Using internalUseOnly=true will avoid registering the the object to any registry, and thus (for example) no display will be created, nor will this object be automatically be saved. |
|
Make a random change in the configuration.
For internal use only. This just generates a new configuration with random changes (according to current parameters). The old config is stored in mRefParList as the last config (index mLastParSavedSetIndex). The new one is not tested in this function vs temperature: this should be done in the OptimizationObj::Optimize() function, which also chooses whether to revert to the previous configuration. Random moves are made by the objects and not by this function, because the new configuration can be specific (like, for example, permutations between some of the parameters (atoms)).
|
|
Launch optimization for N steps.
Implements ObjCryst::OptimizationObj. |
|
Set the refinement method to Parallel Tempering. The refinement begins at max and finishes at min temperature.
|
|
Set the refinement method to simulated Annealing. Note that Parellel Tempering is more efficient to get out of local minima, so you sould rather use that method. The refinement begins at max and finishes at min temperature.
|
|
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). Implements ObjCryst::OptimizationObj. |
|
Method used for the global optimization. Should be removed when we switch to using several classes for different algorithms. |
|
If more than mMaxNbTrialSinceBest trials have been made since the best configuration has been found, then revert to the best configuration. If <=0, then this is ignored. This must be large enough to have an ergodic algorithm (more strictly, should not be used ?) |
|
Mutation amplitude. From .25 to 64. Random moves will have a maximum amplitude equal to this amplitude multiplied by the Global optimization step defined for each RefinablePar. Large amplitude should be used at the beginning of the refinement (high temeratures). |
|
Number of trials before testing if we are below the given minimum cost. If <=0, this will be ignored. |