Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

aiscore.h File Reference

Scorekeeper and Victory Condition Analysis for AIs. More...

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Classes

struct  AI_SKANode
 Storage space for a particular segment of AI analysis of a scorekeeper. More...

struct  AI_SKANode_UpropInt
 Storage space for uprop and side-utype table. More...

struct  AI_SKANode_TestOp
 Storage space for test operator. More...

struct  AI_SKAnalysis
 Storage space for AI analysis of a scorekeeper. More...


Defines

#define for_all_ai_sk_analyses(skanals, skanal)   for ((skanal) = (skanals); (skanal); (skanal) = (skanal)->next)
 Macro for iterating through scorekeeper analyses.

#define AI_SK_NONE   0
#define AI_SK_DONT_UNDERSTAND   0x1
#define AI_SK_DONT_TEST   0x2
#define AI_SK_LAST_SIDE   0x10
#define AI_SK_LAST_ALLIANCE   0x20
#define AI_SK_CHANGE_SCORE   0x40
#define AI_SKA_NONE   0
#define AI_SKA_CHANGE_SCORE   0x1
#define AI_SKA_WIN   0x2
#define AI_SKA_LOSE   0x4
#define AI_SKA_DRAW   0x8
#define AI_SKA_LAST_SIDE   0x10
#define AI_SKA_LAST_ALLIANCE   0x20
#define AI_SKT_NONE   0
#define AI_SKT_NOT   0x1
#define AI_SKT_AND   0x2
#define AI_SKT_OR   0x4
#define AI_SKT_EQ   0x8
#define AI_SKT_NE   0x10
#define AI_SKT_LE   0x20
#define AI_SKT_LT   0x40
#define AI_SKT_GE   0x80
#define AI_SKT_GT   0x100
#define AI_SKT_PLUS   0x200
#define AI_SKT_MINUS   0x400
#define AI_SKT_MULTIPLY   0x800
#define AI_SKT_DIVIDE   0x1000
#define AI_SKT_ARITH_COMPARISONS   (AI_SKT_EQ | AI_SKT_NE | AI_SKT_LE | AI_SKT_LT | AI_SKT_GE | AI_SKT_GT)
 All possible artithmetic comparisons in a scorekeeper test.

#define AI_SKT_ARITH_OPERATIONS   (AI_SKT_PLUS | AI_SKT_MINUS | AI_SKT_MULTIPLY | AI_SKT_DIVIDE)
 All possible artithmetic operations in a scorekeeper test.


Enumerations

enum  AI_SKANKind { AI_SKAN_NONE = 0, AI_SKAN_UPROPI, AI_SKAN_TESTOP }
 Kinds of AI scorekeeper analysis nodes. More...


Functions

AI_SKAnalysisanalyze_sk_sum_uprop_test (Side *side, Scorekeeper *sk, Obj *sktest, AI_SKAnalysis *parent)
 Analyze a scorekeeper 'sum-uprop' form.

AI_SKAnalysisanalyze_sk_turn_test (Side *side, Scorekeeper *sk, Obj *sktest, AI_SKAnalysis *parent)
 Analyze a scorekeeper 'turn' keyword.

AI_SKAnalysisanalyze_sk_score_test (Side *side, Scorekeeper *sk, Obj *sktest, AI_SKAnalysis *parent)
 Analyze a scorekeeper 'score' keyword/form.

AI_SKAnalysisanalyze_sk_arith_op_test (Side *side, Scorekeeper *sk, Obj *sktest, AI_SKAnalysis *parent)
 Analyze a scorekeeper arithmetic operation form.

AI_SKAnalysisanalyze_sk_arith_gt_test (Side *side, Scorekeeper *sk, Obj *sktest, AI_SKAnalysis *parent)
 Analyze a scorekeeper arithmetic '>' form.

AI_SKAnalysisanalyze_sk_arith_ge_test (Side *side, Scorekeeper *sk, Obj *sktest, AI_SKAnalysis *parent)
 Analyze a scorekeeper arithmetic '>=' form.

AI_SKAnalysisanalyze_sk_arith_lt_test (Side *side, Scorekeeper *sk, Obj *sktest, AI_SKAnalysis *parent)
 Analyze a scorekeeper arithmetic '<' form.

AI_SKAnalysisanalyze_sk_arith_le_test (Side *side, Scorekeeper *sk, Obj *sktest, AI_SKAnalysis *parent)
 Analyze a scorekeeper arithmetic '<=' form.

AI_SKAnalysisanalyze_sk_arith_ne_test (Side *side, Scorekeeper *sk, Obj *sktest, AI_SKAnalysis *parent)
 Analyze a scorekeeper arithmetic '/=' form.

AI_SKAnalysisanalyze_sk_arith_eq_test (Side *side, Scorekeeper *sk, Obj *sktest, AI_SKAnalysis *parent)
 Analyze a scorekeeper arithmetic '=' form.

AI_SKAnalysisanalyze_sk_arith_comp_test (Side *side, Scorekeeper *sk, Obj *sktest, AI_SKAnalysis *parent)
 Analyze a scorekeeper arithmetic comparison form.

AI_SKAnalysisanalyze_sk_bool_or_test (Side *side, Scorekeeper *sk, Obj *sktest, AI_SKAnalysis *parent)
 Analyze a scorekeeper boolean 'or' form.

AI_SKAnalysisanalyze_sk_bool_and_test (Side *side, Scorekeeper *sk, Obj *sktest, AI_SKAnalysis *parent)
 Analyze a scorekeeper boolean 'and' form.

AI_SKAnalysisanalyze_sk_bool_comp_test (Side *side, Scorekeeper *sk, Obj *sktest, AI_SKAnalysis *parent)
 Analyze a scorekeeper boolean comparison form.

AI_SKAnalysisanalyze_sk_when_test (Side *side, Scorekeeper *sk, Obj *sktest, AI_SKAnalysis *parent)
 Analyze a scorekeeper 'when' form.

AI_SKAnalysisanalyze_sk_always_true_test (Side *side, Scorekeeper *sk, Obj *sktest, AI_SKAnalysis *parent)
 Analyze a scorekeeper test form that is always true.

AI_SKAnalysisanalyze_sk_test (Side *side, Scorekeeper *sk, Obj *sktest, AI_SKAnalysis *parent)
 Analyze a scorekeeper test form.

AI_SKAnalysisanalyze_sk_if_action (Side *side, Scorekeeper *sk, Obj *skact, AI_SKAnalysis *parent)
 Analyze a scorekeeper 'if' form.

AI_SKAnalysisanalyze_sk_action (Side *side, Scorekeeper *sk, Obj *skact, AI_SKAnalysis *parent)
 Analyze a scorekeeper action form.

AI_SKAnalysisanalyze_scorekeeper (Side *side, Scorekeeper *sk)
 Analyze a scorekeeper.

AI_SKAnalysisanalyze_scorekeepers (Side *side)
 Analyze all the scorekeepers.


Detailed Description

Scorekeeper and Victory Condition Analysis for AIs.

Part of the AI API, Level 1. Provides useful functions that an AI implementation may use to analyze scorekeepers. Nothing in this file should ever be required to implement an AI; everything here is optional.

Todo:
Add analysis of scorekeeper trigger.

Define Documentation

#define AI_SK_CHANGE_SCORE   0x40
 

#define AI_SK_DONT_TEST   0x2
 

#define AI_SK_DONT_UNDERSTAND   0x1
 

#define AI_SK_LAST_ALLIANCE   0x20
 

#define AI_SK_LAST_SIDE   0x10
 

#define AI_SK_NONE   0
 

#define AI_SKA_CHANGE_SCORE   0x1
 

#define AI_SKA_DRAW   0x8
 

#define AI_SKA_LAST_ALLIANCE   0x20
 

#define AI_SKA_LAST_SIDE   0x10
 

#define AI_SKA_LOSE   0x4
 

#define AI_SKA_NONE   0
 

#define AI_SKA_WIN   0x2
 

#define AI_SKT_AND   0x2
 

#define AI_SKT_ARITH_COMPARISONS   (AI_SKT_EQ | AI_SKT_NE | AI_SKT_LE | AI_SKT_LT | AI_SKT_GE | AI_SKT_GT)
 

All possible artithmetic comparisons in a scorekeeper test.

#define AI_SKT_ARITH_OPERATIONS   (AI_SKT_PLUS | AI_SKT_MINUS | AI_SKT_MULTIPLY | AI_SKT_DIVIDE)
 

All possible artithmetic operations in a scorekeeper test.

#define AI_SKT_DIVIDE   0x1000
 

#define AI_SKT_EQ   0x8
 

#define AI_SKT_GE   0x80
 

#define AI_SKT_GT   0x100
 

#define AI_SKT_LE   0x20
 

#define AI_SKT_LT   0x40
 

#define AI_SKT_MINUS   0x400
 

#define AI_SKT_MULTIPLY   0x800
 

#define AI_SKT_NE   0x10
 

#define AI_SKT_NONE   0
 

#define AI_SKT_NOT   0x1
 

#define AI_SKT_OR   0x4
 

#define AI_SKT_PLUS   0x200
 

#define for_all_ai_sk_analyses skanals,
skanal   )     for ((skanal) = (skanals); (skanal); (skanal) = (skanal)->next)
 

Macro for iterating through scorekeeper analyses.


Enumeration Type Documentation

enum AI_SKANKind
 

Kinds of AI scorekeeper analysis nodes.

Enumeration values:
AI_SKAN_NONE 
AI_SKAN_UPROPI 
AI_SKAN_TESTOP 


Function Documentation

AI_SKAnalysis* analyze_scorekeeper Side side,
Scorekeeper sk
 

Analyze a scorekeeper.

Returns:
List of 1 or more scorekeeper analyses, if successful.
Todo:
Do compaction on resulting analyses.

AI_SKAnalysis* analyze_scorekeepers Side side  ) 
 

Analyze all the scorekeepers.

Todo:
Perform compaction and summarization of analyses.

AI_SKAnalysis* analyze_sk_action Side side,
Scorekeeper sk,
Obj skact,
AI_SKAnalysis parent
 

Analyze a scorekeeper action form.

Todo:
Analyze 'cond' forms.

Support 'trigger' tests.

AI_SKAnalysis* analyze_sk_always_true_test Side side,
Scorekeeper sk,
Obj sktest,
AI_SKAnalysis parent
 

Analyze a scorekeeper test form that is always true.

AI_SKAnalysis* analyze_sk_arith_comp_test Side side,
Scorekeeper sk,
Obj sktest,
AI_SKAnalysis parent
 

Analyze a scorekeeper arithmetic comparison form.

AI_SKAnalysis* analyze_sk_arith_eq_test Side side,
Scorekeeper sk,
Obj sktest,
AI_SKAnalysis parent
 

Analyze a scorekeeper arithmetic '=' form.

AI_SKAnalysis* analyze_sk_arith_ge_test Side side,
Scorekeeper sk,
Obj sktest,
AI_SKAnalysis parent
 

Analyze a scorekeeper arithmetic '>=' form.

AI_SKAnalysis* analyze_sk_arith_gt_test Side side,
Scorekeeper sk,
Obj sktest,
AI_SKAnalysis parent
 

Analyze a scorekeeper arithmetic '>' form.

AI_SKAnalysis* analyze_sk_arith_le_test Side side,
Scorekeeper sk,
Obj sktest,
AI_SKAnalysis parent
 

Analyze a scorekeeper arithmetic '<=' form.

AI_SKAnalysis* analyze_sk_arith_lt_test Side side,
Scorekeeper sk,
Obj sktest,
AI_SKAnalysis parent
 

Analyze a scorekeeper arithmetic '<' form.

AI_SKAnalysis* analyze_sk_arith_ne_test Side side,
Scorekeeper sk,
Obj sktest,
AI_SKAnalysis parent
 

Analyze a scorekeeper arithmetic '/=' form.

AI_SKAnalysis* analyze_sk_arith_op_test Side side,
Scorekeeper sk,
Obj sktest,
AI_SKAnalysis parent
 

Analyze a scorekeeper arithmetic operation form.

Note:
Mostly just let things fall through here for now.

AI_SKAnalysis* analyze_sk_bool_and_test Side side,
Scorekeeper sk,
Obj sktest,
AI_SKAnalysis parent
 

Analyze a scorekeeper boolean 'and' form.

AI_SKAnalysis* analyze_sk_bool_comp_test Side side,
Scorekeeper sk,
Obj sktest,
AI_SKAnalysis parent
 

Analyze a scorekeeper boolean comparison form.

AI_SKAnalysis* analyze_sk_bool_or_test Side side,
Scorekeeper sk,
Obj sktest,
AI_SKAnalysis parent
 

Analyze a scorekeeper boolean 'or' form.

AI_SKAnalysis* analyze_sk_if_action Side side,
Scorekeeper sk,
Obj skact,
AI_SKAnalysis parent
 

Analyze a scorekeeper 'if' form.

AI_SKAnalysis* analyze_sk_score_test Side side,
Scorekeeper sk,
Obj sktest,
AI_SKAnalysis parent
 

Analyze a scorekeeper 'score' keyword/form.

AI_SKAnalysis* analyze_sk_sum_uprop_test Side side,
Scorekeeper sk,
Obj sktest,
AI_SKAnalysis parent
 

Analyze a scorekeeper 'sum-uprop' form.

Todo:
Handle GDL memory leak involving uprop name.

AI_SKAnalysis* analyze_sk_test Side side,
Scorekeeper sk,
Obj sktest,
AI_SKAnalysis parent
 

Analyze a scorekeeper test form.

Todo:
Handle 'append', 'remove', and 'remove-list'.

AI_SKAnalysis* analyze_sk_turn_test Side side,
Scorekeeper sk,
Obj sktest,
AI_SKAnalysis parent
 

Analyze a scorekeeper 'turn' keyword.

AI_SKAnalysis* analyze_sk_when_test Side side,
Scorekeeper sk,
Obj sktest,
AI_SKAnalysis parent
 

Analyze a scorekeeper 'when' form.

Todo:
Implement.


Generated on Sat Sep 17 10:28:57 2005 for XconqKernel by doxygen 1.3.6