R/plotDecisionCost.R

#' plotDecisionCost
#' Plots the mean number of rounds it took for the status quo to be defeated for each k-majority rule, across all the iterations.
#' 
#' @param outputDataList The output data list of summaries, that is generated by the iterations() function
#' @return A plot of the mean, across all iterations, of the decision cost incurred for each k-majority rule.
#' @export
plotDecisionCost<- function(outputDataList){
  numberOfKMajorities <- nrow(outputDataList$externalCost)
  roundPropPassed <- outputDataList$rounds$meanRoundProposalPassedEachIteration
  xRange <- range(c(0:numberOfKMajorities))
  yRange <- range( c(0:ceiling((max(outputDataList$rounds$meanNumberOfProposalsConsideredEachIteration)*outputDataList$theInputParameters$perProposalDecisionCost))))
  plot(xRange, yRange, type="n", xlab="k-majority", ylab="Decision Costs")
  lines(c(1:numberOfKMajorities), outputDataList$rounds$meanNumberOfProposalsConsideredEachIteration*outputDataList$theInputParameters$perProposalDecisionCost, col = "Black", lwd = 3)
}
codeForReviewer/kMajorityRule documentation built on May 13, 2019, 8:47 p.m.