Evaluator
Evaluator’s role is to provide a score deduced by considering data stored inside a Context.
Contexts can take form of any built-in or user-defined data type.
Most often AIControlledEntity
or pair of AIControlledEntity
and Blackboard
are passed as evaluator Context
-
weight - a measure of how suitable is evaluated object, considering current Context.
-
rank - evaluated object priority (the higher the rank, the bigger importance of evaluated object)
-
min
-
max
-
average
-
sum
-
product
IEvaluator<Context>
A template interface which allows the user to define their own method of calculating both rank and weight in terms of provided Context.
UtilityEvaluator<Context>
Grail’s standard evaluator. Requires user to provide evaluation method and list / vector of considerations paired with curves. This evaluator Context type should be the same as all of it’s considerations' Context's types.
Weight
To calculate weight, UtilityEvaluator
gathers all provided considerations and passes them through corresponding evaluation functions - usually curves.
-
min
-
max
-
average
-
sum
-
product
Example
-
entity’s health
-
distance from opponent
Assuming that both considerations have a rank of 0
.
Scores gotten from health and distance considerations are respectively equal 1
and 1.5
.
-
weight =
1.5
-
rank =
0
1
, we will indicate that evaluated object is more important and score values will change.-
weight =
1.5
-
rank =
1