RuleManagement - Rule management

class RuleManagement(id) → RuleManagement

Creates a new, empty RuleManagement object.

The RuleManagement class takes care of loading and saving rules from arbitrary data sources. The base is an abstract class, which’s RuleManagement.load_rules() method must be implemented according to the specific needs of the application.

Attributes

RuleManagement.maxrules

Gets the maximum amount of rules to manage.

Methods

RuleManagement.load_rules(maxrules=-1) → [ Rule, Rule ... ]

Loads rules from the underlying data source and returns them as list. The maxrules argument defines the amount of rules to load. If it is smaller than 0, all existing rules should be returned.

This must be implemented by inheriting classes.

RuleManagement.save_rules(rules) → bool

Saves the passed rules to the underlying data source and returns True on success or False, if saving the rules was not possible.

This must be implemented by inheriting classes.

RuleManagement.save_rules_hint_file(filename, learnsystem) → None

Saves a LearnSystem/RuleSet combination to a physical file.

Table Of Contents

Previous topic

MMapRuleManagement - Memory-mapped rule management

Next topic

C API reference

This Page