12345678910111213141516171819202122232425262728293031323334 |
- function [x0,ul,ub]=generateInitialValues(valueGeneratorSettings)
- %initial settings
- nvar=size(valueGeneratorSettings,2);
-
- x0=zeros(1,nvar);
- ul=zeros(1,nvar);
- ub=zeros(1,nvar);
- for ivar=1:nvar
- t=valueGeneratorSettings(ivar).type;
- p=valueGeneratorSettings(ivar).parameters;
- u=valueGeneratorSettings(ivar).u;
- if strcmp(t,'gaus')
- x0(ivar)=normrnd(p(1),p(2));
- end
- if strcmp(t,'loggaus')
- x0(ivar)=power(10,normrnd(p(1),p(2)));
- end
- if strcmp(t,'poisson')
- x0(ivar)=poissrnd(p(1));
- end
- if strcmp(t,'flat')
- x0(ivar)=p(1)+(p(2)-p(1))*rand;
- end
- if strcmp(t,'const')
- x0(ivar)=p(1);
- end
-
-
- ul(ivar)=u(1);
- ub(ivar)=u(2);
-
- end
-
- end
|