Great game of Turkey: Difference between revisions

From Opasnet
Jump to navigation Jump to search
(known bugs fixed but not tested)
 
(13 intermediate revisions by 2 users not shown)
Line 14: Line 14:
temp <- temp[temp$Date == as.character(Sys.Date()) , ]
temp <- temp[temp$Date == as.character(Sys.Date()) , ]


cat(
if(nrow(temp@output) == 0) {
"Issue #",  
cat("Issues have not yet been suggested for today.\n")
temp$Issueid,  
} else {
":",  
cat(
as.character(temp$Issue),  
  "Issue #",  
"\n",  
  temp$Issueid[1],  
as.character(temp$Issuedescription),  
  ":",  
"\n"
  as.character(temp$Issue[1]),  
)
  "\n",  
  as.character(temp$Issuedescription[1]),
  "(", as.character(temp$issuevoteResult)[1],
  "votes).\n"
)
 


oprint(temp[ , colnames(temp@output) %in% c("Actionid", "Action", "Actiondescription")])
colnames(temp@output)[colnames(temp@output) == "issueofdayResult"] <- "Votes"
oprint(temp[ , c("Action", "Actiondescription", "Actionid", "Votes")], include.rownames = FALSE)  
}
</rcode>
</rcode>


'''Then, make the decision about today's issue.
Then, make the decision about today's issue.


<rcode name="choices" label="Choose policy" embed=1 variables="
<rcode name="choices" label="Choose policy" embed=1 variables="
name:option|description:Check above the issue of the day and decide which option you would choose.|type:selection|options:
name:option|description:Check above the issue of the day and decide which option you would choose.|type:selection|options:
1;Option 1;
1;First option;
2;Option 2
2;Second option
">
">
# This is code Op_en7421/choices on page [[Great game of Turkey]]
# This is code Op_en7421/choices on page [[Great game of Turkey]]
Line 42: Line 49:
objects.latest("Op_en7421", code_name = "initiate")
objects.latest("Op_en7421", code_name = "initiate")


issueofday <- EvalOutput(issueofday)
temp <- EvalOutput(issueofday)
issueofday <- issueofday[issueofday$Date == as.character(Sys.Date()) , ]
temp <- temp[temp$Date == as.character(Sys.Date()) , ]


dat <- data.frame(
if(nrow(temp) == 0 {
Date = issueofday$Date[option],
cat("Issues have not yet been suggested for today.\n")
Issue = issueofday$Issue[option],
} else {
Action = issueofday$Action[option],
dat <- data.frame(
User = wiki_username,  
  Date = temp$Date[option],
Result = as.numeric(Sys.time())
  Issue = temp$Issue[option],
)
  Action = temp$Action[option],
  User = wiki_username,  
  Result = as.numeric(Sys.time())
)


opbase.upload(
opbase.upload(
dat,  
dat,  
ident = "Op_en7421",  
ident = "Op_en7421",  
name = "Great game of Turkey",  
name = "Great game of Turkey",  
subset = "Decisions",  
subset = "Decisions",  
act_type = "append",  
act_type = "append",  
language = "eng",  
language = "eng",  
who = wiki_username
who = wiki_username
)
)


oprint(dat)
oprint(dat, include.rownames = FALSE)
cat("Your choice was successfully saved.\n")
cat("Your choice was successfully saved.\n")
}
</rcode>
</rcode>


Line 76: Line 87:


== Answer ==
== Answer ==
=== How to play ===
In this game you get to be the president of Turkey, having to daily make decisions about big and small things. Once a day you choose between two options according to what you would decide about a certain issue. The issue changes daily. Making a decision will cause a change in happiness (see "Happiness") of different population groups and societally important values (see "Values"). Each player will be scored as a decisionmaker based on how they are able to promote happiness and societal values. Players see their own score over time, accompanied by the score of the crowd. The point of the game is to make decisions so that you increase the happiness of different groups as much as possible while also helping to promote important objectives.
'''Getting started
:Before beginning to play, you might consider creating a wiki account, but this is not mandatory. You can do this by clicking "Sign in/Create account" on the top right corner of the page. When you are signed in, you are able to participate in discussions on the possible actions for different issues (See "Suggesting and voting for issues for the issues"). If you do not create an account and play signed in, the IP address for your computer will be used to identify you in the game to keep your score.
:Whether you create yourself a wiki account or not, before you can begin to play, you have to setup your profile. This means choosing which social group you most identify with. There are six groups to choose from: nationalists, liberals, conservatives, minorities, kemalists and other. You can do this in the answer-section, under "Setup profile". You can only belong to one group. You may also change your preferences later. In the beginning you are given 1 bonus to start the game with.
'''Making today's decision
:Making decisions every day about the issue of the day is the basic thing to do in the game. By making a decision about the daily issue, you earn 0.1 bonus. To make a decision about the daily issue, first click "See the issue of the day" on the top of the page to see what the decision is about today and what the options are. After you have read the issue and the options, you can make the decision between the first and second options by choosing the correct one from the drop-down menu below this. Remember to also click on "Choose policy". These decisions will affect how happy you are able to keep the different groups of people (see "Happiness") and how well you are able to promote the different social objectives (see "Values").
'''Suggesting and voting for issues of the day
:You can also affect what the issues voted on will be. Under "Suggest issues and actions" you can submit your own suggestion for an issue for any specific day in the future. You can only suggest one issue for a specific day. If you suggest a new issue for that day, only your newest suggestion will appear in the list. You can also vote for the issue of the day from among the issues already suggested. The suggestion that is ranked highest will become the issue of the day, and the player who suggested it gains 5 bonuses. An issue can be suggested again for a later time point (for example, if it is not played on the first day suggested).
:To vote for an issue first see the issues suggested under "See all suggested issues and actions". You can check the issues suggested for any particular day, or all issues suggested for all days. To vote check the Issueid of the issue you want to vote for and type it into "What is the Issueid (from 'See all actions') of the issue that should be played?" under "Vote for issues and actions". You can only vote for issues on the day they have been suggested for, and only vote for one issue per day. The amount of bonuses you have gathered in the game tells the weight of your vote. If, for example, you have 3 bonuses, your vote equals the votes of three players who all have 1 bonus.
'''Suggesting and voting for actions for the issues
:In the same way as you can suggest and vote for issues of the day, you can also suggest and vote for the action options for any of the issues. The two actions ranked highest will become the options for a certain issue, and the players who suggested them will gain 1 bonus. You can suggest actions for an issue as soon as the issue has been suggested, and the actions can be voted for as soon as they are in the system. The purpose of this is to promote discussion about actions and hence critical evaluation which actions should be upvoted to be played. To participate in the discussion, you need to have a wiki account (see "Getting started" above). You can find the discussions on the "Discussion" tab of this page. You can only vote for one action per issue, and like with voting for issues, the bonuses you have add to the weight of your vote. If an issue is suggested again for a later time point than the original suggestion was, previous related actions and their votes apply.
'''Happiness
:You can also take part in evaluating how much happiness or unhappiness the different actions bring to the social group you belong in, practically meaning how satisfied the people of the group would be if the action was the one chosen. You can do this under "Evaluate happiness and values". Type in the Actionid (you can see this under "See all suggested issues and actions"), and choose from the drop-down menu the happiness score that best describe the amount of happiness the action would bring to your group. You can do this only once per action. Negative scores mean it would decrease happiness within the group. Evaluation of happiness related to an action is possible as soon as the action has been suggested.
:The evaluations of all players are then brought together and are used to determine how much a player is able to increase happiness when making the daily decisions. This, you may remember, is the point of the game.
'''Values
:Aside from happiness, you can also evaluate how much value different actions bring to different objectives. There are five objectives: Civil rights, woman's rights, religion, national values and democracy. Under "Evaluate happiness and values" you can tell how much value different actions bring to different objectives. Value practically means the improving of the conditions having to do with an objective. Type in the Actionid and then choose the objective you want to evaluate and the value the action would bring to it from the drop-down menus. The evaluation of values related to actions is possible as soon as the actions are suggested. You can only evaluate the value once per action and objective.
:The value of each action given to the objective is summarised from all layers the same way as the happiness scores and are used to determine how much it promotes the different social objectives. Making decisions that make things better in respect to these objectives is also the point of the game.
'''Overview of the decisions'''
: In time, you will make a lot of decisions. You can see and overview of these decisions under "Game results" by clicking "Run code". It shows you a graph of a cumulative timeline so that every day your decision will take you up or down in the eyes of different groups (see "Happiness" above) or different objectives (see "Values" above), compared with the majority vote. This gives you an idea of what kind of decisions you have on average made and how you have answered compared to other players. You should try to get the happiness scores of different groups as well as the objectives as high as possible.


=== Game results ===
=== Game results ===
Line 93: Line 133:


happindex <- EvalOutput(happindex)
happindex <- EvalOutput(happindex)
valindex <- EvalOutput(valindex)
ggplot(happindex@output, aes(x = Date, y = happinessResult, colour = Group, group = Group)) + geom_point() + facet_grid(Decisionmaker ~ .) + theme_gray(base_size = BS)
ggplot(valindex@output, aes(x = Date, y = valuesResult, colour = Value, group = Value)) + geom_point() + facet_grid(Decisionmaker ~ .) + theme_gray(base_size = BS)
oggplot(happindex, x = "Date", fill = "Group") + facet_wrap(~ User) + labs(title = "Happiness per day") +
oggplot(happindex, x = "Date", fill = "Group") + facet_wrap(~ User) + labs(title = "Happiness per day") +
theme(axis.text.x = element_text(angle = 90, hjust = 1)) # Turn text and adjust to right
theme(axis.text.x = element_text(angle = 90, hjust = 1)) # Turn text and adjust to right
Line 99: Line 145:
happequity <- oapply(happmean, cols = "Group", FUN = sd)
happequity <- oapply(happmean, cols = "Group", FUN = sd)


oggplot(mergeusers(happmean), x = "User", fill = "Group") + labs(title = "Mean happiness during the whole period")
oggplot(mergeusers(happmean), x = "Decisionmaker", fill = "Group") + labs(title = "Mean happiness during the whole period")
oggplot(mergeusers(happequity), x = "User") + labs(title = "Deviation from the equity")
oggplot(mergeusers(happequity), x = "Decisionmaker") + labs(title = "Deviation from the equity")
 
valindex <- EvalOutput(valindex)
oggplot(valindex, x = "Date", fill = "Issue") + facet_wrap(~ User)+ labs(title = "Values per day") +
theme(axis.text.x = element_text(angle = 90, hjust = 1)) # Turn text and adjust to right


valmean <- oapply(valindex, cols = c("Date", "Issue", "Action"), FUN = mean)
valmean <- oapply(valindex, cols = c("Date", "Issue", "Action"), FUN = mean)
valequity <- oapply(valmean, cols = "Issue", FUN = sd)
valequity <- oapply(valmean, cols = "Issue", FUN = sd)


oggplot(mergeusers(valmean), x = "User", fill = "Issue") + labs(title = "Mean values over time")
oggplot(mergeusers(valmean), x = "Decisionmaker", fill = "Issue") + labs(title = "Mean values over time")
oggplot(mergeusers(progequity), x = "User") + labs(title = "Deviation from the policy balance")
oggplot(mergeusers(progequity), x = "Decisionmaker") + labs(title = "Deviation from the policy balance")


</rcode>
</rcode>
Line 149: Line 191:
)
)


oprint(dat)
oprint(dat, include.rownames = FALSE)


cat("Your group was successfully saved.\n")
cat("Your group was successfully saved.\n")
Line 172: Line 214:
)
)


oprint(dat)
oprint(dat, include.rownames = FALSE)


cat("Your seed bonus was successfully saved.\n")
cat("Your seed bonus was successfully saved.\n")
Line 178: Line 220:
</rcode>
</rcode>


=== Suggest issues and actions ===
=== See all suggested issues and actions ===


<rcode label="See all actions" embed=1 variables="
<rcode label="See all actions" embed=1 variables="
Line 194: Line 236:
objects.latest("Op_en7421", code_name = "initiate")
objects.latest("Op_en7421", code_name = "initiate")


temp <- EvalOutput(allactions)
allactions <- EvalOutput(allactions)
if(all) temp <- allactions[allactions$Date == as.character(date) , ]
if(all) temp <- allactions else temp <- allactions[allactions$Date == as.character(date) , ]
colnames(temp@output)[colnames(temp@output) == "allactionsResult"] <- "Votes"


for(i in sort(unique(paste(temp$Date, temp$Issueid)))) {
if(nrow(temp@output) == 0) {
  temp2 <- temp[paste(temp$Date, temp$Issueid) == i , ]
  cat("Issues not found for that time.\n")
  cat(
} else {
    as.character(temp$Date[1]),
  for(i in sort(unique(paste(temp$Date, temp$Issueid)))) {
    "Issue",  
    temp2 <- temp[paste(temp$Date, temp$Issueid) == i , ]
    as.character(temp2$Issueid[1]),  
    cat(
    ":",  
      as.character(temp$Date[1]),
    as.character(temp2$Issue[1]),  
      "Issueid",  
    "\n",  
      as.character(temp2$Issueid[1]),  
    as.character(temp2$Issuedescription[1]),  
      ":",  
    "\n"
      as.character(temp2$Issue[1]),  
  )
      "\n",  
  oprint(temp2[ , c("Action", "Actiondescription", "Actionid")])
      as.character(temp2$Issuedescription[1]),  
      "(", as.character(temp$issuevoteResult)[1],
      "votes).\n"
    )
    oprint(temp2[ , c("Action", "Actiondescription", "Actionid", "Votes")], include.rownames = FALSE)
  }
}
}
</rcode>


</rcode>
=== Suggest issues and actions ===


{|
{|
|
|
<rcode label="Suggest issue" embed=1 variables="
<rcode label="Suggest issue" embed=1 variables="
name:date|description:When should this issue be played?|type:date|
name:issue|description:What is the issue (decision) that should be played? (briefly)|type:textbox|
name:issue|description:What is the issue (decision) that should be played? (briefly)|type:textbox|
name:description|description:Give a more detailed description.|type:textbox
name:description|description:Give a more detailed description.|type:textbox|
name:date|description:When should this issue be played?|type:date
">
">
# This is code Op_en7421/ on page [[Great game of Turkey]]
# This is code Op_en7421/ on page [[Great game of Turkey]]
Line 228: Line 277:


library(OpasnetUtils)
library(OpasnetUtils)
objects.latest("Op_en7421", code_name = "initiate")


bonus <- EvalOutput(bonuses)
bonus <- EvalOutput(bonuses)
bonus <- result(bonus)[bonus$User == wiki_username , ]
bonus <- result(bonus)[bonus$User == wiki_username]


dat <- data.frame(
dat <- data.frame(
Date = as.character(date),
Date = as.character(date),
Issue = issue,
Issue = issue,
Description = description,
Issuedescription = description,
User = wiki_username,  
User = wiki_username,  
Result = as.numeric(Sys.time())
Result = as.numeric(Sys.time())
Line 250: Line 301:
)
)


oprint(dat)
oprint(dat, include.rownames = FALSE)


cat("Your issue was successfully saved.\n")
cat("Your issue was successfully saved.\n")
Line 272: Line 323:
)
)


oprint(dat)
oprint(dat, include.rownames = FALSE)


cat("The issue was also voted for with your bonuses.\n")
cat("The issue was also voted for with your bonuses.\n")
Line 281: Line 332:


<rcode label="Suggest action" embed=1 variables="
<rcode label="Suggest action" embed=1 variables="
name:issue|description:What is the Issueid of the issue (from See all actions)?|type:default|
name:issue|description:What is the Issueid (from 'See all actions') of an issue?|type:default|
name:action|description:What is the action you suggest to this issue? (briefly)|type:textbox|
name:action|description:What is the action you suggest to this issue? (briefly)|type:textbox|
name:description|description:Give a more detailed description.|type:textbox
name:description|description:Give a more detailed description.|type:textbox
Line 292: Line 343:


library(OpasnetUtils)
library(OpasnetUtils)
bonus <- EvalOutput(bonuses)
bonus <- result(bonus)[bonus$User == wiki_username , ]


objects.latest("Op_en7421", code_name = "initiate")
objects.latest("Op_en7421", code_name = "initiate")


temp <- EvalOutput(allactions)
bonus <- EvalOutput(bonuses)
temp <- temp[temp$Issueid == issue , ]  
bonus <- result(bonus)[bonus$User == wiki_username]


#if(!issue %in% issueofday$Issueid) stop("Issue not found")
allactions <- EvalOutput(allactions)
issue <- allactions$Issue[allactions$Issueid == issue][1]


dat <- data.frame(
if(length(bonus) == 0) {
Issue = temp$Issue,
cat("Setup your account first by selecting a group.\n")
Action = action,
} else {
Description = description,
if(length(issue) == 0) {
User = wiki_username,  
cat("Issue not found.\n")
Result = as.numeric(Sys.time())
} else {
)
dat <- data.frame(
Issue = issue,
Action = action,
Actiondescription = description,
User = wiki_username,  
Result = as.numeric(Sys.time())
)


opbase.upload(
opbase.upload(
dat,  
dat,  
ident = "Op_en7421",  
ident = "Op_en7421",  
name = "Great game of Turkey",  
name = "Great game of Turkey",  
subset = "Actions",  
subset = "Actions",  
act_type = "append",  
act_type = "append",  
language = "eng",  
language = "eng",  
who = wiki_username
who = wiki_username
)
)


oprint(dat)
oprint(dat, include.rownames = FALSE)


cat("Your action was successfully saved.\n")
cat("Your action was successfully saved.\n")


dat <- data.frame(
dat <- data.frame(
Issue = temp$Issue,
Issue = issue,
Action = action,
Action = action,
User = wiki_username,  
User = wiki_username,  
Avotes = bonus,
Avotes = bonus,
Result = as.numeric(Sys.time())
Result = as.numeric(Sys.time())
)
)


opbase.upload(
opbase.upload(
dat,  
dat,  
ident = "Op_en7421",  
ident = "Op_en7421",  
name = "Great game of Turkey",  
name = "Great game of Turkey",  
subset = "Actionvote",  
subset = "Actionvote",  
act_type = "append",  
act_type = "append",  
language = "eng",  
language = "eng",  
who = wiki_username
who = wiki_username
)
)
 
oprint(dat)


cat("The action was also voted for with your bonuses.\n")
oprint(dat, include.rownames = FALSE)


cat("The action was also voted for with your bonuses.\n")
}
}
</rcode>
</rcode>
|}
|}
Line 356: Line 412:


<rcode label="Vote for an issue" embed=1 variables="
<rcode label="Vote for an issue" embed=1 variables="
name:issue|description:What is the Issueid of the of issue (decision) that should be played?|type:default
name:issue|description:What is the Issueid (from 'See all actions') of the issue that should be played?|type:default
">
">
# This is code Op_en7421/ on page [[Great game of Turkey]]
# This is code Op_en7421/ on page [[Great game of Turkey]]
Line 364: Line 420:
library(OpasnetUtils)
library(OpasnetUtils)


bonus <- EvalOutput(bonuses)
objects.latest("Op_en7421", code_name = "initiate")
bonus <- result(bonus)[bonus$User == wiki_username , ]


objects.latest("Op_en7421", code_name = "initiate")
bonuses <- EvalOutput(bonuses)
bonus <- result(bonuses)[bonuses$User == wiki_username]


iss <- EvalOutput(issueofday)
temp <- EvalOutput(allactions)
iss <- iss[iss$Date == as.character(Sys.Date()) , ]
temp <- temp[temp$Date == as.character(Sys.Date()) & temp$Issueid == issue , ]


dat <- data.frame(
dat <- data.frame(
Date = iss$Date[iss$Issueid == issue],
Date = temp$Date[1],
Issue = iss$Issue[iss$Issueid == issue],
Issue = temp$Issue[1],
User = wiki_username,  
User = wiki_username,  
Ivotes = bonus,
Ivotes = bonus,
Line 390: Line 446:
)
)


oprint(dat)
oprint(dat, include.rownames = FALSE)


cat("Your issue vote was successfully saved.\n")
cat("Your issue vote was successfully saved.\n")
Line 398: Line 454:


<rcode label="Vote for an action" embed=1 variables="
<rcode label="Vote for an action" embed=1 variables="
name:action|description:What is the Actionid of the action you vote for?|type:default
name:action|description:What is the Actionid (from 'See all actions') of the action you vote for?|type:default
">
">
# This is code Op_en7421/ on page [[Great game of Turkey]]
# This is code Op_en7421/ on page [[Great game of Turkey]]
Line 406: Line 462:
library(OpasnetUtils)
library(OpasnetUtils)


bonus <- EvalOutput(bonuses)
objects.latest("Op_en7421", code_name = "initiate")
bonus <- result(bonus)[bonus$User == wiki_username , ]


objects.latest("Op_en7421", code_name = "initiate")
bonuses <- EvalOutput(bonuses)
bonus <- result(bonuses)[bonuses$User == wiki_username]


iss <- EvalOutput(issueofday)
temp <- EvalOutput(allactions)
iss <- iss[iss$Date == as.character(Sys.Date()) & iss$actionid == action , ]
temp <- temp[temp$Date == as.character(Sys.Date()) & temp$Actionid == action , ]


dat <- data.frame(
dat <- data.frame(
Date = iss$Date,
Issue = temp$Issue[1],
Issue = iss$Issue,
Action = temp$Action[1],
Action = iss$Action,
User = wiki_username,  
User = wiki_username,  
Avotes = bonus,
Avotes = bonus,
Line 433: Line 488:
)
)


oprint(dat)
oprint(dat, include.rownames = FALSE)


cat("Your action vote was successfully saved.\n")
cat("Your action vote was successfully saved.\n")
Line 445: Line 500:
|
|
<rcode name="happiness" label="Save your happiness score" embed=1 variables="
<rcode name="happiness" label="Save your happiness score" embed=1 variables="
name:action|description:Give the Actionid for the action you want to score (from code 'See actions')|type:default|
name:action|description:What is the Actionid (from 'See all actions') of the action you want to score?|type:default|
name:hscore|description:How much happiness would this option bring to this group?|type:selection|options:
name:hscore|description:How much happiness would this option bring to this group?|type:selection|options:
NA;- choose score -;2;+2;1;+1;0;0;-1;-1;-2;-2|default:NA
NA;- choose score -;2;+2;1;+1;0;0;-1;-1;-2;-2|default:NA
Line 460: Line 515:
temp <- EvalOutput(allactions)
temp <- EvalOutput(allactions)
temp <- temp[temp$Actionid == action , ]
temp <- temp[temp$Actionid == action , ]
cat(as.character(temp$Issue), ":", as.character(temp$Action, "\n")
cat(as.character(temp$Issue), ":", as.character(temp$Action), "\n")


user <- EvalOutput(user)
user <- EvalOutput(user)
Line 466: Line 521:


dat <- data.frame(
dat <- data.frame(
Issue = temp$Issue,
Issue = temp$Issue[1],
Action = temp$Action,
Action = temp$Action[1],
Group = user1$Group,
Group = user1$Group[1],
User = user1$User,  
User = user1$User[1],  
Hscore = hscore, # Happiness score
Hscore = hscore, # Happiness score
Result = as.numeric(Sys.time())
Result = as.numeric(Sys.time())
Line 484: Line 539:
)
)


oprint(dat)
oprint(dat, include.rownames = FALSE)
cat("Your happiness score was successfully saved.\n")
cat("Your happiness score was successfully saved.\n")


Line 492: Line 547:


<rcode name="value" label="Save your value score" embed=1 variables="
<rcode name="value" label="Save your value score" embed=1 variables="
name:action|description:What is the Actionid of the action (from All actions)?|type:default|
name:action|description:What is the Actionid (from 'See all actions') of the action you want to score?|type:default|
name:value|description:Select an objective to evaluate|type:selection|options:
name:value|description:Select an objective to evaluate|type:selection|options:
'Civil Rights';Civil Rights;
'Civil Rights';Civil Rights;
Line 498: Line 553:
'Religion';Religion;
'Religion';Religion;
'National Values';National Values;
'National Values';National Values;
'Democracy';Democracy|
'Democracy';Democracy;
'Other';Other|
name:vscore|description:How much value would this action bring?|type:selection|options:
name:vscore|description:How much value would this action bring?|type:selection|options:
NA;- choose score -;2;+2;1;+1;0;0;-1;-1;-2;-2|default:NA
NA;- choose score -;2;+2;1;+1;0;0;-1;-1;-2;-2|default:NA
Line 515: Line 571:
temp <- temp[temp$Actionid == action , ]
temp <- temp[temp$Actionid == action , ]


cat(as.character(temp$Issue), ":", as.character(temp$Action, "\n")
cat(as.character(temp$Issue), ":", as.character(temp$Action), "\n")


dat <- data.frame(
dat <- data.frame(
Date = temp$Date,
Issue = temp$Issue[1],
Issue = temp$Issue,
Action = temp$Action[1],
Action = temp$Action,
Value = value,
Value = value,
User = wiki_username,  
User = wiki_username,  
Line 537: Line 592:
who = wiki_username
who = wiki_username
)
)
oprint(dat)
oprint(dat, include.rownames = FALSE)
cat("Your progress score was successfully saved.\n")
cat("Your progress score was successfully saved.\n")
} else {
} else {
Line 546: Line 601:


== Rationale ==
== Rationale ==
There is no need to edit the wiki page. Everything can be written into the text slots and uploaded by pressing the respective buttons. You can also create a full day's simulated activity in tables and copy-paste those directly. There is an example file that I used for uploading today's game at the end of the page.


=== Calculations ===
=== Calculations ===
Line 585: Line 642:
issueofday <- Ovariable("issueofday",
issueofday <- Ovariable("issueofday",
   dependencies = data.frame(Name = "allactions"),
   dependencies = data.frame(Name = "allactions"),
   formula = function(...) {
   formula = function (...) {
      
     first <- TRUE
     for(i in unique(allactions$Date)) {
     for (i in unique(allactions$Date)) {
       test <- allactions[allactions$Date == i , ]
       test <- allactions[allactions$Date == i, ]
       test <- test[order(-test$issuevoteResult) , c("Date", "Issue")][1 , ] # Choose the 1 row with most votes
       test <- test[order(-test$issuevoteResult), ][1, ]
       if(exists("issday")) issday <- combine(issday, test) else issday <- test
       if (first)
        issday <- test
      else issday <- combine(issday, test)
      first <- FALSE
     }
     }
      
     issday <- issday[, c("Date", "Issue")]
     for(i in unique(allactions$Issueid)) {
    first <- TRUE
       test <- allactions[allactions$Issueid == i , ]
     for (i in unique(allactions$Issueid)) {
       test <- test[order(-result(test)) , ][1:2 , ] # Action votes are the result column of allactions
       test <- allactions[allactions$Issueid == i, ]
       if(exists("actday")) actday <- combine(actday, test) else actday <- test
       test <- test[order(-result(test)), ][1:min(2,nrow(test@output)), ]
       if (first)
        actday <- test
      else actday <- combine(actday, test)
      first <- FALSE
     }
     }
     return(merge(issday, actday))
     actday <- actday[!is.na(actday$Action) , ]
    out <- merge(issday, actday, all.x = TRUE)[ , c("Date", "Issue", "Action")]
    out <- merge(out, allactions)
    out@name <- "allactions"
    return(out)
   }
   }
)
)
Line 609: Line 677:
     issues$Issueid <- 1:length(result(issues))
     issues$Issueid <- 1:length(result(issues))
     iss <- oapply(issuevote, cols = "User", FUN = sum) # Sum votes for each issue across users
     iss <- oapply(issuevote, cols = "User", FUN = sum) # Sum votes for each issue across users
     iss <- merge(issues, iss)
     iss <- merge(issues, iss, all.x = TRUE)
    iss$issuevoteResult[is.na(iss$issuevoteResult)] <- 0
    iss <- unkeep(iss, sources = TRUE)
     iss$User <- NULL
     iss$User <- NULL
 
   
     actions$Actionid <- 1:length(result(actions))
     actions$Actionid <- 1:length(result(actions))
     act <- oapply(actionvote, cols = "User", FUN = sum)
     act <- oapply(actionvote, cols = "User", FUN = sum)
     act <- merge(actions, act)
     act <- merge(actions, act, all.x = TRUE)
    act$actionvoteResult[is.na(act$actionvoteResult)] <- 0
    act <- unkeep(act, sources = TRUE)
     act$User <- NULL
     act$User <- NULL
     out <- merge(iss, act)
     out <- merge(iss, act, all.x = TRUE)
     out@name <- "actionvote"
     out@name <- "actionvote"
     return(out)
     return(out)
Line 622: Line 694:
)
)


uniques <- function(subset) {
 
# Columns that determine unique rows in tables
# Issues: Date,Issue # Could also be Date,User but let's allow people suggest more than one but vote only one.
# Actions: Issue,Action # Could also be Issue,User but same as above.
# Issuevote: Date,User
# Actionvote: Issue,User
# Happiness: Action,User
# Values: Action,Value,User
# User: User
# Bonuses: User,Reason
# Decisions: Date,User
 
# Tables in which a column determines unique rows
# Date: always
# Issue: Yes Issues, Actions, Actionvote; No Issuevote, Happiness, Values, Decisions
# Action: Yes Actions, Values, Happiness; No Actionvote, Decisions
# User: always but Issues, Actions
# Value: Always
# Reason: always
 
uniques <- function(subs) {
   #Create a temporary ovariable temp and fetch the respective table with ddata.
   #Create a temporary ovariable temp and fetch the respective table with ddata.
   #indices that are used to find unique rows:  
   #indices that are used to find unique rows:  
   uncolumns <- c("Date", "Issue", "Action", "User", "Value", "Group", "Reason")
   uncolumns <- c("Date", "Issue", "Action", "User", "Value", "Reason")
   #However, take away the index that is being added:
   #However, take away indices as listed above.
  #Issue (for Issuevote and Issues); Action (for Actionvote and Actions). None for other tables.
   addindex <- NULL
   addindex <- NULL
   if(subset %in% c("Issues", "Issuevote")) addindex <- "Issue"
   if(subs %in% c("Issuevote", "Happiness", "Values", "Decisions")) addindex <- c(addindex, "Issue")
   if(subset %in% c("Actions", "Actionvote")) addindex <- "Action"
   if(subs %in% c("Actionvote", "Decisions")) addindex <- c(addindex, "Action")
   uncolumns <- uncolumns[!uncolumns %in% addindex]
  if(subs %in% c("Issues", "Actions")) addindex <- c(addindex, "User")
   uncol <- uncolumns[!uncolumns %in% addindex]
   #indices that are transformed to Result:  
   #indices that are transformed to Result:  
   rescolumns <- c("Ivotes", "Avotes", "Bonus", "Vscore", "Hscore")
   rescolumns <- c("Ivotes", "Avotes", "Bonus", "Vscore", "Hscore")
 
 
   dat <- opbase.data("Op_en7421", subset = subset)
   dat <- opbase.data("Op_en7421", subset = subs)
   temp <- aggregate(dat["Result"], by = dat[colnames(dat) %in% uncolumns], FUN = max)  
  for(i in colnames(dat)[colnames(dat) %in% uncolumns]) dat <- dat[!is.na(dat[[i]]) & dat[[i]] != "NA" , ]
   out <- merge(dat, temp)
   temp <- aggregate(dat["Result"], by = dat[colnames(dat) %in% uncol], FUN = max)  
   out <- merge(dat, temp["Result"])
   out$Result <- NULL
   out$Result <- NULL
   colnames(out)[colnames(out) %in% rescolumns] <- "Result"
   colnames(out)[colnames(out) %in% rescolumns] <- "Result"
Line 645: Line 738:
}
}


# dummy is needed to get correct marginals in downstream ovariables.
dummy <- Ovariable("dummy",  
dummy <- Ovariable("dummy",  
   data = data.frame(Date=1, Issue=1, Action=1, User=1, Value=1, Group=1, Reason=1, Result=1)
   data = data.frame(Date=1, Issue=1, Action=1, User=1, Value=1, Group=1, Reason=1, Result=1)
Line 718: Line 812:
mergeusers <- function(happ) {
mergeusers <- function(happ) {
   if(length(happ$User) != length(happ$User[happ$User == wiki_username])) {
   if(length(happ$User) != length(happ$User[happ$User == wiki_username])) {
     happ$User <- ifelse(happ$User == wiki_username, "You", "Crowd")
     happ$Decisionmaker <- ifelse(happ$User == wiki_username, "You", "Crowd")
   }
   }
   return(out)
   return(happ)
}
}


happindex <- Ovariable("happindex",  
deci <- Ovariable("deci",
   dependencies = data.frame(Name = c(
   dependencies = data.frame(Name = "decisions"),
    "happiness",
    "decisions",
    "issues"
    )),
   formula = function(...) {
   formula = function(...) {
 
     deci <- mergeusers(decisions)
    happindex <- oapply(happiness, cols = "User", FUN = mean)
     deci <- mergeusers(decision)
     deci <- oapply(deci, cols = "User", FUN = length)
     deci <- oapply(deci, cols = "User", FUN = length)
# KESKENERÄINEN TEE MUUT ENSIN
     for(i in unique(paste(deci$Date, deci$Issue))) {
     for(i in unique(allactions$Date)) {
       test <- deci[paste(deci$Date, deci$Issue) == i , ]
       test <- allactions[allactions$Date == i , ]
       test <- test[order(-test$decisionsResult) , ][1 , ] # Choose the 1 row with most decisions
       test <- test[order(-test$issuevoteResult) , c("Date", "Issue")][1 , ] # Choose the 1 row with most votes
       if(exists("out365")) out365 <- combine(out365, test) else out365 <- test
       if(exists("issday")) issday <- combine(issday, test) else issday <- test
     }
     }
   
     return(out365)
    happindex <- deci * happindex * issues
     return(happindex)
   }
   }
)
happindex <- Ovariable("happindex",
  dependencies = data.frame(Name = c(
    "happiness",
    "deci",
    "actions"
  )),
  formula = function(...) {
    actions$User <- NULL
    happindex <- oapply(happiness, cols = "User", FUN = mean)
    happindex <- deci * happindex * actions
    return(happindex)
  }
)
)


valindex <- Ovariable("valindex",  
valindex <- Ovariable("valindex",  
dependencies = data.frame(Name = c(
  dependencies = data.frame(Name = c(
  "values",
    "values",
  "decisions",
    "deci",
  "issues"
    "actions"
)),
  )),
formula = function(...) {
  formula = function(...) {
 
    actions$Result <- NULL
  valindex <- oapply(values, cols = "User", FUN = mean)
    valindex <- oapply(values, cols = "User", FUN = mean)
#KESKEN ks. happindex
     valindex <- deci * valindex * actions
     deci <- mergeusers(decisions)
    return(valindex)
  valueindex <- deci * valueindex * issues
  }
  return(valindex)
}
)
)


rm(wiki_username)
objects.store(list = ls())
objects.store(list = ls())
cat("Objects", ls(), "stored successfully.\n")
cat("Objects", ls(), "stored successfully.\n")
Line 833: Line 931:


== Related files ==
== Related files ==
{{#l:Great game of Turkey seed data.ods}} Example data to be copied in for a new day.

Latest revision as of 21:44, 4 March 2016


Make today's decision First, see the issue and possible actions.

+ Show code

Then, make the decision about today's issue.

Check above the issue of the day and decide which option you would choose.:

+ Show code

Question

What is a good game to crowdsource citizen priorities about daily political decisions in such a way that

  • it can be done using a mobile app,
  • it characterises happiness of citizen groups of the decisions,
  • it characterises progress of important societal values,
  • it enables crowdsourcing the actual issues and actions asked?

Answer

How to play

In this game you get to be the president of Turkey, having to daily make decisions about big and small things. Once a day you choose between two options according to what you would decide about a certain issue. The issue changes daily. Making a decision will cause a change in happiness (see "Happiness") of different population groups and societally important values (see "Values"). Each player will be scored as a decisionmaker based on how they are able to promote happiness and societal values. Players see their own score over time, accompanied by the score of the crowd. The point of the game is to make decisions so that you increase the happiness of different groups as much as possible while also helping to promote important objectives.

Getting started

Before beginning to play, you might consider creating a wiki account, but this is not mandatory. You can do this by clicking "Sign in/Create account" on the top right corner of the page. When you are signed in, you are able to participate in discussions on the possible actions for different issues (See "Suggesting and voting for issues for the issues"). If you do not create an account and play signed in, the IP address for your computer will be used to identify you in the game to keep your score.
Whether you create yourself a wiki account or not, before you can begin to play, you have to setup your profile. This means choosing which social group you most identify with. There are six groups to choose from: nationalists, liberals, conservatives, minorities, kemalists and other. You can do this in the answer-section, under "Setup profile". You can only belong to one group. You may also change your preferences later. In the beginning you are given 1 bonus to start the game with.

Making today's decision

Making decisions every day about the issue of the day is the basic thing to do in the game. By making a decision about the daily issue, you earn 0.1 bonus. To make a decision about the daily issue, first click "See the issue of the day" on the top of the page to see what the decision is about today and what the options are. After you have read the issue and the options, you can make the decision between the first and second options by choosing the correct one from the drop-down menu below this. Remember to also click on "Choose policy". These decisions will affect how happy you are able to keep the different groups of people (see "Happiness") and how well you are able to promote the different social objectives (see "Values").

Suggesting and voting for issues of the day

You can also affect what the issues voted on will be. Under "Suggest issues and actions" you can submit your own suggestion for an issue for any specific day in the future. You can only suggest one issue for a specific day. If you suggest a new issue for that day, only your newest suggestion will appear in the list. You can also vote for the issue of the day from among the issues already suggested. The suggestion that is ranked highest will become the issue of the day, and the player who suggested it gains 5 bonuses. An issue can be suggested again for a later time point (for example, if it is not played on the first day suggested).
To vote for an issue first see the issues suggested under "See all suggested issues and actions". You can check the issues suggested for any particular day, or all issues suggested for all days. To vote check the Issueid of the issue you want to vote for and type it into "What is the Issueid (from 'See all actions') of the issue that should be played?" under "Vote for issues and actions". You can only vote for issues on the day they have been suggested for, and only vote for one issue per day. The amount of bonuses you have gathered in the game tells the weight of your vote. If, for example, you have 3 bonuses, your vote equals the votes of three players who all have 1 bonus.

Suggesting and voting for actions for the issues

In the same way as you can suggest and vote for issues of the day, you can also suggest and vote for the action options for any of the issues. The two actions ranked highest will become the options for a certain issue, and the players who suggested them will gain 1 bonus. You can suggest actions for an issue as soon as the issue has been suggested, and the actions can be voted for as soon as they are in the system. The purpose of this is to promote discussion about actions and hence critical evaluation which actions should be upvoted to be played. To participate in the discussion, you need to have a wiki account (see "Getting started" above). You can find the discussions on the "Discussion" tab of this page. You can only vote for one action per issue, and like with voting for issues, the bonuses you have add to the weight of your vote. If an issue is suggested again for a later time point than the original suggestion was, previous related actions and their votes apply.

Happiness

You can also take part in evaluating how much happiness or unhappiness the different actions bring to the social group you belong in, practically meaning how satisfied the people of the group would be if the action was the one chosen. You can do this under "Evaluate happiness and values". Type in the Actionid (you can see this under "See all suggested issues and actions"), and choose from the drop-down menu the happiness score that best describe the amount of happiness the action would bring to your group. You can do this only once per action. Negative scores mean it would decrease happiness within the group. Evaluation of happiness related to an action is possible as soon as the action has been suggested.
The evaluations of all players are then brought together and are used to determine how much a player is able to increase happiness when making the daily decisions. This, you may remember, is the point of the game.

Values

Aside from happiness, you can also evaluate how much value different actions bring to different objectives. There are five objectives: Civil rights, woman's rights, religion, national values and democracy. Under "Evaluate happiness and values" you can tell how much value different actions bring to different objectives. Value practically means the improving of the conditions having to do with an objective. Type in the Actionid and then choose the objective you want to evaluate and the value the action would bring to it from the drop-down menus. The evaluation of values related to actions is possible as soon as the actions are suggested. You can only evaluate the value once per action and objective.
The value of each action given to the objective is summarised from all layers the same way as the happiness scores and are used to determine how much it promotes the different social objectives. Making decisions that make things better in respect to these objectives is also the point of the game.

Overview of the decisions

In time, you will make a lot of decisions. You can see and overview of these decisions under "Game results" by clicking "Run code". It shows you a graph of a cumulative timeline so that every day your decision will take you up or down in the eyes of different groups (see "Happiness" above) or different objectives (see "Values" above), compared with the majority vote. This gives you an idea of what kind of decisions you have on average made and how you have answered compared to other players. You should try to get the happiness scores of different groups as well as the objectives as high as possible.

Game results

See the top of the page for the main questionnaire of the game. Here we present results from the game.

+ Show code

Setup profile

Setup your profile. Do this before you start. You may change your preferences later.

Into which group do you identify most? (You only need to choose once):

+ Show code

See all suggested issues and actions

Issues and actions for which day?:
..

Do you want to see a single day or all?:

+ Show code

Suggest issues and actions

What is the issue (decision) that should be played? (briefly):

Give a more detailed description.:

When should this issue be played?:
..

+ Show code

What is the Issueid (from 'See all actions') of an issue?:

What is the action you suggest to this issue? (briefly):

Give a more detailed description.:

+ Show code

Vote for issues and actions

What is the Issueid (from 'See all actions') of the issue that should be played?:

+ Show code

What is the Actionid (from 'See all actions') of the action you vote for?:

+ Show code

Evaluate happiness and values

What is the Actionid (from 'See all actions') of the action you want to score?:

How much happiness would this option bring to this group?:

+ Show code

What is the Actionid (from 'See all actions') of the action you want to score?:

Select an objective to evaluate:

How much value would this action bring?:

+ Show code

Rationale

There is no need to edit the wiki page. Everything can be written into the text slots and uploaded by pressing the respective buttons. You can also create a full day's simulated activity in tables and copy-paste those directly. There is an example file that I used for uploading today's game at the end of the page.

Calculations

What is the database table?:

Insert data as table:

Cancel

+ Show code


+ Show code

Structure and functionalities

Data structure of the great game. Each blue box is a data table. Arrows show the information flows. Happiness and value performances are calculated based on decisions and scores estimated by the players (or researchers?). Upload data and select newest are generic functions needed to operate with the data.

The content of and use of the data tables is the following:

  • Issues: List of decisions to be made. A user can suggest only one issue per day. For each day, the most popular issue is taken to the game.
  • Actions: List of decision options to be made. A user can suggest only one action per issue. For each time point, two most popular actions are taken to the game. However, the actions in the game may change during the day, if the rank of the issues changes.
  • Issue vote: List of votes for each issue. Each user can cast a single vote either for or against an issue. The number of votes a user has equals their bonuses.
  • Action vote: List of votes for each action under issues. The voting system is the same as for issues.
  • Decisions: List of decisions each user makes from the actions and issues on the game.
  • Bonuses: List of bonuses the users have earned during the game. In the beginning, each user has 1 bonus. You can earn bonuses if your actions suggestions gets to be played (+1) or if your issues gets to be played (+5). Every time a user makes a decision, they get +0.1 bonus.
  • Happiness: Users' opinions about how much happiness an action brings to their own group.
  • Values: Users' opinions about how much value an action brings to a selected group.
  • Users: List of users' groups (i.e. to which group each user identifies themselves).

The functions needed are the following.

  • Upload data: Take the data provided by the user or calculated. Add automatic fields, e.g. ts, user and date. Upload data to the respective table.
  • Create ovariable: Download data from a table. From the data, find the unique rows with a given condition (e.g. discard previous decisions made by a user previously on the same day). Then create an ovariable with the structure needed.
  • Firstuser: Check's whether user's wiki_username is found from Bonuses. If not, it is added there and 1 bonus given.

The interface codes used are the following:

  • Suggest issues: Ask date, issue and description from user. Date means the date when this issue will be played. Default is today, but user can change that and suggest future issues. Timestamp (ts) come automatically. User is the wiki_username. Upload data to Issues table. No need to check previous entries. Upload user's bonus to Issue vote as number of votes.
  • Show issues: Ask date (today by default) and show all issues and each one's actions listed from the most to least popular. This is necessary for suggesting actions.
  • Show today's issue: Ask nothing. Show today's top-ranked issue and its two top-ranked actions. [Calculate the sum of results over all users. Show these popularity sums as the result of object popularity? Select the most popular row among a group defined by an index; use oapply to integrate over the index using which.max and pick that row only. Should this be a function or ovariable?]
  • Suggest actions: Ask date, issue, action and description from user. Date is today by default. Ts and user come as previously. If the date-issue pair does not exist in Issues table, give error message. Upload data to Actions and user's bonus to Action vote.
  • Vote for issue: Ask the rank number of the issue as a number. The user can check the numbers with Show issues. Date, user, and ts come automatically. Do firstuser. Votes is the number of user's bonuses and comes from Bonuses. Upload data to Issue vote. Store information about the rank before voting somewhere (as an ovariable or a technical data table?). If the information has changed from the last time, give bonus to the user whose information is now on the top.
  • Vote for action: Similar to vote for issue, except that the action number is asked and data is uploaded to Action vote.
  • Make decision: Ask the action from the two top choices of the most popular issue using a drop-down list. The options can be seen with show today's issue. Upload data to Decisions. However, if an issue was the most popular at some point during the day, it is still kept in the issue list. ----#: . Is it? How? --Jouni (talk) 17:21, 7 February 2016 (UTC) (type: truth; paradigms: science: comment)
  • Evaluate happiness: Ask date (today is the default), action number from show issues for that date, and hscore for happiness score in the user's own group. Ts, user as previously. Check if user has a group in Users and if not, give an error message to sign up to a group first. Upload data to Happiness.
  • Evaluate values: As evaluate happiness, except that unlike group, the value is asked from the user and nothing is checked. Upload data to Values.
  • Manage profile: Ask the group to which user identifies themselves. Take user and ts as previously. Add data to Users.
  • Show results: This code is divided into several parts:
    • Show happiness performance: Ask nothing. From Decisions, take the action of each day; do this separately for You, the user's own decisions, and Crowd, i.e. the most popular action of each day. Combine that with the happiness scores from Happiness. Show cumulative happiness across time for both decision makers.
    • Show value performance: Similar to show happiness performance, but for values from Values. It is imprtant to notice that value scores for each action are only partly a matter of opinion and partly a matter of research. Therefore, ideas should be developed how this research is gathered and used.
    • Show situation': Show the situation of the current issue: the issue and description, and the two actions and their votes.
    • Show all issues: Show all issues and actions and their votes for today.


Important categories
Groups for Turkey Value categories
  • Nationalists
  • Conservatives
  • Minorities
  • Liberals
  • Kemalists
  • Civil Rights
  • Women's Rights
  • Religion
  • National Values
  • Democracy

See also


Keywords

References


Related files

Great game of Turkey seed data Example data to be copied in for a new day.