CityFlow
CityFlow copied to clipboard
How to access functions like getPoint() which are in Vehicle class
I tried adding this part of code to cityflow.cpp
Functions in engine class can be accessed by starting the engine at above. But how can I access functions like getPoint()
I think one solution is to write a new function which return a std::vector
Do you mean to write a function in the vehicle class in vehicle.cpp file. Even after that, I can't seem to figure out how to use any of those functions like getMinGap(), getYeildDistance(), or any of those functions in vehicle class to use in my script file like I use the functions in engine class.
@soodoshll Please can you make it more clear. I can't seem to figure it out.
@Sdinesh7 If you want to use the method in Vehicle class, you need to call it on the Vehicle object instead of Engine object. That means, you need to add a method to Engine first, which return a vector of vehicles (In python, list of vehicle objects). Then you can call the method on each vehicle object.