-
Notifications
You must be signed in to change notification settings - Fork 45
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
Problem of inheritance in agents #49
Comments
The generation of the correct extend type is easy to apply (done in gallandarakhneorg/sarl).
For illustrating, let take the following example:
|
The FAQ or the tutorials should explain that calling an override function is possible, but not an event handler. |
There is a problem to access to the inherited attributes. |
The idea here is to change the visibility of getter/setter methods to "protected" to enable an access to parent field from a sub-class. |
Consider the SARL code:
It is not possible to generate the setter function due to a Xtext limitation. Indeed, the generated setter may be: public void setThevar(<<INFERENCED TYPE>> thevar) {
this.thevar = thevar;
} Unfortunately, for generating the method |
The only way to provide access to the attributes from the subclasses of agents is to make protected the attributes. The getter/setter becomes not more required. |
…ssue #49), the agent's variables are generated as protected java fields.
This is the same problem as events and capacities, but I din't see it for agents.
With:
The following Java code is generated:
The text was updated successfully, but these errors were encountered: