static_evaluator
= cluster is create, create_random, create_mutant, mate, evaluate, unparse, copy, equal, get_anticipation
- Overview
- static_evaluator is an immutable data type which is used by computer_player to determine an anti-chess strategy. The essential feature of the static_evaluator is that, given a chess_board, it can return a real number describing how "good" that board is for a player whose pieces are a given color. This number is only a heuristic result, but it can be used to build a more sophisticated algorithm.
- This data structure also contains operations to aid in a genetic-algorithm optimization of an anti-chess strategy, allowing static evaluators to be randomly generated and "mated".
- written by stevenj and twm
- create = proc(level: int) returns(cvt) signals(illegal_level)
- effects: returns a new static evaluator which plays with the skill indicated by level. Signals illegal level if level is not in the range [1, 7].
- create_random = proc() returns(cvt)
- effects: returns a new, (pseudo)random static evaluator
- create_mutant = proc(e: cvt) returns(cvt)
- effects: returns a new static_evaluator which has the same relative weights as e, except for one randomly picked weight, which has been reassigned randomly. When the weight representing the number of expected moves is mutated, all weights are normalized to one. Otherwise the wieght representing the number of expecte moves stays the same and all others are normalized so that they all sum to one.
- mate = proc(ev1,ev2: cvt) returns(cvt)
- effects: returns a new static evaluator which blends the behaviors of e1 and e2.
- evaluate = proc(ev: cvt, board: chess_board, color: pieceColor) returns(real)
- effects: Returns a real number which indicates how "good" the current board is for the player whose pieces are the color "color." Higher numbers are better. This is only a heuristic result and carries no guarantees.
- unparse = proc(ev: cvt)
- effects: unparses a static_evalutator and sends the results to primary_output. Written for debugging and evolutionary purposes only. This procedure should not be present in the final version
- copy = proc(original: cvt) returns(cvt)
- effects: Returns a copy of original.
- equal = proc(original, second: cvt) returns(bool)
- effects: returns whether original and second are equal.
- get_anticipation = proc(e1: cvt) returns (real)
- effects: Returns the number of moves that e1 expects to make during a game. This is obiviously not a guarantee (since it is real) and is only as good as the static_evalutor.