This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 正弦波を出力する。引数でバッファサイズを指定 | |
* (※SDLのドキュメントでは AudioSpec::samples はサンプル数って書いて | |
* るけど、実際はバッファサイズだと思う) | |
* | |
* メインスレッドで音を溜めてコールバックで出力する方式 | |
* スレッド間のデータのやりとりに boost::lockfree::spsc_queue を使用 | |
*/ | |
#include <string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
#--------------------------------------------------------------------- | |
# SDL2で正弦波を出力する。引数でバッファサイズを指定 | |
# | |
# コールバック方式。PythonのGILがどう影響するかの検証 | |
# スレッド間のやりとりにはとりあえず標準の queue を使用 | |
#--------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# Just a handmade algorithm. NOT AI. | |
import gym | |
### MAP ### | |
# SFFF | |
# FHFH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# Just a handmade algorithm. NOT AI. | |
import sys | |
import gym | |
### 4x4 MAP ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import gym | |
def get_action(): | |
while True: | |
try: | |
act = int(input("--- direction(0:L, 1:D, 2:R, 3:U) > ")) | |
return act |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# Just a handmade algorithm. NOT AI. | |
import sys | |
import gym | |
### 4x4 MAP ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import sys | |
import json | |
import numpy as np | |
def error(msg): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import sys | |
import gym | |
DEBUG = False | |
#DEBUG = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# Q学習 | |
# 探索時ランダムプレイ | |
import sys | |
import os.path | |
import pprint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# Q学習 | |
# 探索時e-greedy | |
import sys | |
import random | |
import os.path | |
import pprint |
OlderNewer