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
def qlearning(env, policy, num_iter1, alpha, gamma): | |
actions = policy.actions | |
for i in xrange(len(policy.theta)): | |
policy.theta[i] = 0.1 | |
for iter1 in xrange(num_iter1): | |
s_f = env.reset() | |
a = policy.epsilon_greedy(s_f) | |
count = 0 | |
t = False |
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
# coding: utf-8 | |
# | |
# This is a solution to | |
# https://chyyuu.gitbooks.io/os_course_exercises/content/all/04-1-spoc-discussion.html#虚拟页式存储的地址转换 | |
# | |
# Author: github.com/sunskyhsh | |
import sys | |
def translate(va, pd): |
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 python | |
# author: github.com/sunskyhsh | |
import sys | |
from optparse import OptionParser | |
import random | |
# process states | |
STATE_RUNNING = 'RUNNING' | |
STATE_READY = 'READY' |