Skip to content

pynetlogo calling a model which uses py extension #79

@SebasMeza

Description

@SebasMeza

Hi,

I hope to receive any help here.

I'm trying to run an old model that I initialized in Python through pynetlogo and that model has inside as well usage of the py extension. I know it is a strange usage to call a NetLogo model from Python and then use Python from the model but it is something I did some years ago and worked properly.

Nowadays I'm trying to set up again the model (for research purposes) but I'm getting the error shown in the image and the following message:

`java.lang.RuntimeException
at netLogoLink.NetLogoLink.loadModel(NetLogoLink.java:121)

Traceback (most recent call last):

  File NetLogoLink.java:121 in netLogoLink.NetLogoLink.loadModel

Exception: Java Exception


The above exception was the direct cause of the following exception:

Traceback (most recent call last):

  File ~\anaconda3\lib\site-packages\pynetlogo\core.py:246 in load_model
    self.link.loadModel(path)

java.lang.RuntimeException: java.lang.RuntimeException


During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  Cell In[4], line 1
    model.load_model('C:/Users/sebas/Downloads/AGuerra/Artículo/models/simulation.nlogo')

  File ~\anaconda3\lib\site-packages\pynetlogo\core.py:249 in load_model
    raise NetLogoException(str(ex))

NetLogoException: java.lang.RuntimeException`

I guess the error raises because I'm also calling Python from the models called by Python. I guess it is because I call other models without the Python extension and it works fine.

Let me know please what the cause could be and if I making any mistake or I'm guessing well. Just trying to find a solution but I'm still not there.

@quaquel

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions