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

Skill breaks model validation #44

Open
lesquoyb opened this issue Oct 24, 2024 · 0 comments
Open

Skill breaks model validation #44

lesquoyb opened this issue Oct 24, 2024 · 0 comments
Labels

Comments

@lesquoyb
Copy link
Collaborator

I've added a new skill to the repository, everything compiles and the name of the skill is recognized in gaml, but as soon as I add it the validation of the model breaks: I have an xtext validation error window opening when I first open the file and here is the stack I have in eclipse:

java.lang.NullPointerException: Cannot invoke "gama.core.common.interfaces.ISkill.getDescription()" because the return value of "gama.gaml.expressions.IExpression.getConstValue()" is null
	at gama.gaml.descriptions.SpeciesDescription.setSkills(SpeciesDescription.java:229)
	at gama.gaml.descriptions.SpeciesDescription.<init>(SpeciesDescription.java:142)
	at gama.gaml.descriptions.SpeciesDescription.<init>(SpeciesDescription.java:111)
	at gama.gaml.factories.SpeciesFactory.buildDescription(SpeciesFactory.java:38)
	at gama.gaml.factories.SpeciesFactory.buildDescription(SpeciesFactory.java:1)
	at gama.gaml.factories.DescriptionFactory.create(DescriptionFactory.java:550)
	at gama.gaml.factories.ModelFactory.addMicroSpecies(ModelFactory.java:565)
	at gama.gaml.factories.ModelFactory.lambda$3(ModelFactory.java:258)
	at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:986)
	at gama.gaml.factories.ModelFactory.addSpeciesAndExperiments(ModelFactory.java:258)
	at gama.gaml.factories.ModelFactory.createModelDescription(ModelFactory.java:181)
	at gaml.compiler.gaml.resource.GamlResource.buildModelDescription(GamlResource.java:152)
	at gaml.compiler.gaml.resource.GamlResource.buildCompleteDescription(GamlResource.java:186)
	at gaml.compiler.gaml.resource.GamlResource.validate(GamlResource.java:214)
	at gaml.compiler.gaml.validation.GamlResourceValidator.lambda$0(GamlResourceValidator.java:91)
	at gama.dev.DEBUG.TIMER(DEBUG.java:136)
	at gaml.compiler.gaml.validation.GamlResourceValidator.validate(GamlResourceValidator.java:78)
	at gaml.compiler.ui.editor.GamlEditor$3.lambda$0(GamlEditor.java:537)
	at org.eclipse.xtext.resource.OutdatedStateManager.exec(OutdatedStateManager.java:70)
	at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.internalReadOnly(XtextDocument.java:525)
	at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.readOnly(XtextDocument.java:497)
	at org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(XtextDocument.java:136)
	at gaml.compiler.ui.editor.GamlEditor$3.run(GamlEditor.java:535)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

You can try it out by loading the pmml plugin in gama and open the read_input_fields.gaml model in PMML Manipulation.

This is not the first time I have a similar issue when creating a skill, so it may just be something missing in the documentation.

@lesquoyb lesquoyb added the bug label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant