[virtualcommons-svn] commit/foraging: 2 new changesets
Status: Beta
Brought to you by:
alllee
From: Bitbucket <com...@bi...> - 2012-01-12 20:19:29
|
2 new commits in foraging: https://bitbucket.org/virtualcommons/foraging/changeset/cc86ea7d6493/ changeset: cc86ea7d6493 user: alllee date: 2012-01-12 20:41:59 summary: - more instructions fixes & improvements, changing tags to be HTML 3.2 to comply with Java's HTMLEditorKit support. - adding id attribute to last round debriefing so we can properly associate payments, may need to tweak how csidex SocketIdentifier renders itself affected #: 10 files diff -r c55e94b5c6b7d769cef350cb593801d9d7b81c13 -r cc86ea7d6493a94fd85152f634d764ccd8d14481 src/main/java/edu/asu/commons/foraging/client/ClientDataModel.java --- a/src/main/java/edu/asu/commons/foraging/client/ClientDataModel.java +++ b/src/main/java/edu/asu/commons/foraging/client/ClientDataModel.java @@ -284,4 +284,8 @@ throw new UnsupportedOperationException("3D support is currently unavailable"); } + public String getLastRoundDebriefing() { + return getRoundConfiguration().getLastRoundDebriefing(getId()); + } + } diff -r c55e94b5c6b7d769cef350cb593801d9d7b81c13 -r cc86ea7d6493a94fd85152f634d764ccd8d14481 src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java --- a/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java +++ b/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java @@ -336,8 +336,10 @@ return getProperty("regulation-instructions"); } - public String getLastRoundDebriefing() { - return getProperty("last-round-debriefing"); + public String getLastRoundDebriefing(Identifier id) { + ST template = createStringTemplate(getProperty("last-round-debriefing")); + template.add("id", id); + return template.render(); } /** @@ -751,9 +753,11 @@ ST template = createStringTemplate(getProperty("quiz-results")); // FIXME: actual answers includes the submit button, so there's an off-by-one that we need to deal with. int totalQuestions = actualAnswers.size() - 1; + int numberCorrect = totalQuestions - incorrectQuestionNumbers.size(); template.add("allCorrect", incorrectQuestionNumbers.isEmpty()); - template.add("numberCorrect", totalQuestions - incorrectQuestionNumbers.size()); + template.add("numberCorrect", numberCorrect); template.add("totalQuestions", totalQuestions); + template.add("totalQuizEarnings", NumberFormat.getCurrencyInstance().format(getQuizCorrectAnswerReward() * numberCorrect)); for (String incorrectQuestionNumber : incorrectQuestionNumbers) { template.add("incorrect_" + incorrectQuestionNumber, String.format("Your answer, %s, was incorrect.", actualAnswers.get(incorrectQuestionNumber))); } diff -r c55e94b5c6b7d769cef350cb593801d9d7b81c13 -r cc86ea7d6493a94fd85152f634d764ccd8d14481 src/main/java/edu/asu/commons/foraging/ui/GameWindow2D.java --- a/src/main/java/edu/asu/commons/foraging/ui/GameWindow2D.java +++ b/src/main/java/edu/asu/commons/foraging/ui/GameWindow2D.java @@ -633,7 +633,7 @@ // for (String trustGameLog : event.getTrustGameLog()) { // instructionsBuilder.append(trustGameLog); // } - instructionsBuilder.append(client.getDataModel().getRoundConfiguration().getLastRoundDebriefing()); + instructionsBuilder.append(client.getDataModel().getLastRoundDebriefing()); timeLeftLabel.setText("The experiment is now over."); } setInstructions(instructionsBuilder.toString()); @@ -662,7 +662,7 @@ instructionsBuilder.append(String.format("Your <b>total income</b> so far is: $%3.2f<hr>", getIncome(clientData.getTotalTokens()))); if (event.isLastRound()) { - instructionsBuilder.append(client.getDataModel().getRoundConfiguration().getLastRoundDebriefing()); + instructionsBuilder.append(client.getDataModel().getLastRoundDebriefing()); } setInstructions(instructionsBuilder.toString()); diff -r c55e94b5c6b7d769cef350cb593801d9d7b81c13 -r cc86ea7d6493a94fd85152f634d764ccd8d14481 src/main/java/edu/asu/commons/foraging/ui/InstructionsView.java --- a/src/main/java/edu/asu/commons/foraging/ui/InstructionsView.java +++ b/src/main/java/edu/asu/commons/foraging/ui/InstructionsView.java @@ -64,7 +64,7 @@ instructionsBuilder.append(String.format("Your <b>total income</b> so far (including a $%3.2f bonus for showing up) is : $%3.2f<hr>", showUpPayment, dataModel.getTotalIncome() + showUpPayment)); if (lastRound) { - instructionsBuilder.append(roundConfiguration.getLastRoundDebriefing()); + instructionsBuilder.append(dataModel.getLastRoundDebriefing()); } setInstructions(instructionsBuilder.toString()); } diff -r c55e94b5c6b7d769cef350cb593801d9d7b81c13 -r cc86ea7d6493a94fd85152f634d764ccd8d14481 src/main/resources/configuration/asu-experiments/2011/t1/round0.xml --- a/src/main/resources/configuration/asu-experiments/2011/t1/round0.xml +++ b/src/main/resources/configuration/asu-experiments/2011/t1/round0.xml @@ -69,9 +69,9 @@ <hr><p> {if (allCorrect)} - You have answered all the questions correctly. + You have answered all the questions correctly and earned <b>{totalQuizEarnings}</b>. {else} - YOu answered {numberCorrect}/{totalQuestions} questions correctly. Questions you've answered + You answered {numberCorrect} out of {totalQuestions} questions correctly and earned <b>{totalQuizEarnings}</b>. Questions you've answered incorrectly are highlighted in red. Please see below for more details. {endif} </p> diff -r c55e94b5c6b7d769cef350cb593801d9d7b81c13 -r cc86ea7d6493a94fd85152f634d764ccd8d14481 src/main/resources/configuration/asu-experiments/2011/t1/round1.xml --- a/src/main/resources/configuration/asu-experiments/2011/t1/round1.xml +++ b/src/main/resources/configuration/asu-experiments/2011/t1/round1.xml @@ -15,7 +15,7 @@ <entry key="instructions"><![CDATA[ -<h3>Round 1 Instructions</h3> +<h3>Round {roundNumber} Instructions</h3><hr><p> This is the first round of the experiment. The length of the round is @@ -23,31 +23,37 @@ you will earn <b>{dollarsPerToken}</b> for each token collected. You <b>cannot</b> reset the distribution of green tokens. </p> +<h3>Groups</h3> +<hr><p> -In this round the renewable resource will become five times bigger. You will share -this larger environment with four other players in this room that have been randomly -selected. Each group's resource environment is distinct from the other groups. +In this round the renewable resource will become five times bigger. You will share this +larger environment with four other random players in this room. In particular, +each of you in this room has been randomly assigned to one of several equal-sized {clientsPerGroup} +person groups and everyone in your group has been randomly assigned a number from 1 +to {clientsPerGroup}. You will stay in the same group for the entire experiment, and each person's +number from 1 to {clientsPerGroup} will remain the same throughout the experiment. +The other three people in your group will appear on the screen as blue dots +<img src="@CODEBASE_URL@/images/gem-other.gif"> with a white number embedded in the dot. </p><p> - Each of you has been assigned a number from 1 to {clientsPerGroup}. These - numbers will remain the same throughout the experiment but you will <b>not</b> - be able to identify which person in the room has been assigned which number, so - your anonymity is guaranteed. + In each round of the token task, you can see how many tokens each player has + collected at the top right corner of the screen. On the top left corner of the + screen you will see the remaining time in the round. </p> - +<h3>Anonymity</h3> +<hr><p> -The other players will appear on the screen as blue dots <img - src="@CODEBASE_URL@/images/gem-other.gif"> with a white number embedded in the - dot. On the top right corner of the screen you can see how many tokens each - player has collected. On the top left corner of the screen you can see a clock - that displays the remaining time in the round.</p><p>Since you can only see the - resource within your vision you may neither see all the other participants nor - all the resource units. The figure below indicates the vision range compared to - the whole environment</p> -<img src="@CODEBASE_URL@/images/vision-range.jpg"> -<p> -<p><b>Do you have any questions?</b> If you have any questions at this time please raise your hand and someone will come over to your station and answer it.</p> + Because group membership was randomly assigned by the computer, neither you nor + the experimenter will be able to identify which person in the room has been + assigned to a particular group or number within a group. Your anonymity is + guaranteed. </p> +<h3>Tokens</h3> +<hr> + <p> + Each group has its own set of token resources. + </p> +<p><b>Do you have any questions so far?</b> If you have any questions at this time, raise your hand and someone will come over to your station and answer it.</p> ]]></entry><entry key="chat-instructions"> diff -r c55e94b5c6b7d769cef350cb593801d9d7b81c13 -r cc86ea7d6493a94fd85152f634d764ccd8d14481 src/main/resources/configuration/asu-experiments/2011/t1/round4.xml --- a/src/main/resources/configuration/asu-experiments/2011/t1/round4.xml +++ b/src/main/resources/configuration/asu-experiments/2011/t1/round4.xml @@ -18,6 +18,8 @@ <entry key='in-round-chat-enabled'>true</entry><entry key="initial-distribution">.25</entry> +<entry key='resource-generator'>top-bottom-patchy</entry> + <entry key="instructions"><![CDATA[ <h3>Round {roundNumber} Instructions</h3> diff -r c55e94b5c6b7d769cef350cb593801d9d7b81c13 -r cc86ea7d6493a94fd85152f634d764ccd8d14481 src/main/resources/configuration/asu-experiments/2011/t1/round5.xml --- a/src/main/resources/configuration/asu-experiments/2011/t1/round5.xml +++ b/src/main/resources/configuration/asu-experiments/2011/t1/round5.xml @@ -13,5 +13,6 @@ <entry key='always-explicit'>true</entry><entry key='max-cell-occupancy'>1</entry><entry key="in-round-chat-enabled">true</entry> +<entry key='resource-generator'>top-bottom-patchy</entry></properties> diff -r c55e94b5c6b7d769cef350cb593801d9d7b81c13 -r cc86ea7d6493a94fd85152f634d764ccd8d14481 src/main/resources/configuration/asu-experiments/2011/t1/round6.xml --- a/src/main/resources/configuration/asu-experiments/2011/t1/round6.xml +++ b/src/main/resources/configuration/asu-experiments/2011/t1/round6.xml @@ -17,22 +17,32 @@ <entry key='trust-game'>true</entry> +<entry key='resource-generator'>top-bottom-patchy</entry> + <entry key="last-round-debriefing"><![CDATA[ +<h2>Survey</h2> +<hr><p> This was the last round, but not the end of the experiment. We will now determine your payments. While we are doing this, we request that you carefully fill out a brief survey. </p> +<h2>Payments</h2> +<hr> + <p>NOTE: Your computer number is <b>{id}</b></p><p> When we are ready we will call you one by one to the room next door. We will -pay you there in private. Please wait until your computer number is called, -and then proceed to the room next door to turn in your computer number and +pay you there in private. Please wait until your computer number, <b>{id}</b>, is +called, and then proceed to the room next door to turn in your computer number and your survey. </p><p> Please answer the survey carefully and thank you for participating. </p> + + + ]]></entry></properties> diff -r c55e94b5c6b7d769cef350cb593801d9d7b81c13 -r cc86ea7d6493a94fd85152f634d764ccd8d14481 src/main/resources/configuration/asu-experiments/2011/t1/server.xml --- a/src/main/resources/configuration/asu-experiments/2011/t1/server.xml +++ b/src/main/resources/configuration/asu-experiments/2011/t1/server.xml @@ -56,6 +56,7 @@ <entry key="general-instructions"><![CDATA[ <h1>General Instructions</h1> +<hr><p><b>Welcome</b>. You have already earned {showUpPayment} dollars just for showing up at this experiment. </p> @@ -100,10 +101,10 @@ </tr><tr><td align="center"> - <img src="@CODEBASE_URL@/images/8neighbors.jpg" alt="image 1"></img> + <img src="@CODEBASE_URL@/images/8neighbors.jpg" alt="image 1"></td><td align="center"> - <img src="@CODEBASE_URL@/images/5neighbors.jpg" alt="image 2"></img> + <img src="@CODEBASE_URL@/images/5neighbors.jpg" alt="image 2"></td></tr></table> @@ -117,7 +118,7 @@ regrowth. The best arrangement of tokens that maximizes overall regrowth is the checkerboard diagram shown below. <br> -<img src="@CODEBASE_URL@/images/foraging-checkerboard.png" alt="Checkerboard Resource"></img> +<img src="@CODEBASE_URL@/images/foraging-checkerboard.png" alt="Checkerboard Resource"></p> ]]></entry> https://bitbucket.org/virtualcommons/foraging/changeset/e1ee74e8c9c3/ changeset: e1ee74e8c9c3 user: alllee date: 2012-01-12 21:19:27 summary: more instructions + configuration refactoring affected #: 3 files diff -r cc86ea7d6493a94fd85152f634d764ccd8d14481 -r e1ee74e8c9c3e618593c88c0bb7a587121e22900 src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java --- a/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java +++ b/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java @@ -16,6 +16,7 @@ import edu.asu.commons.foraging.graphics.Point3D; import edu.asu.commons.foraging.model.ClientData; import edu.asu.commons.foraging.model.EnforcementMechanism; +import edu.asu.commons.foraging.model.ResourceDispenser; import edu.asu.commons.foraging.rules.ForagingRule; import edu.asu.commons.net.Identifier; import edu.asu.commons.util.Duration; @@ -39,6 +40,12 @@ */ public class RoundConfiguration extends ExperimentRoundParameters.Base<ServerConfiguration> { + private static final double DEFAULT_PATCHY_BOTTOM_INITIAL_DISTRIBUTION = 0.25; + + private static final double DEFAULT_PATCHY_TOP_INITIAL_DISTRIBUTION = 0.50; + + private static final double DEFAULT_TOP_REGROWTH_RATE = 0.02; + private final static long serialVersionUID = 8575239803733029326L; public final static double DEFAULT_REGROWTH_RATE = 0.01; @@ -430,23 +437,23 @@ } public double getTopRegrowthScalingFactor() { - return getDoubleProperty("top-rate", 0.02); + return getDoubleProperty("top-rate", DEFAULT_TOP_REGROWTH_RATE); } public double getBottomRegrowthScalingFactor() { - return getDoubleProperty("bottom-rate", 0.01); + return getDoubleProperty("bottom-rate", DEFAULT_REGROWTH_RATE); } public double getTopInitialResourceDistribution() { - return getDoubleProperty("top-initial-distribution", 0.50); + return getDoubleProperty("top-initial-distribution", DEFAULT_PATCHY_TOP_INITIAL_DISTRIBUTION); } public double getBottomInitialResourceDistribution() { - return getDoubleProperty("bottom-initial-distribution", 0.25); + return getDoubleProperty("bottom-initial-distribution", DEFAULT_PATCHY_BOTTOM_INITIAL_DISTRIBUTION); } public String getResourceGeneratorType() { - return getProperty("resource-generator", "density-dependent"); + return getProperty("resource-generator", ResourceDispenser.Type.DENSITY_DEPENDENT.toString()); } public int getWorldWidth() { diff -r cc86ea7d6493a94fd85152f634d764ccd8d14481 -r e1ee74e8c9c3e618593c88c0bb7a587121e22900 src/main/resources/configuration/asu-experiments/2011/t1/round1.xml --- a/src/main/resources/configuration/asu-experiments/2011/t1/round1.xml +++ b/src/main/resources/configuration/asu-experiments/2011/t1/round1.xml @@ -15,7 +15,7 @@ <entry key="instructions"><![CDATA[ -<h3>Round {roundNumber} Instructions</h3> +<h1>Round {roundNumber} Instructions</h1><hr><p> This is the first round of the experiment. The length of the round is @@ -26,14 +26,15 @@ <h3>Groups</h3><hr><p> -In this round the renewable resource will become five times bigger. You will share this -larger environment with four other random players in this room. In particular, -each of you in this room has been randomly assigned to one of several equal-sized {clientsPerGroup} -person groups and everyone in your group has been randomly assigned a number from 1 -to {clientsPerGroup}. You will stay in the same group for the entire experiment, and each person's -number from 1 to {clientsPerGroup} will remain the same throughout the experiment. -The other three people in your group will appear on the screen as blue dots -<img src="@CODEBASE_URL@/images/gem-other.gif"> with a white number embedded in the dot. +In this round the renewable resource will become five times bigger. You will share +this larger environment with four other random players in this room. Each +participant in the room has been randomly assigned to one of several equal-sized +{clientsPerGroup} person groups and everyone in your group has been randomly +assigned a number from 1 to {clientsPerGroup}. You will stay in the same group for +the entire experiment, and each person's number from 1 to {clientsPerGroup} will +remain the same throughout the experiment. The other members of your group will +appear on the screen as blue dots <img src="@CODEBASE_URL@/images/gem-other.gif"> +with a white number embedded in the dot. </p><p> In each round of the token task, you can see how many tokens each player has @@ -56,23 +57,4 @@ <p><b>Do you have any questions so far?</b> If you have any questions at this time, raise your hand and someone will come over to your station and answer it.</p> ]]></entry> -<entry key="chat-instructions"> -<![CDATA[ -<p> -You can chat with the other participants in your group during this round. -You may communicate about any aspect of the experiment that you would like to -discuss with other participants with whom you have been matched. You may not promise -them side-payments after the experiment is completed or threaten them with any -consequence after the experiment is finished. We are monitoring the chat traffic -while you chat. If we see that somebody reveals his or her identity, we have to stop -the experiment and remove the whole group from which this person is a member out of -this room. -</p> -<p> - You will see other participants labeled from 1 to {clientsPerGroup} in the chat - window. You can send a chat message by typing into the textfield and pressing - the enter key. -</p> -]]> -</entry></properties> diff -r cc86ea7d6493a94fd85152f634d764ccd8d14481 -r e1ee74e8c9c3e618593c88c0bb7a587121e22900 src/main/resources/configuration/asu-experiments/2011/t1/server.xml --- a/src/main/resources/configuration/asu-experiments/2011/t1/server.xml +++ b/src/main/resources/configuration/asu-experiments/2011/t1/server.xml @@ -167,18 +167,18 @@ <li>You <b>may not promise side-payments after the experiment is completed or threaten anyone with any consequence after the experiment is finished</b>.</li><li>You <b>may not reveal your actual identity</b></li></ol> +<p> We are monitoring the chat traffic while you chat. If we detect any violation of the -rules we will have to stop the the experiment and remove the group where the offense -occurred from the room. +rules we will have to stop the experiment and remove the offending group from the +room. </p><p> -You will see other participants labeled as "1", "2","3", "4", or "5" in the chat -box. You can send a chat message by typing into the textfield and pressing the -enter key. + You will see other participants labeled from 1 to {clientsPerGroup} in the chat + window. You can send a chat message by typing into the textfield and pressing + the enter key. </p> ]]></entry> - <entry key="sameRoundAsPreviousInstructions"><![CDATA[ <h3>Round {roundNumber} Instructions</h3> @@ -188,5 +188,4 @@ <p><b>Do you have any questions?</b> If you have any questions at this time please raise your hand and someone will come over to your station and answer it.</p> ]]></entry> - </properties> Repository URL: https://bitbucket.org/virtualcommons/foraging/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |