{"id":28326,"student_id":10,"content":"var Q = {\n 0: [0, 0],\n 1: [0, 0],\n 2: [0, 0],\n 3: [0, 0],\n 4: [0, 0],\n 5: [0, 0],\n 6: [0, 0],\n 7: [0, 0],\n 8: [0, 0],\n}\n\nvar S = 4;\nvar _S;\nvar A;\n\n\nforever(function() {\n var count = 0;\n for (var _ in Q) {\n print(_, 100, 50+ count*30, 'black', 16);\n print(Q[_][0], 200, 50+ count*30, 'black', 16);\n print(Q[_][1], 300, 50+ count*30, 'black', 16);\n count++;\n }\n for (var i = 1; i \u003c 8; i++) {\n pen.fillColor = 'black';\n pen.drawRect(100 + i*60, 400, 50, 50);\n }\n pen.fillColor = 'red';\n pen.drawRect(100 + S*60, 400, 50, 50);\n});\n\n\nwhen('click', () =\u003e {\n if (Q[S][0] \u003e= Q[S][1]) {\n A = 0;\n _S = S - 1;\n } else {\n A = 1;\n _S = S + 1;\n }\n\n if (_S == 0) reword(Q, S, _S, A, -100);\n else if (_S == 8) reword(Q, S, _S, A, 100);\n else reword(Q, S, _S, A, -1);\n \n S = _S;\n \n if (S == 0 || S == 8) {\n S = 4;\n }\n\n});\n\nfunction reword(Q, S, _S, A, R) {\n var re = Math.max(Q[_S][0], Q[_S][1]);\n Q[S][A] = 0.7*Q[S][A] + 0.3*(R + re*0.8);\n}","created_at":"2018-05-10T23:06:40.104+08:00","updated_at":"2019-11-07T11:08:55.673+08:00","name":"Q-learning tutorial","language":"javascript","screenshot":{"url":"https://cdn3.koding.school/uploads/project/screenshot/28326/2f4dc3acee09587272b115504c743111.jpg"},"parent_id":2,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":310,"hashid":"gk4snk8e","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
下載 Android APP (APK)
截圖
1:1:1
1:1
full
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦