Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RandomVariables #31

Open
etheban opened this issue May 21, 2020 · 2 comments
Open

RandomVariables #31

etheban opened this issue May 21, 2020 · 2 comments
Labels
development Development version enhancement New feature or request

Comments

@etheban
Copy link
Contributor

etheban commented May 21, 2020

what is the benefit of instantiating an object using a method and not the constructor?

instead of
P = LognormalRandomVariable.fromMeanAndStd('mean', 5000, 'std', 400, 'Description', 'Load');

we should have
P = LognormalRandomVariable('mean', 5000, 'std', 400, 'Description', 'Load');

@etheban etheban added development Development version enhancement New feature or request labels May 21, 2020
@FriesischScott
Copy link
Member

The reason we did this was, that checking weather to construct from the rv parameters or mean and Std is quite complex and Matlab does not support multiple constructors.

For example: What happens if you pass both the parameters and mean and std? What if you only pass one of the parameters and the mean? There are plenty of different cases resulting in a complex if, then, else structure.

I would be open for a simple way of doing this but in my opinion matlab does not offer a suitable solution for this. One of the downside of the way we abuse name/value pairs.

@etheban
Copy link
Contributor Author

etheban commented May 21, 2020

I care about the interface and usability that somehow we are loosing because we pretend to use object oriented programming for computer scientists.

I prefer to give the maximum flexibility to the end-users not to the developers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Development version enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants