AutoVerse-ai / Verse-library

Library for modeling, simulation, and verification of interacting autonomous agents
https://autoverse-ai.github.io/Verse-library/
University of Illinois/NCSA Open Source License
29 stars 18 forks source link

demos not working after refactored verse lib #3

Closed sayanmitracode closed 2 years ago

sayanmitracode commented 2 years ago

pulled and installed new verse lib; installation worked fine. When I tried to run the demo, got the following:

polytope failed to import cvxopt.glpk. will use scipy.optimize.linprog Traceback (most recent call last): File "demo2.py", line 32, in car = CarAgent('car1', file_name=input_code_name) File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/verse-0.1-py3.8.egg/verse/example/example_agent/car_agent.py", line 59, in init File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/verse-0.1-py3.8.egg/verse/agents/base_agent.py", line 6, in init File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/verse-0.1-py3.8.egg/verse/code_parser/parser.py", line 253, in parse File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/verse-0.1-py3.8.egg/verse/code_parser/parser.py", line 337, in parse FileNotFoundError: [Errno 2] No such file or directory: './demo/vehicle/controller/example_controller2.py'

keyis2 commented 2 years ago

Hi, Sayan! It seems to work on my side. I think the possible reason is it runs in the wrong directory since we use relative path here. '.' means the current directory, and './demo' means we want to find 'demo' under current directory.

Maybe you can try to switch to the root folder of our lib i.e., Verse-library which the 'demo' folder belongs to, and then run demo by python3 demo/vehicle/demo2.py

When I switch to the demo folder and run by python3 vehicle/demo2.py, FileNotFoundError occurs.

By the way, demo2.py may look abnormal, the reason is the time step is set to 1 which is too large.

What's more, I think we can also use absolute path. Just call a python function to get the absolute path of the current file and modify it to get the target file.

sayanmitracode commented 2 years ago

Ok, worked when running demo from root folder.