[virtualcommons-svn] SF.net SVN: virtualcommons:[481] foraging/trunk/src/main
Status: Beta
Brought to you by:
alllee
From: <al...@us...> - 2010-03-04 00:20:20
|
Revision: 481 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=481&view=rev Author: alllee Date: 2010-03-04 00:20:10 +0000 (Thu, 04 Mar 2010) Log Message: ----------- refactoring round + server configuration and prepping configuration files for spring voting + field of vision pretests Modified Paths: -------------- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/GameWindow2D.java foraging/trunk/src/main/java/edu/asu/commons/foraging/client/InstructionsView.java foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/ServerConfiguration.java foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorWindow.java foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fov/round0.xml foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fov/round1.xml foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fov/round2.xml foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fov/round3.xml foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fov/round4.xml foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fov/server.xml Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/client/GameWindow2D.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/GameWindow2D.java 2010-03-03 07:07:30 UTC (rev 480) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/client/GameWindow2D.java 2010-03-04 00:20:10 UTC (rev 481) @@ -93,16 +93,6 @@ private ChatPanel chatPanel; - public final static String[] roleDescription = { - "Monitor: You cannot harvest but can sanction other participants\n" + - "To sanction press numbers from 1-5. At the end of the round you\n" + - "will receive 25% tokens from every other participant", - "Harvest: You can collect tokens as in earlier rounds. But you \n" + - "cannot sanction", - "Sanction: You cannot harvest but only sanction \n", - "Harvest and Sanction: You can collect tokens and at the same & \n" + - "at the same time sanction other participants"}; - private RegulationPanel regulationPanel; private EnforcementPanel enforcementPanel; @@ -119,19 +109,10 @@ public Timer timer; - public static final Object regulationSignal = new Object(); - - public static final Object enforcementVotesSignal = new Object(); - - public static final Object regulationVotesSignal = new Object(); - - public static final Object clientRoleSignal = new Object(); - private final StringBuilder instructionsBuilder = new StringBuilder(); private EventChannel channel; - private CardLayout cardLayout; // private EnergyLevel energyLevel; @@ -182,7 +163,6 @@ } // don't display next round time, instead wait for the // facilitator signal. - timeLeftLabel.setText("Waiting for facilitator's signal."); informationLabel.setText("Waiting for facilitator's signal."); // add the next round instructions to the existing debriefing text set by the previous @@ -199,6 +179,8 @@ Properties actualAnswers = formEvent.getData(); // actualAnswers.list(System.err); List<String> incorrectAnswers = new ArrayList<String>(); + // FIXME: always send a quiz response event. + // iterate through expected answers for (Map.Entry<String, String> entry : configuration.getQuizAnswers().entrySet()) { String questionNumber = entry.getKey(); @@ -255,7 +237,6 @@ } private void startEnforcementVotingTimer() { - if (timer == null) { //FIXME: Need to fetch this value from the round4.xml duration = Duration.create(dataModel.getRoundConfiguration().getEnforcementVotingDuration()); @@ -388,8 +369,6 @@ instructionsScrollPane.requestFocusInWindow(); } - - private HtmlEditorPane createInstructionsEditorPane() { // JEditorPane pane = new JEditorPane("text/html", // "Costly Sanctioning Experiment"); @@ -686,7 +665,7 @@ event.getCurrentTokens(), getIncome(event.getCurrentTokens())) ); - double showUpFee = dataModel.getRoundConfiguration().getParentConfiguration().getShowUpFee(); + double showUpFee = dataModel.getRoundConfiguration().getParentConfiguration().getShowUpPayment(); instructionsBuilder.append(String.format("Your <b>total income</b> so far (including a $%3.2f bonus for showing up) is : $%3.2f<hr>", showUpFee, dataModel.getTotalIncome() + showUpFee)); if (event.isLastRound()) { @@ -749,7 +728,14 @@ public void showInstructions() { RoundConfiguration roundConfiguration = dataModel.getRoundConfiguration(); instructionsBuilder.delete(0, instructionsBuilder.length()); - instructionsBuilder.append(roundConfiguration.getInstructions()); + if (roundConfiguration.isFirstRound()) { + instructionsBuilder.append(roundConfiguration.getGeneralInstructions()); + } + if (roundConfiguration.isFieldOfVisionEnabled()) { + instructionsBuilder.append(roundConfiguration.getFieldOfVisionInstructions()); + } + instructionsBuilder.append(roundConfiguration.getInstructions()); + // and add the quiz instructions if the quiz is enabled. if (roundConfiguration.isQuizEnabled()) { @@ -760,6 +746,7 @@ instructionsEditorPane.setActionListener(null); instructionsEditorPane.setActionListener(createQuizListener(roundConfiguration)); } + setInstructions(instructionsBuilder.toString()); } public void switchInstructionsPane() { Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/client/InstructionsView.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/InstructionsView.java 2010-03-03 07:07:30 UTC (rev 480) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/client/InstructionsView.java 2010-03-04 00:20:10 UTC (rev 481) @@ -66,7 +66,7 @@ if (roundConfiguration.isPracticeRound()) { instructionsBuilder.append("<h3>Note - since this was a practice round you did not earn any income this round.</h3>"); } - double showUpFee = roundConfiguration.getParentConfiguration().getShowUpFee(); + double showUpFee = roundConfiguration.getParentConfiguration().getShowUpPayment(); instructionsBuilder.append(String.format("Your <b>total income</b> so far (including a $%3.2f bonus for showing up) is : $%3.2f<hr>", showUpFee, dataModel.getTotalIncome() + showUpFee)); if (lastRound) { Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java 2010-03-03 07:07:30 UTC (rev 480) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java 2010-03-04 00:20:10 UTC (rev 481) @@ -425,9 +425,17 @@ } public String getWelcomeInstructions() { - return getStringProperty("welcome-instructions", "Please wait quietly and do not open or close any programs on this computer."); + return getParentConfiguration().getWelcomeInstructions(); } + public String getGeneralInstructions() { + return getParentConfiguration().getGeneralInstructions(); + } + + public String getFieldOfVisionInstructions() { + return getParentConfiguration().getFieldOfVisionInstructions(); + } + public EnforcementMechanism[] getEnforcementMechanisms() { return EnforcementMechanism.values(); } @@ -435,5 +443,9 @@ public boolean isVotingAndRegulationEnabled() { return getBooleanProperty("voting-and-regulation-enabled", false); } + + public boolean isFieldOfVisionEnabled() { + return isTokensFieldOfVisionEnabled() || isSubjectsFieldOfVisionEnabled(); + } } Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/ServerConfiguration.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/ServerConfiguration.java 2010-03-03 07:07:30 UTC (rev 480) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/ServerConfiguration.java 2010-03-04 00:20:10 UTC (rev 481) @@ -63,8 +63,22 @@ return false; } - public double getShowUpFee() { - return assistant.getDoubleProperty("show-up-fee", 5.0d); + public double getShowUpPayment() { + return assistant.getDoubleProperty("show-up-payment", 5.0d); } + + public String getWelcomeInstructions() { + return assistant.getStringProperty("welcome-instructions", "Please wait quietly and do not open or close any programs on this computer."); + } + + public String getGeneralInstructions() { + return assistant.getStringProperty("general-instructions", ""); + } + + public String getFieldOfVisionInstructions() { + return assistant.getProperty("field-of-vision-instructions", + "Your vision is limited in this experiment. The area that is visible to you will be shaded."); + } + } Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorWindow.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorWindow.java 2010-03-03 07:07:30 UTC (rev 480) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorWindow.java 2010-03-04 00:20:10 UTC (rev 481) @@ -354,7 +354,7 @@ clientId.toString(), data.getCurrentTokens(), getIncome(data.getCurrentTokens()), - data.getTotalIncome() + facilitator.getServerConfiguration().getShowUpFee())); + data.getTotalIncome() + facilitator.getServerConfiguration().getShowUpPayment())); } builder.append("</tbody></table><hr>"); if (event.isLastRound()) { Modified: foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fov/round0.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fov/round0.xml 2010-03-03 07:07:30 UTC (rev 480) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fov/round0.xml 2010-03-04 00:20:10 UTC (rev 481) @@ -15,47 +15,8 @@ <entry key="q1">C</entry> <entry key="q2">B</entry> -<entry key="instructions"> +<entry key='instructions'> <![CDATA[ -<h3>General Instructions</h3> -<p> -You will appear on the screen as a yellow dot <img -src="@CODEBASE_URL@/images/gem-self.gif">, You can move by pressing the four arrow -keys on your keyboard. You can move either up, down, left, or right. You have to -press a key for each and every move of your yellow dot. In this experiment you can -collect green diamond shaped tokens -<img src="@CODEBASE_URL@/images/gem-token.gif"> and you will -earn two cents for each collected token. To collect a token, simply move your -yellow dot over a green token and press the <b>space bar</b>. If you move -over a token without pressing the <b>space bar</> you will NOT collect that -token. -</p> - -<p> -The tokens that you collect have the potential to regenerate. After you have -collected a green token, a new token can once again appear on that empty cell. -However, the rate at which new tokens will appear depends on the number of -adjacent cells that still have tokens. The more tokens in the 8 cells around -an empty cell, the faster a new token will appear on that empty cell. Existing -tokens can generate new tokens. Thus the middle cell in Image 1 denoted with X will -be regenerated at a faster rate than the middle cell in Image 2. When all -neighboring cells are empty, there is no renewal. - -<table width="100%"> -<tr> -<td align="center"><b>Image 1</b></td> -<td align="center"><b>Image 2</b></td> -</tr> -<tr> -<td align="center"> -<img src="@CODEBASE_URL@/images/8neighbors.jpg" alt="image 1"> -</td> -<td align="center"> -<img src="@CODEBASE_URL@/images/5neighbors.jpg" alt="image 2"> -</td> -</tr> -</table> -<hr> <h3>Practice Round Instructions</h3> <hr> <p> @@ -65,11 +26,11 @@ with green tokens. The environment is a 13 x 13 grid of cells. </p> <p> -When you push the <b>R</b> key you will reset the distribution of -the tokens to randomly occupying half of the cells with green tokens. +During this practice round, and <b>only during</b> this practice round, you are able +to reset the tokens displayed on the screen by pressing the <b>R</b> key. When you +press the <b>R</b> key you will reset the resource to its initial distribution, +randomly filling half of the cells. </p> - -<p><center><b>Please do not communicate with any other participant.</b></center></p> <p>If you have any questions please raise your hand. <b>Do you have any questions so far?</b></p> ]]> @@ -104,18 +65,5 @@ </form> ]]> </entry> -<entry key="welcome-instructions"> -<![CDATA[ -<h3>Welcome</h3> -<p> -Welcome. You have already earned 5 dollars for showing up at this experiment. -You can earn more, up to a maximum of 40 dollars, by participating in this -experiment, which will take about an hour. The amount of money you earn -depends on your decisions as well as the decisions of your group members -during the four rounds of the experiment. Please be patient while the rest of the -participants are seated, the experiment will begin shortly. -</p> -]]> -</entry> </properties> Modified: foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fov/round1.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fov/round1.xml 2010-03-03 07:07:30 UTC (rev 480) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fov/round1.xml 2010-03-04 00:20:10 UTC (rev 481) @@ -1,25 +1,19 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> <properties> -<comment>Foraging XML-ized experiment round configuration</comment> +<comment>Foraging XML experiment round configuration</comment> <entry key="display-group-tokens">true</entry> <entry key="clients-per-group">5</entry> <entry key="duration">240</entry> <entry key="resource-depth">29</entry> <entry key="resource-width">29</entry> -<entry key='resource-generator'>mobile</entry> -<entry key='starting-tokens'>10</entry> -<entry key='dollars-per-token'>.10</entry> - <entry key='tokens-field-of-vision'>true</entry> <entry key='subjects-field-of-vision'>true</entry> <entry key='always-explicit'>true</entry> <entry key='max-cell-occupancy'>1</entry> - - <entry key="instructions"> <![CDATA[ <h3>Round 1 Instructions</h3> Modified: foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fov/round2.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fov/round2.xml 2010-03-03 07:07:30 UTC (rev 480) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fov/round2.xml 2010-03-04 00:20:10 UTC (rev 481) @@ -9,9 +9,7 @@ <entry key="resource-width">29</entry> -<entry key='resource-generator'>mobile</entry> -<entry key='starting-tokens'>10</entry> -<entry key='dollars-per-token'>.10</entry> +<entry key='initial-distribution'>.25</entry> <entry key='tokens-field-of-vision'>true</entry> <entry key='subjects-field-of-vision'>true</entry> Modified: foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fov/round3.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fov/round3.xml 2010-03-03 07:07:30 UTC (rev 480) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fov/round3.xml 2010-03-04 00:20:10 UTC (rev 481) @@ -8,25 +8,12 @@ <entry key="resource-depth">29</entry> <entry key="resource-width">29</entry> -<entry key='resource-generator'>mobile</entry> -<entry key='tokens-field-of-vision'>true</entry> -<entry key='subjects-field-of-vision'>true</entry> - <entry key='always-explicit'>true</entry> <entry key='max-cell-occupancy'>1</entry> <!-- resource regrowth parameters --> <entry key="initial-distribution">.25</entry> -<entry key="regrowth-rate">0.01</entry> -<!-- -<entry key="patchy">true</entry> -<entry key="top-initial-distribution">0.50</entry> -<entry key="top-rate">0.02</entry> -<entry key="bottom-initial-distribution">0.25</entry> -<entry key="bottom-rate">0.01</entry> ---> - <entry key="instructions"> <![CDATA[ <h3>Round 3 Instructions</h3> Modified: foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fov/round4.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fov/round4.xml 2010-03-03 07:07:30 UTC (rev 480) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fov/round4.xml 2010-03-04 00:20:10 UTC (rev 481) @@ -8,10 +8,6 @@ <entry key="resource-width">29</entry> <entry key="duration">240</entry> -<entry key='resource-generator'>mobile</entry> -<entry key='tokens-field-of-vision'>true</entry> -<entry key='subjects-field-of-vision'>true</entry> - <entry key='always-explicit'>true</entry> <entry key='max-cell-occupancy'>1</entry> @@ -26,7 +22,6 @@ <entry key="initial-distribution">.25</entry> -<entry key="regrowth-rate">0.01</entry> <!-- enable quiz --> <entry key='quiz'>true</entry> @@ -154,5 +149,4 @@ </form> ]]> </entry> - </properties> Modified: foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fov/server.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fov/server.xml 2010-03-03 07:07:30 UTC (rev 480) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fov/server.xml 2010-03-04 00:20:10 UTC (rev 481) @@ -27,10 +27,72 @@ </p> ]]> </entry> + <entry key='field-of-vision-instructions'> <![CDATA[ Your vision is limited in this experiment. The area that is visible to you will be -shaded in gray. +shaded. ]]> </entry> + +<entry key="welcome-instructions"> +<![CDATA[ +<h3>Welcome to the experiment. The experiment will begin shortly after everyone has been +assigned a station.</h3> +<p> +Please <b>wait quietly</b> and <b>do not close this window or open any other applications</b>. +</p> +]]> +</entry> + +<entry key="general-instructions"> +<![CDATA[ +<h3>General Instructions</h3> +<p> +Welcome. You have already earned 5 dollars by showing up at this experiment. You can +earn more, up to a maximum of 40 dollars, by participating in this experiment, which +will take about an hour to an hour and a half. The amount of money you earn depends +on your decisions as well as the decisions of other people in this room during the +six rounds of the experiment. +</p> +<p> +You appear on the screen as a yellow dot <img src="@CODEBASE_URL@/images/gem-self.gif">. +You move by pressing the four arrow keys on your keyboard. You can move up, down, +left, or right. You have to press a key for each and every move of your yellow dot. +In this experiment you can collect green diamond shaped tokens +<img src="@CODEBASE_URL@/images/gem-token.gif"> and earn two cents for each collected token. +To collect a token, move your yellow dot over a green token and press the <b>space +bar</b>. If you move over a token without pressing the <b>space bar</> you do NOT +collect that token. +</p> + +<p> +The tokens that you collect have the potential to regenerate. After you have +collected a green token, a new token can re-appear on that empty cell. +However, the rate at which new tokens will appear depends on the number of +adjacent cells with tokens. The more tokens in the eight cells around +an empty cell, the faster a new token will appear on that empty cell. In other +words, <b>existing tokens can generate new tokens</b>. To illustrate this, please +see refer to Image 1 and Image 2. The middle cell in Image 1 denoted with an X has +a greater chance of regeneration than the middle cell in Image 2. When all +neighboring cells are empty, there is <b>no chance for regeneration</b>. + +<table width="100%"> +<tr> +<td align="center"><b>Image 1</b></td> +<td align="center"><b>Image 2</b></td> +</tr> +<tr> +<td align="center"> +<img src="@CODEBASE_URL@/images/8neighbors.jpg" alt="image 1"> +</td> +<td align="center"> +<img src="@CODEBASE_URL@/images/5neighbors.jpg" alt="image 2"> +</td> +</tr> +</table> +]]> +</entry> + + </properties> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |