Nothing
QMWC <-function(quota,weights){
n<-length(weights)
nrow.coa <- 2^n - 1
coa_sums<-list()
kk<-1
for (i in as.numeric(0:nrow.coa)){
coa.i<-coalition(binary.digit(i, n), n)
scoa.i<-sum(weights[coa.i==1])
aux<-0
if (sum(coa.i)!=0) aux<-max(weights[coa.i==1])
dcoa.i<-quota+aux
if(scoa.i>=quota & scoa.i<dcoa.i){
coa_sums[[kk]]<-c(i,scoa.i)
kk<-kk+1
}
}
coa_sums<-do.call(rbind,coa_sums)
Q<-nrow(coa_sums)
whichQ<-t(sapply(as.numeric(1:Q),function(t) coalition(binary.digit(coa_sums[t,1],n),n)))
result<-list()
names.result<-c()
result[[1]]<-Q
names.result<-c(names.result,"Number of Quasi-Minimal Winning Coalitions")
result[[2]]<-whichQ
names.result<-c(names.result,"Quasi-Minimal Winning Coalitions")
names(result)<-names.result
return(result)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.