# ComplexCondition: R6 class representing a complex condition. In jaspeir/NIJ_Tabitha: Dominance-based Rough Set Approach and the DOMLEM Algorithm

## Description

A complex condition is made up of multiple elementary conditions by forming their conjunction.

## Details

A complex condition is the conjunction of elementary conditions.

## Public fields

`conditions`

the set elementary conditions

## Methods

#### Method `new()`

Create a new ComplexCondition object.

##### Usage
`ComplexCondition\$new(conditions)`
##### Arguments
`conditions`

the set of elementary conditions

#### Method `complexCover()`

Method to calculate the set of objects matching this complex condition.

##### Usage
`ComplexCondition\$complexCover(it)`
##### Arguments
`it`

the information table to use

##### Returns

the set of matching objects - set of object names

#### Method `firstMetric()`

Method for calculating the first comparison metric used in the DOMLEM paper.

##### Usage
`ComplexCondition\$firstMetric(G, it)`
##### Arguments
`G`

the parameter of the metric - a vector describing a set of objects

`it`

the information table to use

##### Returns

a numeric metric between 0 and 1. Higher is better.

#### Method `secondMetric()`

Method for calculating the second comparison metric used in the DOMLEM paper.

##### Usage
`ComplexCondition\$secondMetric(G, it)`
##### Arguments
`G`

the parameter of the metric - a vector describing a set of objects

`it`

the information table to use

##### Returns

a non-negative integer metric. Higher is better.

#### Method `allMetrics()`

Method for calculating all comparison metrics used in the DOMLEM paper.

##### Usage
`ComplexCondition\$allMetrics(G, it)`
##### Arguments
`G`

the parameter of the metrics - a vector describing a set of objects

`it`

the information table to use

##### Returns

a list of metrics. Higher is better.

#### Method `findBestElementary()`

Method to evaluate if an elementary condition is better than the current best.

##### Usage
`ComplexCondition\$findBestElementary(G, it, check, best)`
##### Arguments
`G`

the parameter of the metric - a vector describing a set of objects

`it`

the information table to use

`check`

the elementary condition to evaluate

`best`

the current best elementary

##### Returns

the better of the two elementary conditions

#### Method `reduceConditions()`

Method that tries to make a complex condition shorter. For each elementary condition e in E, check if [E - e] subset or equal B then E := E - e.

##### Usage
`ComplexCondition\$reduceConditions(B, it)`
##### Arguments
`B`

the objects to cover - set of object names

`it`

the information table to use

##### Returns

a complex condition

#### Method `getConstants()`

Method for creating an efficient representation of the constants used in the filter conditions.

##### Usage
`ComplexCondition\$getConstants(it)`
##### Arguments
`it`

the information table to use

##### Returns

a vector of filter values. Not filtered attributes have an NA value.

#### Method `getConstantsGrouped()`

Method for creating an efficient representation of the constants used in the filter conditions, grouped by the type of variable and condition.

##### Usage
`ComplexCondition\$getConstantsGrouped(it)`
##### Arguments
`it`

the information table to use

##### Returns

a list of vector of filter values, one list for the following operator groups: (= or ~). (>=), and (<=). Not filtered attributes have an NA value.

#### Method `contains()`

Method for deciding whether a provided elementary condition is part of this complex condition.

##### Usage
`ComplexCondition\$contains(elem)`
##### Arguments
`elem`

the elementary condition to check

a boolean value

#### Method `append()`

Method for appending an additional elementary condition to the current conditions.

##### Usage
`ComplexCondition\$append(elem)`
##### Arguments
`elem`

the elementary condition to be added

#### Method `length()`

Method that returns the number of elementary conditions in this complex condition.

##### Usage
`ComplexCondition\$length()`

#### Method `print()`

print method.

##### Usage
`ComplexCondition\$print()`

#### Method `toString()`

toString method.

##### Usage
`ComplexCondition\$toString()`

#### Method `equals()`

Method to compare two ComplexConditions.

##### Usage
`ComplexCondition\$equals(other)`
##### Arguments
`other`

the other complex condition to compare to

##### Returns

a single boolean value

#### Method `clone()`

The objects of this class are cloneable with this method.

##### Usage
`ComplexCondition\$clone(deep = FALSE)`
##### Arguments
`deep`

Whether to make a deep clone.

jaspeir/NIJ_Tabitha documentation built on June 3, 2020, 12:38 a.m.