learn_to_drive: change learn_to_drive signature to be launch in a thread
This commit is contained in:
@@ -391,7 +391,8 @@ const char* target_symlink = ".ff_target_.symlink";
|
|||||||
const char* main_symlink = ".ff_main_.symlink";
|
const char* main_symlink = ".ff_main_.symlink";
|
||||||
|
|
||||||
|
|
||||||
void learn_to_drive(struct RL_agent * rlAgent){
|
void* learn_to_drive(void * lrnarg){
|
||||||
|
struct RL_agent *rlAgent = (struct RL_agent *)lrnarg;
|
||||||
printf("debug: start learn_to_drive\n");
|
printf("debug: start learn_to_drive\n");
|
||||||
int action;
|
int action;
|
||||||
struct vehicle * car = rlAgent->car;
|
struct vehicle * car = rlAgent->car;
|
||||||
@@ -461,5 +462,7 @@ void learn_to_drive(struct RL_agent * rlAgent){
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
////pthread_join(threadPrint, NULL);
|
////pthread_join(threadPrint, NULL);
|
||||||
|
printf("debug: end learn\n");
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -146,7 +146,8 @@ void train_qlearning(struct RL_agent * rlAgent,
|
|||||||
// tensor_TYPE_FLOAT * state /*input*/,
|
// tensor_TYPE_FLOAT * state /*input*/,
|
||||||
// long reward;
|
// long reward;
|
||||||
|
|
||||||
void learn_to_drive(struct RL_agent * rlAgent);
|
//void* learn_to_drive(struct RL_agent * rlAgent);
|
||||||
|
void* learn_to_drive(void * rlAgent);
|
||||||
int is_ending(struct status_qlearning *qlStatus);
|
int is_ending(struct status_qlearning *qlStatus);
|
||||||
|
|
||||||
///char *fileNameDateScore(char * pre, char* post,size_t score);
|
///char *fileNameDateScore(char * pre, char* post,size_t score);
|
||||||
|
|||||||
Executable
BIN
Binary file not shown.
Reference in New Issue
Block a user