# NOT RUN {
library(FuzzyR)
# Create the fsi_model:
fsi <- fsi_create("To visit or not to visit, that is the question",
default_conseq = genmf("trimf", c(10, 30, 60)))
# Create the vector with the linguistic values of the linguistic variable "visiting experience":
lvals_visiting_exp <- c("awful", "average", "great")
# Define the membership function for each linguistic value:
awful_mf <- genmf("trimf", c(0, 0, 20))
average_mf <- genmf("trimf", c(10, 30, 60))
great_mf <- genmf("trapmf", c(40, 80, 100, 100))
# Add the consequent to the FSI model:
fsi <- fsi_add_cs(fsi, "visiting experience", lvals_visiting_exp,
c(awful_mf, average_mf, great_mf), c(0, 100))
# }
Run the code above in your browser using DataLab