根据不完整的日志文件部分重新创建类似风险的游戏 [英] Partially re-create Risk-like game based on incomplete log files

查看:97
本文介绍了根据不完整的日志文件部分重新创建类似风险的游戏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试重新创建此conquerclub(类似Risk)游戏:

I'm trying to re-create this conquerclub (Risk-like) game:

http://conquerclub.barrycarter.info/ONEOFF/7460216.html

换句话说,我想知道谁在每个时间点都拥有每个领土 及时,以及他们在那片领土上有多少部队.我的主要 信息源是游戏日志.注意:

In other words, I want to know who owned each territory at each point in time, and how many troops they had on that territory. My primary source of information is the Game Log. Notes:

%不在游戏日志中,但是所有领土都由3名士兵组成.

% It's not in the Game Log, but all territories start w/ 3 troops.

%既然我们在游戏结束时就知道了地域拥有者, 游戏日志会提及所有所有者的更改,从而确定区域所有者 任何时间点都很容易.

% Since we know the territory owners at the end of the game, and the Game Log mentions all owner changes, determining territory owners at any point in time is easy.

%面临的挑战是找到一个领土上的士兵人数. 给定时间.

% The challenge is to find the number of troops on a territory at a given time.

%游戏日志提供了有关部队部署,加固, 和征服.

% The Game Log gives information on troop deployment, reinforcement, and conquest.

但是,游戏日志不完整.假设区域X攻击 Y领土未成功,但两个领土在 过程.游戏日志将不会提及这一点.

% However, the Game Log is incomplete. Suppose territory X attacks territory Y unsuccessfully, but both territories lose troops in the process. The Game Log will not mention this.

%通常可能无法找到确切编号 在特定时间在某个领土上的部队,因此我正在寻找射程.

% It's probably not possible (in general) to find the exact number of troops on a territory at a given time, so I'm looking for a range.

%,我尝试将数据作为一系列的数据提供给Mathematica 不等式,但是随着手册的警告,计算时间增加了 与不平等的数量成指数关系.即使有一个相当 少数不平等现象将被搁置.另外,我不相信 Mathematica是这里的正确工具.

% I tried feeding the data to Mathematica as a series of inequalities, but as the manual warns, the computation time increases exponentially with the number of inequalities. Even with a fairly small number of inequalities, it hangs. Plus, I'm not convinced Mathematica is the right tool here.

%有什么想法吗?另一个示例是: http://conquerclub.barrycarter.info/ONEOFF/7562013.html

% Any thoughts? Another example is: http://conquerclub.barrycarter.info/ONEOFF/7562013.html

%,我了解 http://userscripts.org/scripts/show/83035 ,但是只追踪\ 拥有者,而不是部队人数.

% I know about http://userscripts.org/scripts/show/83035 but that only tracks \ owners, not number of troops.

推荐答案

您可以利用Prolog的约束编程(特别是

You could make use of Prolog's constraint programming (specifically, CLP/FD). It would require you to encode all rules in Prolog, which might be a non-trivial task. However Prolog would be able then to show you all possible valid (legal in terms of encoded rules) ways of playing such game, or just show ranges of possible values.

此外,尽管Prolog中的CLP/FD有时非常快,但可能很难用它来快速解决问题.大多数免费的求解器都有很多怪癖.

Also, while CLP/FD in Prolog sometimes is quite fast, it might be difficult to use it to make solving your problem quickly. Most free solvers have many quirks.

同样,我认为这是一项艰巨的任务,如果您以前没有在Prolog中进行编程,那么这甚至会更大.但我很确定,这会为您提供所需的答案.

Again, I think this is a nontrivial task, and even greater if you haven't programmed in Prolog earlier. But I am pretty sure this would give you answers you seek.

这篇关于根据不完整的日志文件部分重新创建类似风险的游戏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆