-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
172 lines (154 loc) · 9.28 KB
/
index.html
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<link rel="icon" href="./favicon.ico">
<title>Reinforcement Learning - Q-Learning</title>
<style>
#overlay {
position: fixed; /* Sit on top of the page content */
display: none; /* Hidden by default */
width: 100%; /* Full width (cover the whole page) */
height: 100%; /* Full height (cover the whole page) */
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0,0,0,0.5); /* Black background with opacity */
z-index: 2; /* Specify a stack order in case you're using a different order for other elements */
cursor: pointer; /* Add a pointer on hover */
}
#text{
position: absolute;
top: 50%;
left: 50%;
font-size: 50px;
color: white;
transform: translate(-50%,-50%);
-ms-transform: translate(-50%,-50%);
}
</style>
</head>
<body>
<nav class="navbar navbar-light bg-light">
<a class="navbar-brand">Reinforcement Learning - Simulation in Grid World using Q-Learning</a>
<form class="form-inline">
<button type="button" class="btn btn-info" data-toggle="modal" data-target="#exampleModal">
How To
</button>
</form>
</nav>
<div id="overlay"><div id="text">Training agent...</div></div>
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">How To</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p>
A snowman lives in a dangerous place. Its home is a tent. However, there are many locations with high intensity radiation. The snowman is going home but it does not know yet which lane is the safest.
Our algorithm will make snowman decide the most optimal (safest) trajectory to the home (a tent).
<br>
There are several parameters that can be modified in this simulation.
<ul>
<li>Grid Size (Integer)</li>
<li>Start Point (Integer,Integer) - starting point of the snowman</li>
<li>Finish Point (Integer,Integer) - location of the tent</li>
<li>Number of Obstacles per Row (Integer) - At most n obstacles per row. Will be randomized.</li>
<li>Number of episodes (Integer) - For training purpose. The more episode, the more chance to learn.</li>
</ul>
</p>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<div class="container">
<div class="row justify-content-md-center" style="margin-top: 40px;">
<div id="in-title" >
</div>
</div>
<div class="row justify-content-md-center">
<div class="col-sm">
<canvas id="canvas" width="200" height="100" style="border:1px solid #000000;">
</canvas>
</div>
<div class="col-sm">
<div class="input-group input-group-sm mb-3">
<input id="txt-grid-size" type="number" class="form-control" placeholder="Grid Size nxn (default 4)" aria-label="Grid Size nxn" aria-describedby="basic-addon2">
<div class="input-group-append">
<button id="button-grid-size-n" class="btn btn-outline-secondary" type="button">Rebuild</button>
</div>
</div>
<div class="input-group input-group-sm mb-3">
<input id="txt-start-point"type="text" class="form-control" value="0,2" aria-label="Assign Start Point" aria-describedby="basic-addon2">
<div class="input-group-append">
<button id="button-assign-start" class="btn btn-outline-secondary" type="button">Assign Start</button>
</div>
</div>
<div class="input-group input-group-sm mb-3">
<input id="txt-finish-point"type="text" class="form-control" value="2,3" aria-label="Assign Finish Point" aria-describedby="basic-addon2">
<div class="input-group-append">
<button id="button-assign-finish" class="btn btn-outline-secondary" type="button">Assign Finish</button>
</div>
</div>
<div class="input-group input-group-sm mb-3">
<input id="txt-num-obstacles" type="text" class="form-control" placeholder="Number of Obstacles per Row (default 1)" aria-label="Number of Obstacles per Row" aria-describedby="basic-addon2">
<div class="input-group-append">
<button id="button-num-obstacles-per-row" class="btn btn-outline-secondary" type="button">Randomize</button>
</div>
</div>
<div class="input-group input-group-sm mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="inputGroup-sizing-sm">Number of Episode</span>
</div>
<input id="txt-num-episode" type="number" value="5000" class="form-control" aria-label="Number of Episode" aria-describedby="inputGroup-sizing-sm">
</div>
<div class="input-group input-group-sm mb-3">
<button id="button-train" type="button" class="btn btn-primary btn-lg" style="margin: 0 auto;float: none;">Train</button>
<!---<button id="button-play" type="button" class="btn btn-success btn-lg" style="margin: 0 auto;float: none;">Play</button>-->
</div>
</div>
</div>
<!--<div class="row justify-content-md-center">
<div class="col-sm">
</div>
<div class="col-sm">
<div class="progress">
</div>
<div class="col-sm">
</div>
</div>-->
</div>
<!-- Footer -->
<!-- Footer -->
<footer class="page-footer font-small blue pt-4">
<div class="footer-copyright text-center py-3">
<style>.bmc-button img{width: 35px !important;margin-bottom: 1px !important;box-shadow: none !important;border: none !important;vertical-align: middle !important;}.bmc-button{padding: 7px 10px 7px 10px !important;line-height: 35px !important;height:51px !important;min-width:217px !important;text-decoration: none !important;display:inline-flex !important;color:#ffffff !important;background-color:#FF813F !important;border-radius: 5px !important;border: 1px solid transparent !important;padding: 7px 10px 7px 10px !important;font-size: 20px !important;letter-spacing:-0.08px !important;box-shadow: 0px 1px 2px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 1px 2px 2px rgba(190, 190, 190, 0.5) !important;margin: 0 auto !important;font-family:'Lato', sans-serif !important;-webkit-box-sizing: border-box !important;box-sizing: border-box !important;-o-transition: 0.3s all linear !important;-webkit-transition: 0.3s all linear !important;-moz-transition: 0.3s all linear !important;-ms-transition: 0.3s all linear !important;transition: 0.3s all linear !important;}.bmc-button:hover, .bmc-button:active, .bmc-button:focus {-webkit-box-shadow: 0px 1px 2px 2px rgba(190, 190, 190, 0.5) !important;text-decoration: none !important;box-shadow: 0px 1px 2px 2px rgba(190, 190, 190, 0.5) !important;opacity: 0.85 !important;color:#ffffff !important;}</style><link href="https://fonts.googleapis.com/css?family=Lato&subset=latin,latin-ext" rel="stylesheet"><a class="bmc-button" target="_blank" href="https://www.buymeacoffee.com/mabdh"><img src="https://cdn.buymeacoffee.com/buttons/bmc-new-btn-logo.svg" alt="Buy me a coffee"><span style="margin-left:15px;font-size:19px !important;">Buy me a coffee</span></a>
</div>
<!-- Copyright -->
<div class="footer-copyright text-center py-3">© 2019
<a href="http://mabdh.github.io/"> Muhammad Abduh</a>
</div>
<!-- Copyright -->
</footer>
<!-- Footer -->
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
<script type="text/javascript" src="dist/bundle.js"></script>
</body>
</html>