Skip to content
Snippets Groups Projects
Commit f82d375d authored by maberet's avatar maberet
Browse files

commit pour le merge main

parent 802c28b1
No related branches found
No related tags found
No related merge requests found
#include "main.h"
int running;
......@@ -8,10 +9,17 @@ int main()
srand(time(NULL));
Q = allocateAndInitiateQ();
readQFromFile(Q);
//traningAgent(10000, 30 , Q);
running = 1;
game_state = GAME;
readMapFromFile("map.txt");
initPlayer();
initEnnemy();
initKeys();
initBall();
freeQ(Q);
//mainLoop();
mainLoop();
}
\ No newline at end of file
......@@ -430,9 +430,7 @@ void traningAgent ( int numberRun, int numberStep, float *****Q) {// pour avoir
dropZone=convertIntoZone(dropPoint.x,dropPoint.y);
canonZone= j;
reward=0;
//printf (" %d \n ", m);
while(i>0){
// printf("%d %d \n ",agent->x ,agent->y );
action =takeAction(agent->x ,agent->y , Q, canonZone, zoneAngleH, zoneAngleF, greedy);
agentZone= convertIntoZone( agent->x,agent->y );
line.receiverZone= agentZone;
......@@ -489,10 +487,12 @@ void traningAgent ( int numberRun, int numberStep, float *****Q) {// pour avoir
}
}
} writeQ(Q);
}
writeQ(Q);
if (n%10000==1){printf (" %d \n ", n);}
greedy = greedy - 1/(n+1);
n++;
}
freeStack(stack);
}
\ No newline at end of file
......@@ -10,7 +10,7 @@
#define M_PI 3.14159265358979323846
#define LEARN_RATE 0.8
#define LEARN_RATE 0.5
#define DISCOUNT 0.8
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment