You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to get #include "PTI.h" to run in tutorial 7 I needed to create a new project named TuneFiringRates. In the project's CMakeLists.txt I added each .cpp file in tools/pti to "# Targets add_executable".
For example, on my computer (Ubuntu 21.10) this was:
I followed the instructions in tutorial 7 and it compiled TuneFiringRates successfully. Without adding the .cpp files to CMakeLists.txt it did not compile due to errors. Because CARLsim6 uses cmake the instructions in tutorial 7 should be updated to explain how to compile projects with PTI when cmake is used.
A change in CARLsim6 tutorial 7 documentation compared to recent versions is that it directs users to use a class named "CommandProblem" but this class is not present in the current ECJ official release (version 27). This class is however present in the latest ECJ Github code (link). Therefore, users will need to download the Github code and compile the class from the .java file. Compilation instructions are here. I was able to compile it with the makefile build instructions. Another issue is that even the latest Github code is not set to compile that class by default. Users need to update ECJ's Makefile by adding "ec/app/command/*.java " to the "SRCS =" section. Then compiling ECJ will include generation of the CommandProblem class. A note is that I did both "make" and "make jar" but maybe just "make jar" is sufficient to have the class usable.
Once this class is available users also need to set "eval.problem.command" equal to the compiled CARLsim file (TuneFiringRates) in this case. The tutorial instructions describe this as "./.build/TuneFiringRates" but typically the current CARLsim creates "/.build/projects/TuneFiringRates/TuneFiringRates" as a compiled file for a project. This can be further explained and updated in the tutorial for clarification. Once these step have been taken I have successfully run the tutorial simulation to completion from what I understand. Curiously, in my results every of the 1000 evaluations had the same fitness score but at least the simulation completed processing.
The text was updated successfully, but these errors were encountered:
nmsutton
changed the title
Tutorial 7 documentation
Updating Tutorial 7 Documentation
Mar 16, 2023
Using the other tools/ utilities as dependencies seems to be a bit simpler—because they are compiled as individual libraries already. Should make PTI follow the same pattern for consistency.
Though in all honesty, I feel like all of the C++ tools should be part of the regular CARLsim source tree. I don't see much benefit to having them separate—just makes it hard for users to figure out how to use them.
In order to get #include "PTI.h" to run in tutorial 7 I needed to create a new project named TuneFiringRates. In the project's CMakeLists.txt I added each .cpp file in tools/pti to "# Targets add_executable".
For example, on my computer (Ubuntu 21.10) this was:
I followed the instructions in tutorial 7 and it compiled TuneFiringRates successfully. Without adding the .cpp files to CMakeLists.txt it did not compile due to errors. Because CARLsim6 uses cmake the instructions in tutorial 7 should be updated to explain how to compile projects with PTI when cmake is used.
A change in CARLsim6 tutorial 7 documentation compared to recent versions is that it directs users to use a class named "CommandProblem" but this class is not present in the current ECJ official release (version 27). This class is however present in the latest ECJ Github code (link). Therefore, users will need to download the Github code and compile the class from the .java file. Compilation instructions are here. I was able to compile it with the makefile build instructions. Another issue is that even the latest Github code is not set to compile that class by default. Users need to update ECJ's Makefile by adding "ec/app/command/*.java " to the "SRCS =" section. Then compiling ECJ will include generation of the CommandProblem class. A note is that I did both "make" and "make jar" but maybe just "make jar" is sufficient to have the class usable.
Once this class is available users also need to set "eval.problem.command" equal to the compiled CARLsim file (TuneFiringRates) in this case. The tutorial instructions describe this as "./.build/TuneFiringRates" but typically the current CARLsim creates "/.build/projects/TuneFiringRates/TuneFiringRates" as a compiled file for a project. This can be further explained and updated in the tutorial for clarification. Once these step have been taken I have successfully run the tutorial simulation to completion from what I understand. Curiously, in my results every of the 1000 evaluations had the same fitness score but at least the simulation completed processing.
The text was updated successfully, but these errors were encountered: