35疯狂的科学家

63肯瑞托法师

13过期货物专卖商

64对面的英雄术士

比较好的出牌策略是,肯瑞托法师+寒冰屏障

ailoop1

startEnemyTurnSimThread1
start print 6 actions startIndex = 0,endIndex = 1
a1.print(); start
play id 63 pos 2   肯瑞托法师
a1.print(); end

a2.print(); start
attacker: 35 enemy: 13   疯狂的科学家 攻击 过期货物专卖商
a2.print(); end

a3.print(); start
attacker: 35 enemy: 64   疯狂的科学家 攻击 术士
a3.print(); end

a4.print(); start
useability                   法师英雄技能 攻击 术士
on enemy: 64
a4.print(); end

a5.print(); start
useability                     法师英雄技能 攻击  己方随从疯狂的科学家
on enemy: 35       
a5.print(); end

a6.print(); start
useability                  法师英雄技能 攻击 过期货物专卖商
on enemy: 13
a6.print(); end

end print 6 actions startIndex = 0,endIndex = 1,

ailoop2

deep 2 len 14 dones 0
cut to len 10

上面6个操作,456都淘汰,考察123

首先考察ailoop1中的action1,有3个后续操作

(搜索

action1
play id 63 pos 2

)

得到以下结果

itemPlayfield1 chuck deep2==2 boardvalue==18
action1
play id 63 pos 2
action2
attacker: 35 enemy: 64    疯狂科学家攻击术士

attacker: 35 enemy: 64
itemPlayfield5 chuck deep2==2 boardvalue==13
action1
play id 63 pos 2
action2
play id 60 pos 1   寒冰屏障

itemPlayfield6 chuck deep2==2 boardvalue==8
action1
play id 63 pos 2
action2
attacker: 35 enemy: 13     疯狂科学家攻击过期货物专卖商

ailoop3

ailoop2中的第5个是完美操作,尝试在ailoop3查找。

itemPlayfield1 chuck deep2==3 boardvalue==15
action1
play id 63 pos 2   肯瑞托法师
action2
attacker: 35 enemy: 64      科学家 攻击 术士
action3
play id 60 pos 1      寒冰屏障

+++++++ printBoard start +++++++++
board/hash/turn: 15 / 2251115620103 / 0 ++++++++++++++++++++++
pen 0
mana 0/3
cardsplayed: 2 handsize: 0 enemyhand: 5
ownhero:
ownherohp: 30 + 0
ownheroattac: 0
ownheroweapon: 0 0 unknown None 0 0
ownherostatus: frozenFalse
enemyherohp: 26 + 0
play id 63 pos 2
attacker: 35 enemy: 64
play id 60 pos 1
OWN MINIONS################ 2
deckpos, name,ang, hp: 1, madscientist, 2, 2 35
deckpos, name,ang, hp: 2, kirintormage, 4, 3 63
ENEMY MINIONS############ 1
deckpos, name,ang, hp: 1, expiredmerchant, 2, 1 13
Own Handcards:
+++++++ printBoard end +++++++++

itemPlayfield2 chuck deep2==3 boardvalue==5
action1
play id 63 pos 2     肯瑞托法师
action2
play id 60 pos 1     寒冰屏障
action3
attacker: 35 enemy: 13    科学家 攻击 专卖商

+++++++ printBoard start +++++++++
board/hash/turn: 5 / 1740715810003 / 0 ++++++++++++++++++++++
pen 0
mana 0/3
cardsplayed: 2 handsize: 0 enemyhand: 5
ownhero:
ownherohp: 30 + 0
ownheroattac: 0
ownheroweapon: 0 0 unknown None 0 0
ownherostatus: frozenFalse
enemyherohp: 28 + 0
play id 63 pos 2
play id 60 pos 1
attacker: 35 enemy: 13
OWN MINIONS################ 1
deckpos, name,ang, hp: 1, kirintormage, 4, 3 63
DIED MINIONS############
own, entity, cardid: False, 13, ULD_163
own, entity, cardid: True, 35, FP1_004
Own Handcards:
+++++++ printBoard end +++++++++

ailoop4

ailoop4
startEnemyTurnSimThread1
start print 0 actions startIndex = 0,endIndex = 2
end print 0 actions startIndex = 0,endIndex = 2,
startEnemyTurnSimThread2
start print 0 actions startIndex = 0,endIndex = 2
end print 0 actions startIndex = 0,endIndex = 2,
itemPlayfield1 chuck deep1==4 boardvalue==14
itemPlayfield2 chuck deep1==4 boardvalue==11
index = 1 pVal-bestoldval, pVal = 14, bestoldval = 17
index = 2 pVal-bestoldval, pVal = 11, bestoldval = 17
deep 4 len 0 dones 0
cut to len 0

但是ai经过计算,认为不上奥秘比较好?

value of best board 17
Best actions as following:
Action1:
play id 63 pos 2
Action2:
attacker: 35 enemy: 64
### do all moves in Ai end ###
calculated 0.6313037
+++++++ printBoard start +++++++++
board/hash/turn: 17 / 1651115620103 / 1 ++++++++++++++++++++++
pen 0
mana 0/3
cardsplayed: 1 handsize: 1 enemyhand: 5
ownhero:
ownherohp: 30 + 0
ownheroattac: 0
ownheroweapon: 0 0 unknown None 0 0
ownherostatus: frozenFalse
enemyherohp: 26 + 0
play id 63 pos 2
attacker: 35 enemy: 64
OWN MINIONS################ 2
deckpos, name,ang, hp: 1, madscientist, 2, 2 35
deckpos, name,ang, hp: 2, kirintormage, 4, 3 63
ENEMY MINIONS############ 1
deckpos, name,ang, hp: 1, expiredmerchant, 2, 1 13
Own Handcards:
pos 1 iceblock 3 entity 60 EX1_295 0 0 0
+++++++ printBoard end +++++++++

查看历史记录,发现ailoop3里面有以下记录。尝试打印deep1=3的时候,itemplayfield为1和3的记录的面板

itemPlayfield1 chuck deep1==3 boardvalue==17
itemPlayfield2 chuck deep1==3 boardvalue==-13
itemPlayfield3 chuck deep1==3 boardvalue==17

itemPlayfield1 chuck deep1==3 boardvalue==17

+++++++ printBoard start +++++++++
board/hash/turn: 17 / 1651115620103 / 1 ++++++++++++++++++++++
pen 0
mana 0/3
cardsplayed: 1 handsize: 1 enemyhand: 5
ownhero:
ownherohp: 30 + 0
ownheroattac: 0
ownheroweapon: 0 0 unknown None 0 0
ownherostatus: frozenFalse
enemyherohp: 26 + 0
play id 63 pos 2
attacker: 35 enemy: 64
OWN MINIONS################ 2
deckpos, name,ang, hp: 1, madscientist, 2, 2 35
deckpos, name,ang, hp: 2, kirintormage, 4, 3 63
ENEMY MINIONS############ 1
deckpos, name,ang, hp: 1, expiredmerchant, 2, 1 13
Own Handcards:
pos 1 iceblock 3 entity 60 EX1_295 0 0 0
+++++++ printBoard end +++++++++

itemPlayfield3 chuck deep1==3 boardvalue==17
+++++++ printBoard start +++++++++
board/hash/turn: 17 / 1661115620103 / 1 ++++++++++++++++++++++
pen 0
mana 0/3
cardsplayed: 1 handsize: 1 enemyhand: 5
ownhero:
ownherohp: 30 + 0
ownheroattac: 0
ownheroweapon: 0 0 unknown None 0 0
ownherostatus: frozenFalse
enemyherohp: 26 + 0
attacker: 35 enemy: 64
play id 63 pos 2
OWN MINIONS################ 2
deckpos, name,ang, hp: 1, madscientist, 2, 2 35
deckpos, name,ang, hp: 2, kirintormage, 4, 3 63
ENEMY MINIONS############ 1
deckpos, name,ang, hp: 1, expiredmerchant, 2, 1 13
Own Handcards:
pos 1 iceblock 3 entity 60 EX1_295 0 0 0
+++++++ printBoard end +++++++++

比较ai给出的结果,以及期待的结果,发现boardvalue相差2

这个差别是因为使用了寒冰屏障导致的。

左边是正确的结果,使用2张卡牌。   itemPlayfield1 chuck deep2==3 boardvalue==15

右边是ai计算的出结果,少用了一张牌,但是面板数值更高。  itemPlayfield1 chuck deep1==3 boardvalue==17

deep1是进入第i次循环,模拟了敌方操作。

deep2是进入第i次循环,模拟了敌方操作,再生成了一次action的数值。

所以上面左边比右边多了一次操作,因为这次操作导致了分值降低。

retval += p.owncards.Count * 5;  多一张手牌,+5的分值。
面板貌似没有计算,奥秘的分值。可以考虑计算的时候,让奥秘算5分?

发现在判断playfieldvalue的时候,if (p.value >= -2000000) return p.value;

找到3次最优解替换的地方。

deep3 = 1, index = 1, pVal vs bestoldval, pVal = -16, bestoldval = -2E+07
deep3 = 2, index = 1, pVal vs bestoldval, pVal = 15, bestoldval = -16     
deep3 = 3, index = 1, pVal vs bestoldval, pVal = 17, bestoldval = 15

先查看deep3=2,index=1,设置断点

查看p.playactions,发现只有2个操作

数值是在private void startEnemyTurnSimThread(List<Playfield> source, int startIndex, int endIndex)中就设置了

调用了botBase.getPlayfieldValue(p);

p.value = retval;
return retval;

else if (!enoughCalculations)
{
var list = new List<int>() { 1 };   对应的分值是18,13,8。这里的18,下一次操作后变成了15。
if (source.Count == 10 && list.Contains(i + 1))
{
Helpfunctions.Instance.logg("chuck20190906");
p.printBoard();
}

在10和1的时候设置断点,查看getmovelist的结果,然后看怎么计算的数值。

看一下pf.playactions,发现是3个action。

并且 p.nextPlayfields.Add(pf);

然后用botBase.getPlayfieldValue(pf),算一下,发现value降低到15了。

需要在这里看一下,为啥分值降低了

然后跳出模拟敌方操作的函数

if (print)
{
if (deep == 6)
{
Console.WriteLine();
}
startEnemyTurnSimThread(temp, 0, temp.Count);

然后在deep1计算

foreach (var itemPlayfield in temp)
{
chuck2++;
if (deep == 3 && chuck2 == 1)
{
Console.WriteLine();
}

var boardValue = botBase.getPlayfieldValue(itemPlayfield);
Helpfunctions.Instance.logg($"itemPlayfield{chuck2} chuck deep1=={deep} boardvalue=={boardValue}");

temp有10个元素,并且deep是3。

在下边计算,会把nextplayfields添加到posmoves

foreach (Playfield p in temp)
{
chuck3++;
if (this.totalboards > 0)
{
this.calculated += p.nextPlayfields.Count;
}
if (this.calculated <= this.totalboards)
{
this.posmoves.AddRange(p.nextPlayfields);
//p.nextPlayfields.Clear();
}

if (deep == 2 && chuck3 == 1)
{
Console.WriteLine();
}
//get the best Playfield
float pVal = botBase.getPlayfieldValue(p);

所以,有3个action的最终计算,还是落在了

foreach (var itemPlayfield in posmoves)

被自己的代码拦截,多处理了一次。

foreach (var itemPlayfield in temp)
{
chuck2++;
if (deep == 3 && chuck2 == 1)
{
Console.WriteLine();
}

var boardValue = botBase.getPlayfieldValue(itemPlayfield);  看这里为什么多了一个action,计算出15
Helpfunctions.Instance.logg($"itemPlayfield{chuck2} chuck deep1=={deep} boardvalue=={boardValue}");
if (deep == 2 && (chuck2 == 1))
{
itemPlayfield.printBoard();
}
}

最后发现数值是在cut的时候,计算出来的。

public void cuttingposibilities(bool isLethalCheck)
{
// take the x best values
List<Playfield> temp = new List<Playfield>();
Dictionary<Int64, Playfield> tempDict = new Dictionary<Int64, Playfield>();
posmoves.Sort((a, b) => botBase.getPlayfieldValue(b).CompareTo(botBase.getPlayfieldValue(a)));//want to keep the best

排序的时候计算了分值

测试3费有奥秘的时候,是不是会使用奥秘

HearthBuddy 调试肯瑞托法师寒冰屏障的配合的更多相关文章

  1. PHPStorm调试PHP代码~实际操作+mark~~

    因为wamp自己已经下载了xdebug,只要配置开启就行了. 1. 配置php.ini(有就打开注释,没有就加上) XDEBUG Extension[xdebug]zend_extension =&q ...

  2. PHP实现openSug.js参数调试

    这是一款利PHP对百度搜索下拉框提示免费代码实现参数配置调试的程序源代码. 由想要对网站进行搜索下拉调试的站长朋友们进行方便.快速的效果演示,具体参考下面的PHP代码. 如何使用? 请新建一份PHP文 ...

  3. Qt环境搭建(Qt Creator)+Visual Studio

    1.http://www.cnblogs.com/ranjiewen/p/5318768.html 简述 经常有人问我编写Qt程序时使用什么IDE,其实这个真的很难回答(各有所长),只能说看个人爱好了 ...

  4. Qt环境搭建(Visual Studio)

    简述 经常有人问我编写Qt程序时使用什么IDE,其实这个真的很难回答(各有所长),只能说看个人爱好了,因为我两个都用,而且两个都很喜欢(比较多情吧O(∩_∩)O~)! 下面将进行Qt Creator与 ...

  5. 【Qt】Qt环境搭建(Visual Studio)【转】

    简述 经常有人问我编写Qt程序时使用什么IDE,其实这个真的很难回答(各有所长),只能说看个人爱好了,因为我两个都用,而且两个都很喜欢(比较多情吧O(∩_∩)O~)! 下面将进行Qt Creator与 ...

  6. arm那些事

    ARM简介 ARM的商业模式: ARM只负责设计IC,并且出卖自己的设计IP(版权). ARM自己不生产芯片,而是把设计IP授权给其他半导体厂商来生产芯片. 严格地说,ARM并不是一家半导体厂商.   ...

  7. HandlerExceptionResolver统一异常处理 返回JSON 和 ModelAndView

    统一异常处理类的两种方式一种是前后分离,一种是一整套集合返回指定到指定的错误页面显示错误信息 1.由于前后分离,是统一返回JSON的格式 自定义Exception public class Bussi ...

  8. ssd算法的pytorch实现与解读

    首先先放下github地址:https://github.com/acm5656/ssd_pytorch 然后放上参考的代码的github地址:https://github.com/amdegroot ...

  9. 创意、实现和合作:一次原创H5的尝试

    3月的某一天需求同学说:我们想做一个爆款的回流H5. 好的事实上并没有这么夸张. 不过我们确实是第一次真正意义上做这样一个以互动展示为主要形式.以传播和拉回流为主要目的的H5. 虽然最后也没有成为真正 ...

随机推荐

  1. CentOS7 安装记录

    起因是想自建一个本地笔记云存储,按照网上的教程搭建,卡在了其中的一个步骤上(文章见https://www.laobuluo.com/1542.html),卡在了如下图的位置,google了一番解决的办 ...

  2. HDU-5728-PowMod-求phi(i*n)前缀和+指数循环节

    HDU-5728-PowMod-求phi(i*n)前缀和+指数循环节 [Problem Description] 令\(k=\sum_{i=1}^m \varphi(i\cdot n)\ mod \ ...

  3. CH6201 走廊泼水节[最小生成树]

    描述 [简化版题意]给定一棵N个节点的树,要求增加若干条边,把这棵树扩充为完全图,并满足图的唯一最小生成树仍然是这棵树.求增加的边的权值总和最小是多少. 我们一共有N个OIER打算参加这个泼水节,同时 ...

  4. javascript常用工具类util.js

    //如果大家想要补充,请留言 /** * 判断指定名称的复选框是否被选中 * * @param {} * chname复选框名称 */ function chkCheckCha(chname) { v ...

  5. nginx location中root指令和alias指令的区别

    nginx location中root指令和alias指令 功能:将url映射为文件路径,以返回静态文件内容 差别:root会将完整的url映射进文件路径中 alias只会将location后的url ...

  6. 49、[源码]-Spring容器创建-创建Bean准备

    49.[源码]-Spring容器创建-创建Bean准备

  7. [CSS] The :empty Pseudo Selector Gotchas

    The :empty pseudo selector selects empty elements. We can use this to display useful messages instea ...

  8. 第十三章 使用ADO.NET访问数据库

    一,什么是ADO.NET ADO.NET 是一种以面向对象的设计方法构建的数据访问和操作的类库,它建立在.NET平台上,以便于操作各种各样的数据源.这些数据源可以是数据库, 也可以是文本文件 ,EXC ...

  9. Educational Codeforces Round 76 (Rated for Div. 2) D题

    题意: 给你n个关卡,每个关卡有一个怪物,怪物的攻击力为a[i],你有n个英雄,每个英雄有一个攻击力,和疲劳值,只要英雄的攻击力比怪物的高就算打过了,同时疲劳减一,一天只能出战一个英雄,一个英雄可以打 ...

  10. sql server 存储过程 output 和return的使用 方法,详解

    SQL Server目前正日益成为WindowNT操作系统上面最为重要的一种数据库管理系统,随着 SQL Server2000的推出,微软的这种数据库服务系统真正地实现了在WindowsNT/2000 ...