Udacity CS212 unit5 赌博问题简单程序
来源:互联网 发布:网络成瘾的症状 编辑:程序博客网 时间:2024/05/31 19:55
选择hold还是gamble,通过这个程序理解utility和quality的概念。
import mathactions = ["hold", "gamble"]def Quality(state, action, U): if action == "hold": return U(state + 1e6) if action == "gamble": return U(state) * 0.5 + U(state + 3e6) * 0.5 def identical(x):return x def BestAction(state, actions,U): def EU(action): return Quality(state, action, U) return max(actions, key=EU);print BestAction(1, actions, identical)print BestAction(1e6, actions, identical)print BestAction(10e6, actions, identical)print BestAction(1, actions, math.log10)print BestAction(1e6, actions, math.log10)print BestAction(10e6, actions, math.log10)
- Udacity CS212 unit5 赌博问题简单程序
- unit5
- unit5
- unit5
- unit5
- Unit5
- 赌博
- C#基础-027 简单模拟赌博
- 扎金花赌博小程序JAVA源码
- 赌博中,关于保赢时赔率的小问题、、、
- 赌博算法之约瑟夫环问题(JAVA)
- 赌博问题之根源——赌盲
- 一种赌博游戏输赢概率的简单结论
- 242_简单赌博系统反映深刻道理
- python编写简单赌博游戏赏析及注意事项
- linux unit5
- Book1-Unit5
- Book3-Unit5
- Oracle Data Files
- DFS(深度优先搜索)与BFS(广度优先搜索)
- 函数属性和方法
- hdu 4313 Matrix 树形dp
- Going Home----最小费用流
- Udacity CS212 unit5 赌博问题简单程序
- ubuntu 开发环境搭建:eclipse+flex
- Ubuntu安装wubi输入法
- int、Integer、Integer.valueOf()、new Integer的比较
- 两个javascript之间函数的调用
- Redhat (CentOS) 建本地yum源
- nyoj 38 布线问题
- 修改虚拟机共享文件夹路径/mnt/hgfs
- 利用Flash读取SQL Server数据库的值