setwd("/home/rado/desktop/R")
source("/home/rado/desktop/R/vyvodzovaci_mechanizmus.R")
## zakladny scenar
#koncepty_slovne <- list( "K1" = "SN", "K2" = "N", "K3" = "V", "K4" = "N", "K5" = "N", K6 = "V", K7 = "MV")
## Vysoke financne zdroje a technologia
#koncepty_slovne <- list( "K1" = "N", "K2" = "N", "K3" = "V", "K4" = "N", "K5" = "N", K6 = "V", K7 = "N")
#koncepty_slovne <- list( "K1" = "SN", "K2" = "SN", "K3" = "V", "K4" = "SN", "K5" = "N", K6 = "V", K7 = "SN")
koncepty_slovne <- list( "K1" = "MV", "K2" = "N", "K3" = "V", "K4" = "N", "K5" = "N", K6 = "V", K7 = "MV")
## Vela atraktivneho obsahu, dobra technologia a mierne zdroje
#koncepty_slovne <- list( "K1" = "V", "K2" = "N", "K3" = "SV", "K4" = "SN", "K5" = "N", K6 = "M", K7 = "SN")
simuluj( koncepty_slovne, 50 )
#setwd("/home/rado/desktop/R")
source("/home/rado/desktop/R/vyvodzovaci_mechanizmus.R")
getwd()
setwd("~/")
getwd()
#setwd("/home/rado/desktop/R")
setwd("~/")
source("~//home/rado/desktop/R/vyvodzovaci_mechanizmus.R")
source("~/desktop/R/vyvodzovaci_mechanizmus.R")
#setwd("/home/rado/desktop/R")
setwd("~/")
getwd()
#setwd("/home/rado/desktop/R")
setwd("~/desktop")
#install.packages("fcm")
library(fcm)
#pociatocne_stavy.vec <- data.frame(0.875,  0.875,  0.875,  0.875,  0.125, 0.875, 0.875, 0.875)
pociatocne_stavy.vec <- data.frame(0.125,  0.125,  0.875,  0.125,  0.125, 1, 0.125, 0.125)
## katastroficky scenar
pociatocne_stavy.vec <- data.frame(0.125,  0.125,  0.125,  0,  0.625, 0, 0, 0.125)
colnames(pociatocne_stavy.vec) <- c("K1", "K2", "K3", "K4", "K5", "K6", "K7", "K8")
K1 = c(0.0, 0.5, 0.0, 0.75, 0.0, 0.0, 0.0, 0.0)
K2 = c(0.0, 0.0, 0.0, 0.375, 0.0, 0.0, 0.0, 0.0)
K3 = c(0.0, 0.0, 0.0, 0.375, 0.0, 0.0, 0.0, 0.0)
K4 = c(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75, 0.0)
K5 = c(0.0, -0.75, 0.0, -0.375, 0.0, 0.0, 0.0, 0.0)
K6 = c(0.625, 0.125, 0.125, 0.0, -0.625, 0.0, 0.0, 0.0)
K7 = c(0.0, -0.5, 0.0, -0.125, 0.0, 0,0, 0.0, 0.875)
K8 = c(0.0, 0.0, 0.0, 0.0, 0.0, 0.625, 0.0, 0.0)
zavislosti <- matrix(c(K1, K2, K3, K4, K5, K6, K7, K8), nrow =8, ncol=8, byrow=TRUE)
zavislosti <- as.data.frame(zavislosti)
colnames(zavislosti) <- c("K1", "K2", "K3", "K4", "K5", "K6", "K7", "K8")
ustaleny_stav <- fcm.infer(pociatocne_stavy.vec, zavislosti, 15, "mk", "s", lambda = 1.5, e = 0.00001)
#install.packages("fcm")
library(fcm)
#pociatocne_stavy.vec <- data.frame(0.875,  0.875,  0.875,  0.875,  0.125, 0.875, 0.875, 0.875)
pociatocne_stavy.vec <- data.frame(0.125,  0.125,  0.875,  0.125,  0.125, 1, 0.125, 0.125)
## katastroficky scenar
pociatocne_stavy.vec <- data.frame(0.125,  0.125,  0.125,  0,  0.625, 0, 0, 0.125)
colnames(pociatocne_stavy.vec) <- c("K1", "K2", "K3", "K4", "K5", "K6", "K7", "K8")
K1 = c(0.0, 0.5, 0.0, 0.75, 0.0, 0.0, 0.0, 0.0)
K2 = c(0.0, 0.0, 0.0, 0.375, 0.0, 0.0, 0.0, 0.0)
K3 = c(0.0, 0.0, 0.0, 0.375, 0.0, 0.0, 0.0, 0.0)
K4 = c(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75, 0.0)
K5 = c(0.0, -0.75, 0.0, -0.375, 0.0, 0.0, 0.0, 0.0)
K6 = c(0.625, 0.125, 0.125, 0.0, -0.625, 0.0, 0.0, 0.0)
K7 = c(0.0, -0.5, 0.0, -0.125, 0.0, 0,0, 0.0, 0.875)
K8 = c(0.0, 0.0, 0.0, 0.0, 0.0, 0.625, 0.0, 0.0)
zavislosti <- matrix(c(K1, K2, K3, K4, K5, K6, K7, K8), nrow =8, ncol=8, byrow=TRUE)
zavislosti <- as.data.frame(zavislosti)
colnames(zavislosti) <- c("K1", "K2", "K3", "K4", "K5", "K6", "K7", "K8")
ustaleny_stav <- fcm.infer(pociatocne_stavy.vec, zavislosti, 50, "mk", "s", lambda = 1.5, e = 0.00001)
#install.packages("fcm")
library(fcm)
#install.packages("fcm")
library(fcm)
## I. Zacinajuci portal - (V)ysoka uroven investicii, ostatne (N)izke
#pociatocne_stavy.vec <- data.frame(0.125,  0.125,  0.125,  0.125,  0.125, 0.875, 0.125, 0.125)
## II. Zacinajuci portal - (V)ysoka uroven atraktivneho obsahu, reputacie a technologie
pociatocne_stavy.vec <- data.frame(0.875,  0.875,  0.125,  0.5,  0.125, 0.125, 0.125, 0.125)
## III. Rozbehnuty portal - kontroverzny
#pociatocne_stavy.vec <- data.frame(0.232,  0.125,  0.125,  0.248,  0.9, 0.25, 0.833, 0.125)
#pociatocne_stavy.vec <- data.frame(0.875,  0.875,  0.875,  0.875,  0.875, 0.875, 0.875, 0.875)
colnames(pociatocne_stavy.vec) <- c("K1", "K2", "K3", "K4", "K5", "K6", "K7", "K8")
K1 = c(0.0, 0.5, 0.0, 0.75, 0.0, 0.0, 0.0, 0.0)
K2 = c(0.0, 0.0, 0.0, 0.375, 0.0, 0.0, 0.0, 0.0)
K3 = c(0.0, 0.0, 0.0, 0.375, 0.0, 0.0, 0.0, 0.0)
K4 = c(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75, 0.0)
K5 = c(0.0, -0.75, 0.0, -0.375, 0.0, 0.0, 0.0, 0.0)
K6 = c(0.625, 0.125, 0.125, 0.0, -0.625, 0.0, 0.0, 0.0)
K7 = c(0.0, -0.5, 0.0, -0.125, 0.0, 0,0, 0.0, 0.875)
K8 = c(0.0, 0.0, 0.0, 0.0, 0.0, 0.625, 0.0, 0.0)
zavislosti <- matrix(c(K1, K2, K3, K4, K5, K6, K7, K8), nrow =8, ncol=8, byrow=TRUE)
zavislosti <- as.data.frame(zavislosti)
colnames(zavislosti) <- c("K1", "K2", "K3", "K4", "K5", "K6", "K7", "K8")
ustaleny_stav <- fcm.infer(pociatocne_stavy.vec, zavislosti, 20, "mk", "s", lambda = 3, e = 0.01)
ustaleny_stav$values
library (reshape2)
library (ggplot2)
iterations <- as.numeric(rownames(ustaleny_stav$values))  # vytvorí vektor s císlami
df <- data.frame(iterations, ustaleny_stav$values)   # add "iterations" in the "output1$values" dataframe
df2 <- melt(df, id="iterations")              # transform the dataframe df into long formats
ggplot(data=df2,                              # Visualize the concepts' values
aes(x=iterations, y=value, group=variable, colour=variable)) +
theme_bw() + geom_line(size=0.7) + geom_point(size = 3)
#install.packages("fcm")
library(fcm)
## I. Zacinajuci portal - (V)ysoka uroven investicii, ostatne (N)izke
#pociatocne_stavy.vec <- data.frame(0.125,  0.125,  0.125,  0.125,  0.125, 0.875, 0.125, 0.125)
## II. Zacinajuci portal - (V)ysoka uroven atraktivneho obsahu, reputacie a technologie
#pociatocne_stavy.vec <- data.frame(0.875,  0.875,  0.125,  0.5,  0.125, 0.125, 0.125, 0.125)
## III. Rozbehnuty portal - kontroverzny
pociatocne_stavy.vec <- data.frame(0.232,  0.125,  0.125,  0.248,  0.9, 0.25, 0.833, 0.125)
#pociatocne_stavy.vec <- data.frame(0.875,  0.875,  0.875,  0.875,  0.875, 0.875, 0.875, 0.875)
colnames(pociatocne_stavy.vec) <- c("K1", "K2", "K3", "K4", "K5", "K6", "K7", "K8")
K1 = c(0.0, 0.5, 0.0, 0.75, 0.0, 0.0, 0.0, 0.0)
K2 = c(0.0, 0.0, 0.0, 0.375, 0.0, 0.0, 0.0, 0.0)
K3 = c(0.0, 0.0, 0.0, 0.375, 0.0, 0.0, 0.0, 0.0)
K4 = c(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75, 0.0)
K5 = c(0.0, -0.75, 0.0, -0.375, 0.0, 0.0, 0.0, 0.0)
K6 = c(0.625, 0.125, 0.125, 0.0, -0.625, 0.0, 0.0, 0.0)
K7 = c(0.0, -0.5, 0.0, -0.125, 0.0, 0,0, 0.0, 0.875)
K8 = c(0.0, 0.0, 0.0, 0.0, 0.0, 0.625, 0.0, 0.0)
zavislosti <- matrix(c(K1, K2, K3, K4, K5, K6, K7, K8), nrow =8, ncol=8, byrow=TRUE)
zavislosti <- as.data.frame(zavislosti)
colnames(zavislosti) <- c("K1", "K2", "K3", "K4", "K5", "K6", "K7", "K8")
ustaleny_stav <- fcm.infer(pociatocne_stavy.vec, zavislosti, 20, "mk", "s", lambda = 3, e = 0.01)
ustaleny_stav$values
library (reshape2)
library (ggplot2)
iterations <- as.numeric(rownames(ustaleny_stav$values))  # vytvorí vektor s císlami
df <- data.frame(iterations, ustaleny_stav$values)   # add "iterations" in the "output1$values" dataframe
df2 <- melt(df, id="iterations")              # transform the dataframe df into long formats
ggplot(data=df2,                              # Visualize the concepts' values
aes(x=iterations, y=value, group=variable, colour=variable)) +
theme_bw() + geom_line(size=0.7) + geom_point(size = 3)
#install.packages("fcm")
library(fcm)
## I. Zacinajuci portal - (V)ysoka uroven investicii, ostatne (N)izke
#pociatocne_stavy.vec <- data.frame(0.125,  0.125,  0.125,  0.125,  0.125, 0.875, 0.125, 0.125)
## II. Zacinajuci portal - (V)ysoka uroven atraktivneho obsahu, reputacie a technologie
pociatocne_stavy.vec <- data.frame(0.875,  0.875,  0.125,  0.5,  0.125, 0.125, 0.125, 0.125)
## III. Rozbehnuty portal - kontroverzny
#pociatocne_stavy.vec <- data.frame(0.232,  0.125,  0.125,  0.248,  0.9, 0.25, 0.833, 0.125)
#pociatocne_stavy.vec <- data.frame(0.875,  0.875,  0.875,  0.875,  0.875, 0.875, 0.875, 0.875)
colnames(pociatocne_stavy.vec) <- c("K1", "K2", "K3", "K4", "K5", "K6", "K7", "K8")
K1 = c(0.0, 0.5, 0.0, 0.75, 0.0, 0.0, 0.0, 0.0)
K2 = c(0.0, 0.0, 0.0, 0.375, 0.0, 0.0, 0.0, 0.0)
K3 = c(0.0, 0.0, 0.0, 0.375, 0.0, 0.0, 0.0, 0.0)
K4 = c(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75, 0.0)
K5 = c(0.0, -0.75, 0.0, -0.375, 0.0, 0.0, 0.0, 0.0)
K6 = c(0.625, 0.125, 0.125, 0.0, -0.625, 0.0, 0.0, 0.0)
K7 = c(0.0, -0.5, 0.0, -0.125, 0.0, 0,0, 0.0, 0.875)
K8 = c(0.0, 0.0, 0.0, 0.0, 0.0, 0.625, 0.0, 0.0)
zavislosti <- matrix(c(K1, K2, K3, K4, K5, K6, K7, K8), nrow =8, ncol=8, byrow=TRUE)
zavislosti <- as.data.frame(zavislosti)
colnames(zavislosti) <- c("K1", "K2", "K3", "K4", "K5", "K6", "K7", "K8")
ustaleny_stav <- fcm.infer(pociatocne_stavy.vec, zavislosti, 20, "mk", "s", lambda = 3, e = 0.01)
ustaleny_stav$values
library (reshape2)
library (ggplot2)
iterations <- as.numeric(rownames(ustaleny_stav$values))  # vytvorí vektor s císlami
df <- data.frame(iterations, ustaleny_stav$values)   # add "iterations" in the "output1$values" dataframe
df2 <- melt(df, id="iterations")              # transform the dataframe df into long formats
ggplot(data=df2,                              # Visualize the concepts' values
aes(x=iterations, y=value, group=variable, colour=variable)) +
theme_bw() + geom_line(size=0.7) + geom_point(size = 3)
#install.packages("fcm")
library(fcm)
## I. Zacinajuci portal - (V)ysoka uroven investicii, ostatne (N)izke
#pociatocne_stavy.vec <- data.frame(0.125,  0.125,  0.125,  0.125,  0.125, 0.875, 0.125, 0.125)
## II. Zacinajuci portal - (V)ysoka uroven atraktivneho obsahu, reputacie a technologie
#pociatocne_stavy.vec <- data.frame(0.875,  0.875,  0.125,  0.5,  0.125, 0.125, 0.125, 0.125)
## III. Rozbehnuty portal - kontroverzny
#pociatocne_stavy.vec <- data.frame(0.232,  0.125,  0.125,  0.248,  0.9, 0.25, 0.833, 0.125)
pociatocne_stavy.vec <- data.frame(0.875,  0.875,  0.875,  0.875,  0.875, 0.875, 0.875, 0.875)
colnames(pociatocne_stavy.vec) <- c("K1", "K2", "K3", "K4", "K5", "K6", "K7", "K8")
K1 = c(0.0, 0.5, 0.0, 0.75, 0.0, 0.0, 0.0, 0.0)
K2 = c(0.0, 0.0, 0.0, 0.375, 0.0, 0.0, 0.0, 0.0)
K3 = c(0.0, 0.0, 0.0, 0.375, 0.0, 0.0, 0.0, 0.0)
K4 = c(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75, 0.0)
K5 = c(0.0, -0.75, 0.0, -0.375, 0.0, 0.0, 0.0, 0.0)
K6 = c(0.625, 0.125, 0.125, 0.0, -0.625, 0.0, 0.0, 0.0)
K7 = c(0.0, -0.5, 0.0, -0.125, 0.0, 0,0, 0.0, 0.875)
K8 = c(0.0, 0.0, 0.0, 0.0, 0.0, 0.625, 0.0, 0.0)
zavislosti <- matrix(c(K1, K2, K3, K4, K5, K6, K7, K8), nrow =8, ncol=8, byrow=TRUE)
zavislosti <- as.data.frame(zavislosti)
colnames(zavislosti) <- c("K1", "K2", "K3", "K4", "K5", "K6", "K7", "K8")
ustaleny_stav <- fcm.infer(pociatocne_stavy.vec, zavislosti, 20, "mk", "s", lambda = 3, e = 0.01)
ustaleny_stav$values
library (reshape2)
library (ggplot2)
iterations <- as.numeric(rownames(ustaleny_stav$values))  # vytvorí vektor s císlami
df <- data.frame(iterations, ustaleny_stav$values)   # add "iterations" in the "output1$values" dataframe
df2 <- melt(df, id="iterations")              # transform the dataframe df into long formats
ggplot(data=df2,                              # Visualize the concepts' values
aes(x=iterations, y=value, group=variable, colour=variable)) +
theme_bw() + geom_line(size=0.7) + geom_point(size = 3)
#install.packages("fcm")
library(fcm)
## I. Zacinajuci portal - (V)ysoka uroven investicii, ostatne (N)izke
#pociatocne_stavy.vec <- data.frame(0.125,  0.125,  0.125,  0.125,  0.125, 0.875, 0.125, 0.125)
## II. Zacinajuci portal - (V)ysoka uroven atraktivneho obsahu, reputacie a technologie
#pociatocne_stavy.vec <- data.frame(0.875,  0.875,  0.125,  0.5,  0.125, 0.125, 0.125, 0.125)
## III. Rozbehnuty portal - kontroverzny
pociatocne_stavy.vec <- data.frame(0.232,  0.125,  0.125,  0.248,  0.9, 0.25, 0.833, 0.125)
#pociatocne_stavy.vec <- data.frame(0.875,  0.875,  0.875,  0.875,  0.875, 0.875, 0.875, 0.875)
colnames(pociatocne_stavy.vec) <- c("K1", "K2", "K3", "K4", "K5", "K6", "K7", "K8")
K1 = c(0.0, 0.5, 0.0, 0.75, 0.0, 0.0, 0.0, 0.0)
K2 = c(0.0, 0.0, 0.0, 0.375, 0.0, 0.0, 0.0, 0.0)
K3 = c(0.0, 0.0, 0.0, 0.375, 0.0, 0.0, 0.0, 0.0)
K4 = c(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75, 0.0)
K5 = c(0.0, -0.75, 0.0, -0.375, 0.0, 0.0, 0.0, 0.0)
K6 = c(0.625, 0.125, 0.125, 0.0, -0.625, 0.0, 0.0, 0.0)
K7 = c(0.0, -0.5, 0.0, -0.125, 0.0, 0,0, 0.0, 0.875)
K8 = c(0.0, 0.0, 0.0, 0.0, 0.0, 0.625, 0.0, 0.0)
zavislosti <- matrix(c(K1, K2, K3, K4, K5, K6, K7, K8), nrow =8, ncol=8, byrow=TRUE)
zavislosti <- as.data.frame(zavislosti)
colnames(zavislosti) <- c("K1", "K2", "K3", "K4", "K5", "K6", "K7", "K8")
ustaleny_stav <- fcm.infer(pociatocne_stavy.vec, zavislosti, 20, "mk", "s", lambda = 3, e = 0.01)
ustaleny_stav$values
library (reshape2)
library (ggplot2)
iterations <- as.numeric(rownames(ustaleny_stav$values))  # vytvorí vektor s císlami
df <- data.frame(iterations, ustaleny_stav$values)   # add "iterations" in the "output1$values" dataframe
df2 <- melt(df, id="iterations")              # transform the dataframe df into long formats
ggplot(data=df2,                              # Visualize the concepts' values
aes(x=iterations, y=value, group=variable, colour=variable)) +
theme_bw() + geom_line(size=0.7) + geom_point(size = 3)
#install.packages("fcm")
library(fcm)
## I. Zacinajuci portal - (V)ysoka uroven investicii, ostatne (N)izke
pociatocne_stavy.vec <- data.frame(0.125,  0.125,  0.125,  0.125,  0.125, 0.875, 0.125, 0.125)
## II. Zacinajuci portal - (V)ysoka uroven atraktivneho obsahu, reputacie a technologie
#pociatocne_stavy.vec <- data.frame(0.875,  0.875,  0.125,  0.5,  0.125, 0.125, 0.125, 0.125)
## III. Rozbehnuty portal - kontroverzny
#pociatocne_stavy.vec <- data.frame(0.232,  0.125,  0.125,  0.248,  0.9, 0.25, 0.833, 0.125)
#pociatocne_stavy.vec <- data.frame(0.875,  0.875,  0.875,  0.875,  0.875, 0.875, 0.875, 0.875)
colnames(pociatocne_stavy.vec) <- c("K1", "K2", "K3", "K4", "K5", "K6", "K7", "K8")
K1 = c(0.0, 0.5, 0.0, 0.75, 0.0, 0.0, 0.0, 0.0)
K2 = c(0.0, 0.0, 0.0, 0.375, 0.0, 0.0, 0.0, 0.0)
K3 = c(0.0, 0.0, 0.0, 0.375, 0.0, 0.0, 0.0, 0.0)
K4 = c(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75, 0.0)
K5 = c(0.0, -0.75, 0.0, -0.375, 0.0, 0.0, 0.0, 0.0)
K6 = c(0.625, 0.125, 0.125, 0.0, -0.625, 0.0, 0.0, 0.0)
K7 = c(0.0, -0.5, 0.0, -0.125, 0.0, 0,0, 0.0, 0.875)
K8 = c(0.0, 0.0, 0.0, 0.0, 0.0, 0.625, 0.0, 0.0)
zavislosti <- matrix(c(K1, K2, K3, K4, K5, K6, K7, K8), nrow =8, ncol=8, byrow=TRUE)
zavislosti <- as.data.frame(zavislosti)
colnames(zavislosti) <- c("K1", "K2", "K3", "K4", "K5", "K6", "K7", "K8")
ustaleny_stav <- fcm.infer(pociatocne_stavy.vec, zavislosti, 20, "mk", "s", lambda = 3, e = 0.01)
ustaleny_stav$values
library (reshape2)
library (ggplot2)
iterations <- as.numeric(rownames(ustaleny_stav$values))  # vytvorí vektor s císlami
df <- data.frame(iterations, ustaleny_stav$values)   # add "iterations" in the "output1$values" dataframe
df2 <- melt(df, id="iterations")              # transform the dataframe df into long formats
ggplot(data=df2,                              # Visualize the concepts' values
aes(x=iterations, y=value, group=variable, colour=variable)) +
theme_bw() + geom_line(size=0.7) + geom_point(size = 3)
ustaleny_stav <- fcm.infer(pociatocne_stavy.vec, zavislosti, 20, "k", "s", lambda = 3, e = 0.01)
#install.packages("fcm")
library(fcm)
## I. Zacinajuci portal - (V)ysoka uroven investicii, ostatne (N)izke
pociatocne_stavy.vec <- data.frame(0.125,  0.125,  0.125,  0.125,  0.125, 0.875, 0.125, 0.125)
## II. Zacinajuci portal - (V)ysoka uroven atraktivneho obsahu, reputacie a technologie
#pociatocne_stavy.vec <- data.frame(0.875,  0.875,  0.125,  0.5,  0.125, 0.125, 0.125, 0.125)
## III. Rozbehnuty portal - kontroverzny
#pociatocne_stavy.vec <- data.frame(0.232,  0.125,  0.125,  0.248,  0.9, 0.25, 0.833, 0.125)
#pociatocne_stavy.vec <- data.frame(0.875,  0.875,  0.875,  0.875,  0.875, 0.875, 0.875, 0.875)
colnames(pociatocne_stavy.vec) <- c("K1", "K2", "K3", "K4", "K5", "K6", "K7", "K8")
K1 = c(0.0, 0.5, 0.0, 0.75, 0.0, 0.0, 0.0, 0.0)
K2 = c(0.0, 0.0, 0.0, 0.375, 0.0, 0.0, 0.0, 0.0)
K3 = c(0.0, 0.0, 0.0, 0.375, 0.0, 0.0, 0.0, 0.0)
K4 = c(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75, 0.0)
K5 = c(0.0, -0.75, 0.0, -0.375, 0.0, 0.0, 0.0, 0.0)
K6 = c(0.625, 0.125, 0.125, 0.0, -0.625, 0.0, 0.0, 0.0)
K7 = c(0.0, -0.5, 0.0, -0.125, 0.0, 0,0, 0.0, 0.875)
K8 = c(0.0, 0.0, 0.0, 0.0, 0.0, 0.625, 0.0, 0.0)
zavislosti <- matrix(c(K1, K2, K3, K4, K5, K6, K7, K8), nrow =8, ncol=8, byrow=TRUE)
zavislosti <- as.data.frame(zavislosti)
colnames(zavislosti) <- c("K1", "K2", "K3", "K4", "K5", "K6", "K7", "K8")
ustaleny_stav <- fcm.infer(pociatocne_stavy.vec, zavislosti, 20, "k", "s", lambda = 3, e = 0.01)
ustaleny_stav$values
library (reshape2)
library (ggplot2)
iterations <- as.numeric(rownames(ustaleny_stav$values))  # vytvorí vektor s císlami
df <- data.frame(iterations, ustaleny_stav$values)   # add "iterations" in the "output1$values" dataframe
df2 <- melt(df, id="iterations")              # transform the dataframe df into long formats
ggplot(data=df2,                              # Visualize the concepts' values
aes(x=iterations, y=value, group=variable, colour=variable)) +
theme_bw() + geom_line(size=0.7) + geom_point(size = 3)
#install.packages("fcm")
library(fcm)
## I. Zacinajuci portal - (V)ysoka uroven investicii, ostatne (N)izke
pociatocne_stavy.vec <- data.frame(0.125,  0.125,  0.125,  0.125,  0.125, 0.875, 0.125, 0.125)
## II. Zacinajuci portal - (V)ysoka uroven atraktivneho obsahu, reputacie a technologie
#pociatocne_stavy.vec <- data.frame(0.875,  0.875,  0.125,  0.5,  0.125, 0.125, 0.125, 0.125)
## III. Rozbehnuty portal - kontroverzny
#pociatocne_stavy.vec <- data.frame(0.232,  0.125,  0.125,  0.248,  0.9, 0.25, 0.833, 0.125)
#pociatocne_stavy.vec <- data.frame(0.875,  0.875,  0.875,  0.875,  0.875, 0.875, 0.875, 0.875)
colnames(pociatocne_stavy.vec) <- c("K1", "K2", "K3", "K4", "K5", "K6", "K7", "K8")
K1 = c(0.0, 0.5, 0.0, 0.75, 0.0, 0.0, 0.0, 0.0)
K2 = c(0.0, 0.0, 0.0, 0.375, 0.0, 0.0, 0.0, 0.0)
K3 = c(0.0, 0.0, 0.0, 0.375, 0.0, 0.0, 0.0, 0.0)
K4 = c(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.75, 0.0)
K5 = c(0.0, -0.75, 0.0, -0.375, 0.0, 0.0, 0.0, 0.0)
K6 = c(0.625, 0.125, 0.125, 0.0, -0.625, 0.0, 0.0, 0.0)
K7 = c(0.0, -0.5, 0.0, -0.125, 0.0, 0,0, 0.0, 0.875)
K8 = c(0.0, 0.0, 0.0, 0.0, 0.0, 0.625, 0.0, 0.0)
zavislosti <- matrix(c(K1, K2, K3, K4, K5, K6, K7, K8), nrow =8, ncol=8, byrow=TRUE)
zavislosti <- as.data.frame(zavislosti)
colnames(zavislosti) <- c("K1", "K2", "K3", "K4", "K5", "K6", "K7", "K8")
ustaleny_stav <- fcm.infer(pociatocne_stavy.vec, zavislosti, 20, "k", "s", lambda = 1, e = 0.01)
ustaleny_stav$values
library (reshape2)
library (ggplot2)
iterations <- as.numeric(rownames(ustaleny_stav$values))  # vytvorí vektor s císlami
df <- data.frame(iterations, ustaleny_stav$values)   # add "iterations" in the "output1$values" dataframe
df2 <- melt(df, id="iterations")              # transform the dataframe df into long formats
ggplot(data=df2,                              # Visualize the concepts' values
aes(x=iterations, y=value, group=variable, colour=variable)) +
theme_bw() + geom_line(size=0.7) + geom_point(size = 3)
# nainstaluje kniznicu pre vyvodzovanie numerickych hodnot
#install.packages( "fcm" )
library( fcm )
# nastavi working directory (adresar)
setwd( "~/R/fuzzy" )
## I. scenar - Zacinajuci portal - vysoka uroven investicii, ostatne koncepty nizke
scenar1.vec <- data.frame( 0.125,  0.125,  0.125,  0.125,  0.125, 0.875, 0.125, 0.125 )
## II. scenar - Zacinajuci portal - vysoka uroven atraktivneho obsahu, reputacie a mierna navstevnost
scenar2.vec <- data.frame( 0.875,  0.875,  0.125,  0.5,  0.125, 0.125, 0.125, 0.125 )
## III. scenar - Zabehnuty portal - kontroverzna strategia
scenar3.vec <- data.frame( 0.232,  0.125,  0.125,  0.248,  0.9, 0.25, 0.833, 0.125 )
# tu je mozne zmenit scenar (scenar1, scenar2, scenar3)
pociatocne_stavy.vec <- scenar1.vec
colnames( pociatocne_stavy.vec ) <- c( "K1", "K2", "K3", "K4", "K5", "K6", "K7", "K8" )
zavislosti.mat <- read.csv( "matica_zavislosti_ciselne.csv" )
ustaleny_stav <- fcm.infer( pociatocne_stavy.vec, zavislosti.mat, 15, "mk", "s", 3, 0.01 )
ustaleny_stav$values
library ( reshape2 )
library ( ggplot2 )
iterations <- as.numeric( rownames( ustaleny_stav$values ) )  # vytvorí vektor s císlami
df <- data.frame( iterations, ustaleny_stav$values )   # prida "iterations" do dataframeu "output1$values"
df2 <- melt(df, id="iterations")              # transformacia
ggplot(data=df2,                              # vykresli hodnoty konceptov po iteraciach do grafu
aes( x=iterations, y=value, group=variable, colour=variable ) ) +
theme_bw() + geom_line( size=0.7 ) + geom_point( size = 3 )
setwd("~/R/fuzzy")
# nacita funkcie pre vyvodzovanie so slovnymi hodnotami
source("03_vyvodzovaci_mechanizmus.R")
## I. Zacinajuci portal - vysoka uroven investicii
scenar1 <- list( "K1" = "N", "K2" = "N", "K3" = "N", "K4" = "N", "K5" = "N", "K6" = "V", "K7" = "N", "K8" = "N")
## II. Zacinajuci portal - (V)ysoka uroven atraktivneho obsahu, reputacie a technologie
scenar2 <- list( "K1" = "V", "K2" = "V", "K3" = "N", "K4" = "M", "K5" = "N", "K6" = "N", "K7" = "N", "K8" = "N")
## III. Rozbehnuty portal - kontroverzny
scenar3 <- list( "K1" = "SN", "K2" = "N", "K3" = "N", "K4" = "SN", "K5" = "V", "K6" = "SN", "K7" = "V", "K8" = "N")
scenar4 <- list( "K1" = "N", "K2" = "V", "K3" = "M", "K4" = "SN", "K5" = "MV", "K6" = "V", "K7" = "V", "K8" = "N")
# tu je mozne zmenit scenar (scenar1, scenar2, scenar3)
koncepty_slovne <- scenar1
matica_zavislosti <- "matica_zavislosti_slovne.csv"
simuluj( matica_zavislosti, koncepty_slovne, 20 )
