Antzy21.Games.SearchAlgorithms 1.0.0

dotnet add package Antzy21.Games.SearchAlgorithms --version 1.0.0                
NuGet\Install-Package Antzy21.Games.SearchAlgorithms -Version 1.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Antzy21.Games.SearchAlgorithms" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Antzy21.Games.SearchAlgorithms --version 1.0.0                
#r "nuget: Antzy21.Games.SearchAlgorithms, 1.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Antzy21.Games.SearchAlgorithms as a Cake Addin
#addin nuget:?package=Antzy21.Games.SearchAlgorithms&version=1.0.0

// Install Antzy21.Games.SearchAlgorithms as a Cake Tool
#tool nuget:?package=Antzy21.Games.SearchAlgorithms&version=1.0.0                

SearchAlgorithms

Generic implimentations of search algorithms to be used in other projects

Documentation

minMax
        (getNodesFromParent: 'Node -> ('Move * 'Node) list)
        (evaulationFunction: 'Move option -> 'Node -> 'EvalValue)
        (depth: int)
        (isMaxing: bool)
        (previousMove: 'Move option)
        (parentNode: 'Node)
        : 'Move option * 'EvalValue =
minMaxAbPruning
        (getNodesFromParent: 'Node -> ('Move * 'Node) list)
        (evaulationFunction: 'Move option -> 'Node -> 'EvalValue)
        (depth: int)
        (isMaxing: bool)
        (previousMove: 'Move option)
        (parentNode: 'Node)
        : 'Move option * 'EvalValue =

Both minMax and minMaxAbPruning take the same parameters.<br/> They will also both return the same result for given inputs.<br/> Alpha Beta pruning is likely to provide significant performance improvements.

Parameters:

  • getNodesFromParent<br/> This function takes in a node and returns a list of moves and nodes.<br/> Nodes might be GameStates and moves are how the new gameState arrose from the previous gameState.<br/> Multiple moves might be playable from a given gamestate, hence this function returns a list of moves and corresponding new gameStates.
  • evaluationFunction<br/> This function takes a move and node, and returns an evaluation.<br/> This will be a heurstical evaluation of a static gameState, but can also take into account the move being made, to enrich the heristic calculation.<br/> The move parameter must be optional, because there may not be a previous move, for example the start of a game.
  • depth<br/> How deep to perform the search
  • isMaxing<br/> Should the algorithm try to maximise the evaluation from the start?<br/> This is relevant to the evaluation function between two players.<br/> If it is player1's turn and the evaluation function is set to be larger if player1 is winning, then isMaxing should be true.
  • previousMove<br/> This is required in the event that the node has no children, and so is evaluated immediately.<br/> The evaluation takes in an option move, which is provided here.<br/> It is possible to default pass None here, but this may not evaluate the node correctly.
  • parentNode<br/> This is the current node, or gameState that is getting evaluated.
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 272 11/19/2023

Initial publication