- 博客(14)
- 收藏
- 关注
原创 Q-learning 入门 (小demo)
什么是强化学习? 智能体(Agent,决策策略/算法/Q表可以理解为智能体的大脑)跟环境交互,在环境中做动作,由状态SiS_iSi变状态Si+1S_{i+1}Si+1,环境给予回报,智能体根据回报更新自己的”大脑“,不断在环境中探索,不断根据回报自我优化,慢慢的适应环境,达到预期最优。 什么是Q-learning? 一种经典的强化学习方法,定义了一个与状态,动作相关的值Q值,也叫 状态-动作值 ,它的意义是 在状态sis_isi下选择动作aia_iai的价值。 实现方式是维护一个真实的Q表,是一个
2021-05-02 02:59:56
508
原创 Pygame圆形移动 遇边框反弹
import pygame Weith = 400 Height = 600 pygame.init() window = pygame.display.set_mode((Weith,Height )) window.fill((255,255,255)) x = 100 y = 100 r = 30 num = 1 speed = 1 pygame.display.set_caption(“sb”) while True: num += 1 if num % 10 == 0: window.fill..
2020-12-04 00:53:08
705
原创 pygame 实现动画效果 圆形慢慢向下移动
import pygame WIN_WIDTH = 400 WIN_HEIGHT = 600 pygame.init() window = pygame.display.set_mode((WIN_WIDTH,WIN_HEIGHT)) pygame.display.set_caption("fasfadasfasf") y = 100 window.fill((255,255,255)) num =1 while True: num = num +1 if num%10 == 0:
2020-12-04 00:24:26
1082
原创 删除一个有序链表中重复的val
public class DeleteDuplication { public static ListNode deleteDuplication(ListNode pHead) { if (pHead == null) { return pHead; } ListNode prev = new ListNode(); ListNode fake = prev; prev.next = pHead...
2019-11-24 20:34:41
163
原创 两个有序链表合并成一个有序链表
private static Node mergeTwoLists(Node list1, Node list2) { if (list1 == null) { return list2; } if (list2 == null) { return list1; } // 定义了两个引用,用来遍历链表 Node cur...
2019-11-24 20:31:20
248
原创 判断单链表是否为回文
public class PalindromList { //计算链表长度 public int getLength(ListNode head) { int count = 0; ListNode cur = head; while (cur != null) { cur = cur.next; count++; } return count; } //得到链表的中间节点 public List...
2019-11-22 22:53:33
200
原创 1.猜数字游戏
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include<stdlib.h> #include<time.h> int main() { srand((unsigned) time(NULL)); int result = rand ()% 101; int a = 0; printf(“请输入你要猜...
2019-10-30 17:43:24
326
原创 1.完成猜数字游戏。 2.写代码可以在整型有序数组中查找想要的数字, 找到了返回下标,找不到返回-1.(折半查找)
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include<stdlib.h> #include <time.h> #include<windows.h> void test() { srand((unsigned)time(NULL)); int a = rand() % 101; int...
2019-10-16 15:40:30
199
原创 1.在屏幕上输出以下图案: * *** ***** ******* ********* *********** ************* *********** ********* *******
2019-10-11 20:14:24
463
原创 1. 将数组A中的内容和数组B中的内容进行交换。(数组一样大) 2. 计算1/1-1/2+1/3-1/4+1/5 …… + 1/99 - 1/100 的值。 3. 编写程序数一下 1到 100 的所有
2019-10-11 20:10:41
151
原创 1. 给定两个整形变量的值,将两个值的内容进行交换。 2. 不允许创建临时变量,交换两个数的内容(附加题) 3.求10 个整数中最大值。 4.将三个数按从大到小输出。 5.求两个数的最大公约数。
![ ![ ![ ![ ](https://img-blog.csdnimg.cn/20191005152347613.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0FsZWtpc2I=,size_16,co![ ![ ![ ](http...
2019-10-05 15:25:20
171
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人