MMapRuleManagement - Memory-mapped rule management

class MMapRuleManagement(maxrules) → MMapRuleManagement

Creates a new MMapRuleManagement instance.

A simple memory-mapped RuleManagement implementation that does not load its rules from an external data source.

It is an extremely useful class for testing rules and basic algorithms, but due to the in-memory management of all rules, it should not be used in a productive environment, especially if large rule sets have to be managed.

By default, the MMapRuleManagement class will reserve enough memory for the rules to manage, when it is constructed. It will not fill the rules with useful values though. It is up to caller to use MMapRuleManagement.load_rules() afterwards and fill the returned Rule instances with the necessary data.

Attributes

MMapRuleManagement.maxrules

Gets the maximum amount of rules to manage.

Methods

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

Returns the internally managed rules or a certain subset.

MMapRuleManagement.save_rules(rules) → bool

This does nothing and will always return True.

MMapRuleManagement.save_rules_hint_file(filename, learnsystem) → None

Saves a LearnSystem/RuleSet combination to a physical file.

Table Of Contents

Previous topic

LearnSystem - Rule script generation

Next topic

RuleManagement - Rule management

This Page