Class DimlpRule

Nested Relationships

Nested Types

Inheritance Relationships

Derived Type

Class Documentation

class DimlpRule

The DimlpRule class represents a rule with antecedents used in the Dimlp algorithm.

This class allows the creation, manipulation, and traversal of a rule’s antecedents. An antecedent consists of a variable, a value, and a relational operator.

Subclassed by Ante

Public Functions

inline int GetNbAnt() const

Get the number of antecedents.

Returns:

The number of antecedents.

inline void GoToBeg()

Set the traversal pointer to the beginning of the antecedent list.

inline void GoToNext()

Move the traversal pointer to the next antecedent.

inline int GetVar() const

Get the variable of the current antecedent.

Returns:

The variable index.

inline float GetVal() const

Get the value of the current antecedent.

Returns:

The threshold value.

inline char GetRel() const

Get the relational operator of the current antecedent.

Returns:

The relational operator.

inline void RemAnt() const

Mark the current antecedent as removed.

inline void SetAnt(int var) const

Set the variable of the current antecedent.

Parameters:

var – The variable index.

inline void SetThres(float val) const

Set the value of the current antecedent.

Parameters:

val – The threshold value.

inline int IsAntDeleted() const

Check if the current antecedent is marked as removed.

Returns:

1 if the antecedent is removed, otherwise 0.

inline void SavePtrAnt()

Save the current traversal pointer.

inline void PrevPtrAnt()

Restore the traversal pointer to the saved position.

int GetNbAntWithout()

Get the number of non-deleted antecedents in the rule.

Returns:

The number of non-deleted antecedents.

void DeleteRule()

Mark all antecedents in the rule as removed.

void Insert(int var, float val, char rel)

Insert a new antecedent into the rule.

Parameters:
  • var – The variable index.

  • val – The threshold value.

  • rel – The relational operator.

DimlpRule *Copy(std::shared_ptr<DimlpRule> r)

Create a copy of the rule.

Parameters:

r – Pointer to the rule to copy.

Returns:

A pointer to the copied rule.

inline void Del()

Delete all antecedents in the rule.

DimlpRule() = default

Default constructor for the DimlpRule class.