Q-learning-in-C/main.c
2023-05-31 11:31:15 +08:00

21 lines
493 B
C

#include "constant.h"
#include "enviroment.h"
#include "q-learning.h"
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
short board[9] = { 0 }; // tic tac toe's chessboard
float table[STATE_NUM][ACTION_NUM]; // q-learning table
srand(time(NULL));
init_table(&table[0][0]);
run(&table[0][0], board, false, 10000, false);
run(&table[0][0], board, true, EPISODE_NUM, false);
run(&table[0][0], board, false, 10000, false);
}