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

__includes["..."]extensions [gis] #13

Closed
NaibafR opened this issue Nov 8, 2018 · 7 comments
Closed

__includes["..."]extensions [gis] #13

NaibafR opened this issue Nov 8, 2018 · 7 comments

Comments

@NaibafR
Copy link

NaibafR commented Nov 8, 2018

1.) Within my NetLogo file I work with a "gis extension", defined at the beginning of the Code in the NetLogo file by extensions [gis]. When opening the NetLogo file manually and not through python everything works fine.
However, when starting the NetLogo file through python using netlogo.load_model(...) the GUI of NetLogo opens, but an error message appears saying "Can't find extension: gis".

2.) Within my NetLogo file I have separated the code and have outsourced certain procedures from the main code into a different file which I read in at the beginning of the NetLogo Code by using __includes["file_name"]. When opening the NetLogo file manually and not through python everything works fine and I can start e.g. the setup procedure from the NetLogo GUI.
However, when trying to setup the NetLogo model through python using netlogo.command('setup') I receive the following error message in python: "NetLogoException: Nothing named SETUP has been defined."

Thank you for helping me out :)

@quaquel
Copy link
Owner

quaquel commented Nov 8, 2018

Please provide an explanation of your question. This is not particularly clear.

If your question is how to use extensions like the gis extension, the answer is quite simple. Copy all extensions you want to use to the same directory as your .nlogo file. (if I remember correctly, alternatively, copy them to the directory with your .py file.

My guess is that it has to do with the search path used by netlogo and the current working directory of the ivm, but so far I have been unable to confirm this.

@quaquel
Copy link
Owner

quaquel commented Nov 8, 2018

ok, try the copying suggestion given above and let me know whether that solves it

@NaibafR
Copy link
Author

NaibafR commented Nov 8, 2018

Thank you, Problem (1) is solved :)
I needed to copy the whole "gis"-folder into the same directory as the .nlogo file.

@quaquel
Copy link
Owner

quaquel commented Nov 8, 2018

ok, great. Does copying the files you want to include to the directory with the logo file solve problem 2?

@NaibafR
Copy link
Author

NaibafR commented Nov 8, 2018

Yes, Problem (2) was also solved by copying the files into the same directory as the .nlogo file.
Thank you 👍

@quaquel
Copy link
Owner

quaquel commented Nov 8, 2018

excellent. I will try to add this to the documentation soon. While in the longer term investigating whether changing the working directory of the iava virtual machine makes it not necessary to copy the extensions.

@quaquel
Copy link
Owner

quaquel commented Nov 21, 2018

should be fixed with pull request from @tfrench #8 . I have extended this to also cover windows.

@quaquel quaquel closed this as completed Nov 21, 2018
quaquel added a commit that referenced this issue Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants