-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
110 lines (104 loc) · 4.76 KB
/
Copy pathindex.html
File metadata and controls
110 lines (104 loc) · 4.76 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/p5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.9.0/addons/p5.dom.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@4.17.0/dist/tf.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.js"></script>
<title>Autonomous Car Simulation</title>
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<div class="container">
<header class="header">
<h1>Autonomous Car Simulation</h1>
<div class="header-controls">
<button
id="toggle-settings-btn"
onclick="toggleSettingsPanel()"
>
Settings
</button>
<button id="toggle-about-btn" onclick="toggleAboutPanel()">
About
</button>
<button id="theme-toggle-btn" onclick="toggleTheme()">
Toggle Theme
</button>
</div>
</header>
<div id="settings-panel" class="settings-panel hidden">
<h2>Simulation Settings</h2>
<div class="setting-group">
<label for="btn_toggle">Obstacle Movement:</label>
<button id="btn_toggle" onclick="toggle_btn()">
Dynamic
</button>
</div>
<div class="setting-group">
<label for="obs_no">Number of Obstacles:</label>
<input
type="number"
id="obs_no"
placeholder="e.g., 20"
value="20"
/>
<button onclick="change_obs_no()">Set</button>
</div>
<div class="setting-group">
<label>Simulation Speed:</label>
<div id="speed-slider-container"></div>
</div>
<div class="setting-group">
<label>Model Actions:</label>
<button onclick="save_model()">Save Best Model</button>
<div class="model-load-group">
<span>Load Model:</span>
<input type="file" id="upload-json" accept=".json" />
<input type="file" id="upload-weights" accept=".bin" />
<button onclick="load_model()">Load</button>
</div>
</div>
</div>
<div id="about-panel" class="settings-panel hidden">
<div class="panel-header">
<h2>About This Simulation</h2>
<button
id="refresh-about-btn"
onclick="refreshAboutContent()"
title="Refresh content"
>
🔄
</button>
</div>
<div id="about-content" class="dynamic-content">
<p class="loading-text">Loading about content...</p>
</div>
</div>
<div id="simulation-info-bar" class="simulation-info-bar">
<span id="generation-info">Generation: 0</span>
<span id="speed-info">Speed: 0.00 Km/h</span>
<span id="distance-info">Distance from obstacle: 0.000 m</span>
<span id="current-laps-info">Current Best Laps: 0</span>
<span id="all-time-laps-info">All-Time Best Laps: 0</span>
</div>
<main id="simulation-canvas"></main>
</div>
<!-- Global libraries (must load before modules) -->
<script src="js/p5.collide2d.js"></script>
<script src="js/loadbinary.js"></script>
<!-- Our custom ES6 modules -->
<script type="module" src="js/config.js"></script>
<script type="module" src="js/nn.js"></script>
<script type="module" src="js/ray.js"></script>
<script type="module" src="js/boundary.js"></script>
<script type="module" src="js/particle.js"></script>
<script type="module" src="js/ga.js"></script>
<script type="module" src="js/contentLoader.js"></script>
<script type="module" src="js/dashboard.js"></script>
<script type="module" src="js/sketch.js"></script>
</body>
</html>