I have a particular problem. I developed C ++ - a program on a Linux cluster at work. I tried to use it on a Ubuntu 14.04 machine, but a program consisting of 6 files: main.hpp, main.cpp (depends on) sarsa.hpp, sarsa.cpp (Sarsa class) (depends on) wec.hpp, wec.cpp , compiles, but when I run it, it either returns segmenation faultor does not introduce one fundamental class function Sarsa.
The main code calls the constructor and setter functions without problems:
Sarsa run;
run.setVectorSize(memory,3,tilings,1000);
and etc.
However, it cannot run a public function episode, because learningRateit must contain a large integer and returns 0 for all episodes (iterations).
learningRate[episode]=run.episode(numSteps,graph);}
I tried debugging the code using gdb, which returned:
Program received signal SIGSEGV, Segmentation fault.
0x0000000000408f4a in main () at main.cpp:152
152 learningRate[episode]=run.episode(numSteps,graph);}
valgrind, :
==10321== Uninitialised value was created by a stack allocation
==10321== at 0x408CAD: main (main.cpp:112)
.
, , sarsa.cpp, , , ,
++ v11 ( ), g++ -std=c++0x, .
, - . . ? , , ?
.
:
main.cpp:
:
`#define numEpisodes 10
int learningRate [numEpisodes]; `
main:
for (int episode; episode<numEpisodes; episode++) {
if (episode==(numEpisodes-1)) { // Save the simulation data only at the
graph=true;} // last episode
learningRate[episode]=run.episode(numSteps,graph);}