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

Updating Tutorial 7 Documentation #30

Open
nmsutton opened this issue Mar 16, 2023 · 2 comments
Open

Updating Tutorial 7 Documentation #30

nmsutton opened this issue Mar 16, 2023 · 2 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@nmsutton
Copy link
Contributor

nmsutton commented Mar 16, 2023

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:

# Targets  
add_executable(TuneFiringRates
    src/main_TuneFiringRates.cpp
    /comp_neuro/Software/CARLsim6-feat-ca3net/tools/pti/PTI.cpp
    /comp_neuro/Software/CARLsim6-feat-ca3net/tools/pti/ParameterInstances.cpp
    /comp_neuro/Software/CARLsim6-feat-ca3net/tools/pti/Logger.cpp
    /comp_neuro/Software/CARLsim6-feat-ca3net/tools/pti/Util.cpp
)

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.

@nmsutton nmsutton changed the title Tutorial 7 documentation Updating Tutorial 7 Documentation Mar 16, 2023
@SigmaX SigmaX self-assigned this Apr 26, 2023
@SigmaX SigmaX added bug Something isn't working documentation Improvements or additions to documentation labels Apr 26, 2023
@SigmaX
Copy link
Contributor

SigmaX commented Apr 26, 2023

Todos

  • Correct the docs / get it working smoothly with cmake
  • Update the ECJ repo's Makefile
  • Take a broader pass over Tutorial 7 and look for places to improve it

@SigmaX
Copy link
Contributor

SigmaX commented Apr 28, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants