Learn R Programming

rorutadis (version 0.4.2)

getPreferentialCore: Identify preferential core

Description

This function identifies preferential core.

Usage

getPreferentialCore(preferentialReducts)

Arguments

preferentialReducts
List of all preferential reducts (a result of explainAssignment).

Value

Preferential core as a vector of restriction indices. To find out about restrictions by their indices use getRestrictions.

See Also

explainAssignment getRestrictions

Examples

Run this code
perf <- matrix(c(5, 2, 1, 7, 0.5, 0.9, 0.4, 0.5), ncol = 2)
problem <- buildProblem(perf, 3, FALSE, c('g', 'g'), c(0, 0))
problem <- addAssignmentsLB(problem, c(1, 2), c(2, 3))

possibleAssignments <- calculateAssignments(problem, FALSE)
alternative <- 4
assignment <- c(min(which(possibleAssignments[alternative, ])),
               max(which(possibleAssignments[alternative, ])))

preferentialReducts <- explainAssignment(alternative,
   assignment, problem)
preferentialCore <- getPreferentialCore(preferentialReducts)
coreRestrictions <- getRestrictions(problem, preferentialCore)

Run the code above in your browser using DataLab