@@ -299,6 +299,59 @@ long& OptimizationObj::NbTrialPerRun() {return mNbTrialPerRun;}
299299
300300const long & OptimizationObj::NbTrialPerRun () const {return mNbTrialPerRun ;}
301301
302+ unsigned int OptimizationObj::GetNbOption ()const
303+ {
304+ return mOptionRegistry .GetNb ();
305+ }
306+
307+ ObjRegistry<RefObjOpt>& OptimizationObj::GetOptionList ()
308+ {
309+ return mOptionRegistry ;
310+ }
311+
312+ RefObjOpt& OptimizationObj::GetOption (const unsigned int i)
313+ {
314+ VFN_DEBUG_MESSAGE (" RefinableObj::GetOption()" <<i,3 )
315+ // :TODO: Check
316+ return mOptionRegistry .GetObj (i);
317+ }
318+
319+ RefObjOpt& OptimizationObj::GetOption (const string & name)
320+ {
321+ VFN_DEBUG_MESSAGE (" OptimizationObj::GetOption()" <<name,3 )
322+ const long i=mOptionRegistry .Find (name);
323+ if (i<0 )
324+ {
325+ this ->Print ();
326+ throw ObjCrystException (" OptimizationObj::GetOption(): cannot find option: " +name+" in object:" +this ->GetName ());
327+ }
328+ return mOptionRegistry .GetObj (i);
329+ }
330+
331+ const RefObjOpt& OptimizationObj::GetOption (const unsigned int i)const
332+ {
333+ VFN_DEBUG_MESSAGE (" RefinableObj::GetOption()" <<i,3 )
334+ // :TODO: Check
335+ return mOptionRegistry .GetObj (i);
336+ }
337+
338+ const RefObjOpt& OptimizationObj::GetOption (const string & name)const
339+ {
340+ VFN_DEBUG_MESSAGE (" OptimizationObj::GetOption()" <<name,3 )
341+ const long i=mOptionRegistry .Find (name);
342+ if (i<0 )
343+ {
344+ this ->Print ();
345+ throw ObjCrystException (" OptimizationObj::GetOption(): cannot find option: " +name+" in object:" +this ->GetName ());
346+ }
347+ return mOptionRegistry .GetObj (i);
348+ }
349+
350+ const ObjRegistry<RefinableObj>& OptimizationObj::GetRefinedObjList () const
351+ {
352+ return mRefinedObjList ;
353+ }
354+
302355void OptimizationObj::PrepareRefParList ()
303356{
304357 VFN_DEBUG_ENTRY (" OptimizationObj::PrepareRefParList()" ,6 )
@@ -375,6 +428,7 @@ void OptimizationObj::InitOptions()
375428 needInitNames=false ;// Only once for the class
376429 }
377430 mXMLAutoSave .Init (6 ,&xmlAutoSaveName,xmlAutoSaveChoices);
431+ this ->AddOption (&mXMLAutoSave );
378432 VFN_DEBUG_MESSAGE (" OptimizationObj::InitOptions():End" ,5 )
379433}
380434
@@ -404,6 +458,13 @@ void OptimizationObj::BuildRecursiveRefObjList()
404458 }
405459}
406460
461+ void OptimizationObj::AddOption (RefObjOpt *opt)
462+ {
463+ VFN_DEBUG_ENTRY (" OptimizationObj::AddOption()" ,5 )
464+ mOptionRegistry .Register (*opt);
465+ VFN_DEBUG_EXIT (" OptimizationObj::AddOption()" ,5 )
466+ }
467+
407468// #################################################################################
408469//
409470// MonteCarloObj
@@ -2087,6 +2148,11 @@ void MonteCarloObj::InitOptions()
20872148 mAnnealingScheduleMutation .Init (6 ,&AnnealingScheduleMutationName,AnnealingScheduleChoices);
20882149 mSaveTrackedData .Init (2 ,&saveTrackedDataName,saveTrackedDataChoices);
20892150 mAutoLSQ .Init (3 ,&runAutoLSQName,runAutoLSQChoices);
2151+ this ->AddOption (&mGlobalOptimType );
2152+ this ->AddOption (&mAnnealingScheduleTemp );
2153+ this ->AddOption (&mAnnealingScheduleMutation );
2154+ this ->AddOption (&mSaveTrackedData );
2155+ this ->AddOption (&mAutoLSQ );
20902156 VFN_DEBUG_MESSAGE (" MonteCarloObj::InitOptions():End" ,5 )
20912157}
20922158
0 commit comments