简体   繁体   中英

C# Algorithmic Game Theory API

I recently came accross Gambit - http://www.gambit-project.org/doc/index.html - a C++ algorithmic game theory API.

Is anyone aware of a .NET Game Theory Library?

I know this would take a small bit of time, but you could download the source for the C++ project you cited and compile it into a DLL that you could reference in your C# project. This link contains information about doing so.

I don't know of any existing library.

The minimax algorithm is pretty easy to implement if you are doing a 2 player game. The following pseudocode is plagiarised from the wiki page :

function integer minimax(node, depth)
    if node is a terminal node or depth <= 0:
        return the heuristic value of node
    α = -∞
    for child in node:   # evaluation is identical for both players 
        α = max(α, -minimax(child, depth-1))
    return α

If you are doing more than 2 players, then there is Sturtevant and Korf's MaxN algorithm .

I've implemented these before, and they are pretty easy. It should be very straightforward in .Net.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM