grail (C  1.0.0
A multi-platform, modular, universal engine for embedding advanced AI in games.
Grail.Simulation.DecisionTree Class Reference
Inheritance diagram for Grail.Simulation.DecisionTree:
Collaboration diagram for Grail.Simulation.DecisionTree:

Public Member Functions

 DecisionTree (in IVectorizer vectorizer)
 Constructs a new decision tree object. You have to specify a proper vectorizer object that will be used to calculate values used by considerations (conditions) for the nodes. More...
 
void Construct (Dataset< ISimulatedGameAction > dataset, int maxDepth=int.MaxValue)
 Runs the decision tree construction algorithm (C45). @dataset contains the training data. More...
 
ISimulatedGameAction GetAction ()
 Inherited via SimulatedGameHeuristic. More...
 
void Print ()
 Prints the decision tree in a very diagnostic fashion onto standard output (Console). More...
 
void SetColumnName (int columnIndex, string name)
 This will make the Print() function output the name instead of Column[columnIndex]. This name does not affect anything else.
 
void SetColumnNames (IEnumerable< string > consecutiveNames)
 This will make the Print() function output the names instead of Column[columnIndex]. This name does not affect anything else.
 
void Serialize (IDecisionTreeSerializer< ISimulatedGameAction > serializer)
 Serializes the content of the tree into the passed serializer object. More...
 
bool IsHeuristicSituation (in ISimulatedGameUnit unit)
 Inherited via SimulatedGameHeuristic.
 
void Deserialize (IDecisionTreeSerializer< ISimulatedGameAction > serializer)
 Inherited via SimulatedGameHeuristic.
 

Properties

IVectorizer Vectorizer [get, set]
 Gets or sets the IVectorizer object to a tree. It is used during the game to compute conditions for the GetAction() method to work. More...
 

Constructor & Destructor Documentation

◆ DecisionTree()

Grail.Simulation.DecisionTree.DecisionTree ( in IVectorizer  vectorizer)
inline

Constructs a new decision tree object. You have to specify a proper vectorizer object that will be used to calculate values used by considerations (conditions) for the nodes.

Parameters
vectorizer

Member Function Documentation

◆ Construct()

void Grail.Simulation.DecisionTree.Construct ( Dataset< ISimulatedGameAction dataset,
int  maxDepth = int.MaxValue 
)
inline

Runs the decision tree construction algorithm (C45). @dataset contains the training data.

Parameters
datasetObject that contains the training data.
maxDepthThe maximum number of nodes deep in the tree. Unless you are out of memory, it is advised to keep the depth relatively unlimited.

◆ GetAction()

ISimulatedGameAction Grail.Simulation.DecisionTree.GetAction ( )

Inherited via SimulatedGameHeuristic.

Implements Grail.Simulation.ISimulatedGameHeuristic.

◆ Print()

void Grail.Simulation.DecisionTree.Print ( )

Prints the decision tree in a very diagnostic fashion onto standard output (Console).

◆ Serialize()

void Grail.Simulation.DecisionTree.Serialize ( IDecisionTreeSerializer< ISimulatedGameAction serializer)
inline

Serializes the content of the tree into the passed serializer object.

<param name="serializer"

Property Documentation

◆ Vectorizer

IVectorizer Grail.Simulation.DecisionTree.Vectorizer
getset

Gets or sets the IVectorizer object to a tree. It is used during the game to compute conditions for the GetAction() method to work.


The documentation for this class was generated from the following file: