Community
Participate
Working Groups
Java classes that are being generated by the SD builder are not generated into the correct packages. Each class should end up in a package that is named after the Dynamic Variable's parent.
The parent of a Dynamic Variable is an Agent. The Agent's ID is used to come up with a meaningful package name. I've committed the bugfix to the repository.
Curious, why can't these be in the same package as the other model components?
A new namespace lowers the chance of name collisions. Besides, I think it makes sense to bring structure into the package tree. (In reply to comment #2) > Curious, why can't these be in the same package as the other model components?
(In reply to comment #3) > A new namespace lowers the chance of name collisions. Besides, I think it makes > sense to bring structure into the package tree. > > (In reply to comment #2) > > Curious, why can't these be in the same package as the other model components? OK, I think I'm just confused about how things are working here. Is is just the dynamic variable that is in the sub-package or the agent itself? If the latter, why don't we call it something more generic, like "my.model.var." or "my.model.dynvar"? My idea with all of the suggestions I've made regarding code generation is that we have as integrated a design as possible..i.e. that people shouldn't know or care whether a model is officially an SD model or an ABM model or whatever, but that they can freely mix an match so I think namespace should reflect that. Note btw, that the reason that member contexts aren't in subclasses is that we want to preserve the ability for people to construct models out of arbitrary subcomponents. We'll eventually need to have a much more sophisticated name space mechanism to handle that in a more universal way but until then that is the reasoning behind allowing the package names to be inherited through the tree.
Due to the pressure of time, I'm committing the bug fix. That way the SD example will be built and compiled. But I'm aware that this discussion is not finished and I'm willing to discuss about better solutions!