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

Error when variable names contains numbers #21

Open
IgnacioVellido opened this issue Mar 6, 2021 · 0 comments
Open

Error when variable names contains numbers #21

IgnacioVellido opened this issue Mar 6, 2021 · 0 comments
Labels
agent Related to the agent bug Something isn't working

Comments

@IgnacioVellido
Copy link
Owner

When a variable defined in the configuration file (or generally, in the game) contains a number the following error is returned:

Exception in thread "main" java.lang.NullPointerException 
at controller.PlanningAgent.translateGameStateToPDDL(PlanningAgent.java:634)
at controller.PlanningAgent.act(PlanningAgent.java:207
at ontology.avatar.MovingAvatar.requestPlayerInput(MovingAvatar.java:135)
at ontology.avatar.MovingAvatar.updateAvatar(MovingAvatar.java:103)
at ontology.avatar.oriented.OrientedAvatar.updateAvatar(OrientedAvatar.java:53)
at core.game.Game.tick(Game.java:1363)
at core.game.Game.gameCycle(Game.java:1101)
at core.game.Game.runGame(Game.java:873)
at tracks.ArcadeMachine.runOneGame(ArcadeMachine.java:168)
at tracks.singlePlayer.Test.main(Test.java:83)             

For example, when giving the configuration file:

gameElementsCorrespondences:
...
  inc1:
  - (at ?x ?y ?inc1)
  inc2:
  - (at ?x ?y ?inc2)
  inc3:
  - (at ?x ?y ?inc3)
  inc4:
  - (at ?x ?y ?inc4)
  inc5:
  - (at ?x ?y ?inc5)
  inc6:
  - (at ?x ?y ?inc6)

variablesTypes:
  ?inc1: inc1
  ?inc2: inc2
  ?inc3: inc3
  ?inc4: inc4
  ?inc5: inc5
  ?inc6: inc6

Renaming the variables (in the VGDL file and in the config) misses the error:

gameElementsCorrespondences:
...
  inca:
  - (at ?x ?y ?inca)
  incb:
  - (at ?x ?y ?incb)
  incc:
  - (at ?x ?y ?incc)
  incd:
  - (at ?x ?y ?incd)
  ince:
  - (at ?x ?y ?ince)
  incf:
  - (at ?x ?y ?incf)

variablesTypes:
  ?inca: inca
  ?incb: incb
  ?incc: incc
  ?incd: incd
  ?ince: ince
  ?incf: incf
@IgnacioVellido IgnacioVellido added bug Something isn't working agent Related to the agent labels Mar 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent Related to the agent bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant