10 #ifndef ROL_RISKMEASUREFACTORY_HPP
11 #define ROL_RISKMEASUREFACTORY_HPP
13 #include "ROL_ParameterList.hpp"
79 std::string retString;
82 retString =
"CVaR";
break;
84 retString =
"Moreau-Yosida CVaR";
break;
86 retString =
"Generalized Moreau-Yosida CVaR";
break;
88 retString =
"Mixed CVaR";
break;
90 retString =
"Spectral Risk";
break;
92 retString =
"Second Order CVaR";
break;
94 retString =
"Chebyshev Spectral Risk";
break;
96 retString =
"Quantile Radius";
break;
98 retString =
"HMCR";
break;
100 retString =
"Entropic Risk";
break;
102 retString =
"Coherent Entropic Risk";
break;
104 retString =
"Mean Plus Semi-Deviation";
break;
106 retString =
"Mean Plus Semi-Deviation From Target";
break;
108 retString =
"Mean Plus Deviation From Target";
break;
110 retString =
"Mean Plus Deviation";
break;
112 retString =
"Mean Plus Variance From Target";
break;
114 retString =
"Mean Plus Variance";
break;
116 retString =
"Truncated Mean";
break;
118 retString =
"Log Quantile";
break;
120 retString =
"Smoothed Worst Case";
break;
122 retString =
"Log Exponential";
break;
124 retString =
"Safety Margin";
break;
126 retString =
"Chi-Squared Divergence";
break;
128 retString =
"KL Divergence";
break;
130 retString =
"Last Type (Dummy)";
break;
132 retString =
"INVALID ERiskMeasure";
break;
196 std::string risk = parlist.sublist(
"SOL").sublist(
"Risk Measure").get(
"Name",
"CVaR");
200 return makePtr<CVaR<Real>>(parlist);
202 return makePtr<ExpectationQuadRisk<Real>>(makePtr<MoreauYosidaCVaR<Real>>(parlist));
204 return makePtr<ExpectationQuadRisk<Real>>(makePtr<GenMoreauYosidaCVaR<Real>>(parlist));
206 return makePtr<MixedCVaR<Real>>(parlist);
208 return makePtr<SpectralRisk<Real>>(parlist);
210 return makePtr<SecondOrderCVaR<Real>>(parlist);
212 return makePtr<ChebyshevSpectral<Real>>(parlist);
214 return makePtr<QuantileRadius<Real>>(parlist);
216 return makePtr<HMCR<Real>>(parlist);
218 return makePtr<EntropicRisk<Real>>(parlist);
220 return makePtr<CoherentEntropicRisk<Real>>();
222 return makePtr<MeanSemiDeviation<Real>>(parlist);
224 return makePtr<MeanSemiDeviationFromTarget<Real>>(parlist);
226 return makePtr<MeanDeviationFromTarget<Real>>(parlist);
228 return makePtr<MeanDeviation<Real>>(parlist);
230 return makePtr<MeanVarianceFromTarget<Real>>(parlist);
232 return makePtr<MeanVariance<Real>>(parlist);
234 return makePtr<ExpectationQuadRisk<Real>>(makePtr<TruncatedMeanQuadrangle<Real>>(parlist));
236 return makePtr<ExpectationQuadRisk<Real>>(makePtr<LogQuantileQuadrangle<Real>>(parlist));
238 return makePtr<ExpectationQuadRisk<Real>>(makePtr<SmoothedWorstCaseQuadrangle<Real>>(parlist));
240 return makePtr<ExpectationQuadRisk<Real>>(makePtr<LogExponentialQuadrangle<Real>>(parlist));
242 return makePtr<ExpectationQuadRisk<Real>>(makePtr<MeanVarianceQuadrangle<Real>>(parlist));
244 return makePtr<Chi2Divergence<Real>>(parlist);
246 return makePtr<KLDivergence<Real>>(parlist);
248 ROL_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
249 "Invalid risk measure type " << risk <<
"!");
EPolyProjAlgo & operator++(EPolyProjAlgo &type)
Contains definitions of custom data types in ROL.
std::string removeStringFormat(std::string s)
ERiskMeasure StringToERiskMeasure(std::string s)
int isValidRiskMeasure(ERiskMeasure ed)
EPolyProjAlgo & operator--(EPolyProjAlgo &type)
std::string ERiskMeasureToString(ERiskMeasure ed)
Ptr< RandVarFunctional< Real > > RiskMeasureFactory(ParameterList &parlist)