burlap icon indicating copy to clipboard operation
burlap copied to clipboard

DiscretizingMaskedHashableStateFactory is missing methods for handling config

Open addy90 opened this issue 9 years ago • 1 comments

While seeking deeper in the code and trying out DiscretizingMaskedHashableStateFactory, I saw that it is missing the methods that MaskedHashableStateFactory is offering for adding both variables and objects. The config field in the Discretizing class also is not protected, so I cannot extend the class and add the missing methods. I also cannot use the constructor properly because it forces to use either variable or class keys but not both, which is possible to walk around with the add-Methods in the MaskedHashableStateFactory.

Perhaps the DiscretizingMaskedHashableStateFactory is extending the wrong class? Maybe it shoud NOT extend SimpleHashableStateFactory but MaskedHashableStateFactory (which itself extends SimpleHashableStateFactory)? Then it also should use the config field from the superclass (for example by overriding it via a superconstructor which is protected and can set the config by subclasses) and not introduce an own config field. Just an idea, it's also possible in other ways to fix this issue :)

Thanks!

(PS: I could help myself for now with getting the config field via reflection from the DiscretizingMaskedHashableStateFactory and use its add-Methods then, but that's not how it should be...)

addy90 avatar Aug 11 '16 11:08 addy90

For the moment, I've changed the config scope to protected (which it should have been all along). I'll look into adding the complete method support Masked has later (or if you want to add it feel free!)

jmacglashan avatar Aug 19 '16 13:08 jmacglashan