#' plotPareto
#'
#' Plot the number of rounds (y-axis) where a Pareto preferred proposal failed by k-majority (x-axis)
#' @param outputDataList The output data list of summaries, that is generated by the iterations() function
#' @return A plot of the umber of rounds (y-axis) where a Pareto preferred proposal failed by k-majority (x-axis).
#' @export
plotPareto <- function(outputDataList){
par(mar=c(5.1, 4.1, 6.1, 2.1)) # Set top margin?mar
numberOfIterations <- outputDataList$theInputParameters$numberOfIterations
averageNumParetoFailedPerRound <- outputDataList$proportionParetoFailures
plot(c(1:length(averageNumParetoFailedPerRound)),averageNumParetoFailedPerRound,type="n",
main="",
xlab="K-Majority Rule",
ylab="Rounds",
xlim=c(0,length(averageNumParetoFailedPerRound)),
ylim=c(0,ceiling(max(averageNumParetoFailedPerRound))),
cex=1.2,font=2)
lines(c(1:length(averageNumParetoFailedPerRound)), averageNumParetoFailedPerRound, col = "Black", lwd = 2, lty = "solid")
# main title
mtext(text="Proportion of Rounds where Pareto Preferred Proposal Failed",side=3,line=3.00,cex=1.0,font=2)
mtext(text=paste("Group Size:", paste(outputDataList$theInputParameters$groupSize, collapse=", ")),
side=3,
line=1.50,
adj=0,
cex=1.1,
font=2)
mtext(text=paste("Initial Utility:", paste(
toupper(
substring(
outputDataList$allGroups[[1]]$utilityDistribution,1,1)),
"(",
sub('^(-)?0[.]', '\\1.', outputDataList$allGroups[[1]]$utilityDistributionParam1),
",",
sub('^(-)?0[.]', '\\1.',outputDataList$allGroups[[1]]$utilityDistributionParam2),
")",
collapse=", ", sep="")),
side=3,
line=1.50,
adj=1,
cex=1.1,
font=2)
mtext(text=paste("Group Error:", paste(
toupper(
substring(
outputDataList$allGroups[[1]]$errorDistribution,1,1)),
"(",
sub('^(-)?0[.]', '\\1.', outputDataList$allGroups[[1]]$errorDistributionParam1),
",",
sub('^(-)?0[.]', '\\1.',outputDataList$allGroups[[1]]$errorDistributionParam2),
")",
collapse=", ", sep="")),
side=3,
line=.25,
adj=0,
cex=1.1,
font=2)
mtext(text=paste("Change Mean Utility:", paste(outputDataList$theInputParameters$groupPostFailingProposalMeanUiIncrease, collapse=", ")),
side=3,
line=.25,
adj=1,
cex=1.1,
font=2)
mtext(text=paste("Per Round Decision Cost:", paste(outputDataList$theInputParameters$perProposalDecisionCost, collapse=", ")),
side=1,
line=2.00,
adj=0,
cex=1.1,
font=2)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.