File size: 1,368 Bytes
f4469a2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e7382ad
f4469a2
 
 
 
 
 
 
 
e7382ad
f4469a2
 
e7382ad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Reinforcement Learning Grid World</title>
    <style>
        .grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 1px;
            width: 500px;
            height: 500px;
            margin: 20px auto;
            border: 1px solid black;
        }
        .cell {
            display: flex;
            justify-content: center;
            align-items: center;
            background-color: white;
            border: 1px solid black;
        }
        .agent {
            background-color: blue;
            color: white;
        }
        .goal {
            background-color: green;
            color: white;
        }
        .obstacle {
            background-color: red;
            color: white;
        }
    </style>
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body>
    <div id="grid" class="grid">
        <!-- Cells will be dynamically generated here -->
    </div>
    <button id="startButton">Start</button>
    <button id="stepButton">Step</button>
    <button id="resetButton">Reset</button>
    <canvas id="learningGraph" width="400" height="200"></canvas>
    <script src="rl_script.js"></script>
</body>
</html>