Creates a new, empty CRuleSet.
CRuleSet is a rule container class that manages rules, their weights and the weight distribution for the rules. The minweight and maxweight parameters are the minimum and maximum weight boundaries, each rule’s weight has to stay in.
Gets or sets the maximum weight to use for rules.
Gets or sets the minimum weight to use for rules.
Calculates the reward or penalty, each of the activated rules recives. fitness hereby can be used as measure of the performance or whatever is suitable in the implementation.
This must be implemented by inheriting classes.
Distributes the remainder of the weight differences between the last weights and current weights.
The method must return a value. This must be implemented by inheriting classes.
Tries to find the CRule with the matching id and returns it. In case no CRule with the passed id exists, None is returned.
Updates the weights of all contained rules.
Adapted from Pieter Spronck’s algorithm as explained in Spronck et al: 2005, ‘Adaptive Game AI with Dynamic Scripting’.