Thread: [virtualcommons-svn] SF.net SVN: virtualcommons:[116] foraging/trunk/src/main
Status: Beta
Brought to you by:
alllee
From: <al...@us...> - 2009-04-21 16:59:32
|
Revision: 116 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=116&view=rev Author: alllee Date: 2009-04-21 16:59:21 +0000 (Tue, 21 Apr 2009) Log Message: ----------- caching view subjects + tokens radius in client data, gets initialized during initializePosition and giving ClientData a little more intelligence about whether or not it can view another subject. For now logic for testing whether or not tokens are within the field of vision will still reside in SubjectView for optimization purposes, we don't want to recompute the Circle for every token that we want to render, though we could pass in a Collection<Point> and return a Collection<Point> that is filtered... Also tweaking the configuration a little bit for the pre-test treatment this afternoon. Modified Paths: -------------- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/Circle.java foraging/trunk/src/main/java/edu/asu/commons/foraging/client/GameWindow2D.java foraging/trunk/src/main/java/edu/asu/commons/foraging/client/SubjectView.java foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ClientData.java foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round0.xml Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/client/Circle.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/Circle.java 2009-04-20 20:24:46 UTC (rev 115) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/client/Circle.java 2009-04-21 16:59:21 UTC (rev 116) @@ -1,6 +1,7 @@ package edu.asu.commons.foraging.client; import java.awt.Point; +import java.io.Serializable; /** * $Id$ @@ -11,9 +12,11 @@ * @author <a href='mailto:All...@as...'>Allen Lee</a> * @version $Revision$ */ -public class Circle { - - private Point center; +public class Circle implements Serializable { + + private static final long serialVersionUID = 6400834001276229287L; + + private Point center; private final double radius; public Circle(Point center, double radius) { 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 2009-04-20 20:24:46 UTC (rev 115) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/client/GameWindow2D.java 2009-04-21 16:59:21 UTC (rev 116) @@ -366,8 +366,12 @@ // don't allow self-flagellation :-). return; } - event = new RealTimeSanctionRequest(dataModel.getId(), sanctionee); - dataModel.sanction(dataModel.getId(), sanctionee); + // only allow sanctions for subjects within this subject's field of vision + Point subjectPosition = dataModel.getClientDataMap().get(sanctionee).getPoint(); + if (dataModel.getClientData().isSubjectInFieldOfVision(subjectPosition)) { + event = new RealTimeSanctionRequest(dataModel.getId(), sanctionee); + dataModel.sanction(dataModel.getId(), sanctionee); + } } else return; break; Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/client/SubjectView.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/SubjectView.java 2009-04-20 20:24:46 UTC (rev 115) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/client/SubjectView.java 2009-04-21 16:59:21 UTC (rev 116) @@ -109,7 +109,7 @@ int characterHeight = fontMetrics.getAscent(); int verticalCharacterSpacing = (int) ( (dh - characterHeight) / 2); Circle fieldOfVision = null; - if (dataModel.getRoundConfiguration().isSubjectFieldOfVisionEnabled()) { + if (dataModel.getRoundConfiguration().isSubjectsFieldOfVisionEnabled()) { fieldOfVision = new Circle(dataModel.getCurrentPosition(), dataModel.getRoundConfiguration().getViewSubjectsRadius()); } for (Map.Entry<Identifier, ClientData> entry : positions.entrySet()) { 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 2009-04-20 20:24:46 UTC (rev 115) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java 2009-04-21 16:59:21 UTC (rev 116) @@ -104,12 +104,12 @@ return getBooleanProperty("tokens-field-of-vision", false); } - public boolean isSubjectFieldOfVisionEnabled() { + public boolean isSubjectsFieldOfVisionEnabled() { return getBooleanProperty("subjects-field-of-vision", false); } public double getViewSubjectsRadius() { - if (isSubjectFieldOfVisionEnabled()) { + if (isSubjectsFieldOfVisionEnabled()) { return getDoubleProperty("view-subjects-radius", 6.0d); } throw new UnsupportedOperationException("subject field of vision is not enabled."); Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ClientData.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ClientData.java 2009-04-20 20:24:46 UTC (rev 115) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ClientData.java 2009-04-21 16:59:21 UTC (rev 116) @@ -7,6 +7,7 @@ import java.util.Queue; import java.util.concurrent.TimeUnit; +import edu.asu.commons.foraging.client.Circle; import edu.asu.commons.foraging.conf.RoundConfiguration; import edu.asu.commons.foraging.event.RealTimeSanctionRequest; import edu.asu.commons.foraging.graphics.Point3D; @@ -42,6 +43,9 @@ private Duration freezeDuration; private LinkedList<RealTimeSanctionRequest> latestSanctions; private AnimationData animationData; + + private double viewSubjectsRadius; + private double viewTokensRadius; public ClientData(Identifier id) { this.id = id; @@ -84,6 +88,39 @@ } } + + + public Circle getSubjectsFieldOfVision() { + RoundConfiguration roundConfiguration = getGroupDataModel().getRoundConfiguration(); + if (roundConfiguration.isSubjectsFieldOfVisionEnabled()) { + return new Circle(getPoint(), viewSubjectsRadius); + } + else { + return null; + } + } + + public boolean isSubjectInFieldOfVision(Point subjectPosition) { + Circle circle = getSubjectsFieldOfVision(); + if (circle == null) { + // if the field of vision is null that means that there is no + // field of vision enabled. + return true; + } + return circle.contains(subjectPosition); + // could also do return circle == null || circle.contains(point); + } + + public Circle getTokensFieldOfVision() { + RoundConfiguration roundConfiguration = getGroupDataModel().getRoundConfiguration(); + if (roundConfiguration.isTokensFieldOfVisionEnabled()) { + return new Circle(getPoint(), viewTokensRadius); + } + else { + return null; + } + } + public void addToken() { addTokens(1); } @@ -151,11 +188,9 @@ public synchronized void postRoundSanctionPenalty(final int tokens) { if (tokens < 0) { - System.err.println("Adding to penalties: " + tokens + " for id: " + id); sanctionPenalties += Math.abs(tokens); } else { - System.err.println("Adding to bonuses: " + tokens + " for id: " + id); sanctionBonuses += tokens; } } @@ -273,7 +308,7 @@ case 4: return ( topLeftCorner.add(new Point3D(worldWidth * 3, 0, worldDepth * 3)) ); default: - throw new IllegalArgumentException("initializePosition is hardcoded and does not support more than 4 clients"); + throw new IllegalArgumentException("generate3DPosition is hardcoded to only support up to 4 clients"); } } @@ -295,7 +330,9 @@ public void setExplicitCollectionMode(boolean explicitCollectionMode) { this.explicitCollectionMode = explicitCollectionMode; } + + /** * This method only makes sense within the group that this client data is embedded. */ @@ -308,6 +345,12 @@ public void initializePosition() { RoundConfiguration roundConfiguration = getGroupDataModel().getRoundConfiguration(); setExplicitCollectionMode(roundConfiguration.isAlwaysInExplicitCollectionMode()); + if (roundConfiguration.isSubjectsFieldOfVisionEnabled()) { + viewSubjectsRadius = roundConfiguration.getViewSubjectsRadius(); + } + if (roundConfiguration.isTokensFieldOfVisionEnabled()) { + viewTokensRadius = roundConfiguration.getViewTokensRadius(); + } if (roundConfiguration.isRealTimeSanctioningEnabled()) { latestSanctions = new LinkedList<RealTimeSanctionRequest>(); } Modified: foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round0.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round0.xml 2009-04-20 20:24:46 UTC (rev 115) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round0.xml 2009-04-21 16:59:21 UTC (rev 116) @@ -10,6 +10,7 @@ <entry key='resource-generator'>mobile</entry> <entry key='tokens-field-of-vision'>true</entry> +<entry key='view-tokens-radius'>3.0</entry> <entry key='subjects-field-of-vision'>true</entry> <entry key='regrowth-rate'>.01</entry> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-21 17:26:36
|
Revision: 117 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=117&view=rev Author: alllee Date: 2009-04-21 17:26:20 +0000 (Tue, 21 Apr 2009) Log Message: ----------- round configuration is not dynamically accessible from the client (since the GroupDataModel's ServerDataModel is transient). Should rectify this later by injecting the RoundConfiguration into the ClientData object, in the meantime caching the field of vision booleans + radius in the ClientData object and injecting them in when ClientData's position is initialized on the server side. Modified Paths: -------------- foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ClientData.java foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round0.xml Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ClientData.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ClientData.java 2009-04-21 16:59:21 UTC (rev 116) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ClientData.java 2009-04-21 17:26:20 UTC (rev 117) @@ -44,6 +44,8 @@ private LinkedList<RealTimeSanctionRequest> latestSanctions; private AnimationData animationData; + private boolean subjectsFieldOfVisionEnabled; + private boolean tokensFieldOfVisionEnabled; private double viewSubjectsRadius; private double viewTokensRadius; @@ -81,18 +83,16 @@ public void addTokens(int tokens) { currentTokens += tokens; + // this can only be invoked on the server side RoundConfiguration configuration = getGroupDataModel().getRoundConfiguration(); if ( ! configuration.isPracticeRound() ) { totalTokens += tokens; totalIncome += (tokens * configuration.getDollarsPerToken()); } } - - public Circle getSubjectsFieldOfVision() { - RoundConfiguration roundConfiguration = getGroupDataModel().getRoundConfiguration(); - if (roundConfiguration.isSubjectsFieldOfVisionEnabled()) { + if (isSubjectsFieldOfVisionEnabled()) { return new Circle(getPoint(), viewSubjectsRadius); } else { @@ -112,8 +112,7 @@ } public Circle getTokensFieldOfVision() { - RoundConfiguration roundConfiguration = getGroupDataModel().getRoundConfiguration(); - if (roundConfiguration.isTokensFieldOfVisionEnabled()) { + if (isTokensFieldOfVisionEnabled()) { return new Circle(getPoint(), viewTokensRadius); } else { @@ -345,10 +344,12 @@ public void initializePosition() { RoundConfiguration roundConfiguration = getGroupDataModel().getRoundConfiguration(); setExplicitCollectionMode(roundConfiguration.isAlwaysInExplicitCollectionMode()); - if (roundConfiguration.isSubjectsFieldOfVisionEnabled()) { + subjectsFieldOfVisionEnabled = roundConfiguration.isSubjectsFieldOfVisionEnabled(); + if (subjectsFieldOfVisionEnabled) { viewSubjectsRadius = roundConfiguration.getViewSubjectsRadius(); } - if (roundConfiguration.isTokensFieldOfVisionEnabled()) { + tokensFieldOfVisionEnabled = roundConfiguration.isTokensFieldOfVisionEnabled(); + if (tokensFieldOfVisionEnabled) { viewTokensRadius = roundConfiguration.getViewTokensRadius(); } if (roundConfiguration.isRealTimeSanctioningEnabled()) { @@ -453,5 +454,21 @@ return totalIncome; } + public boolean isSubjectsFieldOfVisionEnabled() { + return subjectsFieldOfVisionEnabled; + } + public boolean isTokensFieldOfVisionEnabled() { + return tokensFieldOfVisionEnabled; + } + + public double getViewSubjectsRadius() { + return viewSubjectsRadius; + } + + public double getViewTokensRadius() { + return viewTokensRadius; + } + + } Modified: foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round0.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round0.xml 2009-04-21 16:59:21 UTC (rev 116) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round0.xml 2009-04-21 17:26:20 UTC (rev 117) @@ -42,10 +42,10 @@ 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. Tokens -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. +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> @@ -91,7 +91,7 @@ <br> <form> Which of the statements is incorrect? <br> -<input type="radio" name="q1" value="A">Your decisions of where to collect tokens affect the regeneration of tokens.<br> +<input type="radio" name="q1" value="A">Your decisions of where to collect tokens affects the regeneration of tokens.<br> <input type="radio" name="q1" value="B">When you have collected all tokens on the screen, no new tokens will appear.<br> <input type="radio" name="q1" value="C">Tokens grow from the middle of the @@ -118,7 +118,8 @@ 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. +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> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <al...@us...> - 2010-03-10 19:05:20
|
Revision: 489 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=489&view=rev Author: alllee Date: 2010-03-10 19:05:12 +0000 (Wed, 10 Mar 2010) Log Message: ----------- minor updates to the active configuration files, changing the default initial distribution to 25% etc. Modified Paths: -------------- foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ResourceDispenser.java foraging/trunk/src/main/resources/configuration/round4.xml foraging/trunk/src/main/resources/configuration/round5.xml foraging/trunk/src/main/resources/configuration/round6.xml 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-10 18:35:34 UTC (rev 488) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java 2010-03-10 19:05:12 UTC (rev 489) @@ -139,7 +139,7 @@ } public double getInitialDistribution() { - return getDoubleProperty("initial-distribution", 0.5d); + return getDoubleProperty("initial-distribution", 0.25d); } public Dimension getBoardSize() { Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ResourceDispenser.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ResourceDispenser.java 2010-03-10 18:35:34 UTC (rev 488) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ResourceDispenser.java 2010-03-10 19:05:12 UTC (rev 489) @@ -345,6 +345,7 @@ this.rate = roundConfiguration.getRegrowthRate(); for (GroupDataModel group: serverDataModel.getGroups()) { Set<Resource> resources = generateInitialDistribution(group); + logger.info("density dependent resource generator initialized with " + resources.size() + " resources."); serverDataModel.addResources(group, resources); } // FIXME: is this necessary? Modified: foraging/trunk/src/main/resources/configuration/round4.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/round4.xml 2010-03-10 18:35:34 UTC (rev 488) +++ foraging/trunk/src/main/resources/configuration/round4.xml 2010-03-10 19:05:12 UTC (rev 489) @@ -102,8 +102,7 @@ <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 at the -bottom of the screen and clicking the "send" button with your mouse or -pressing the "enter" key on your keyboard. +bottom of the screen and pressing the "enter" key on your keyboard. </p> ]]> </entry> Modified: foraging/trunk/src/main/resources/configuration/round5.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/round5.xml 2010-03-10 18:35:34 UTC (rev 488) +++ foraging/trunk/src/main/resources/configuration/round5.xml 2010-03-10 19:05:12 UTC (rev 489) @@ -58,8 +58,7 @@ <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 at the -bottom of the screen and clicking the "send" button with your mouse or -pressing the "enter" key on your keyboard. +bottom of the screen and pressing the "enter" key on your keyboard. </p> ]]> </entry> Modified: foraging/trunk/src/main/resources/configuration/round6.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/round6.xml 2010-03-10 18:35:34 UTC (rev 488) +++ foraging/trunk/src/main/resources/configuration/round6.xml 2010-03-10 19:05:12 UTC (rev 489) @@ -74,8 +74,7 @@ <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 at the -bottom of the screen and clicking the "send" button with your mouse or -pressing the "enter" key on your keyboard. </p> +bottom of the screen and pressing the "enter" key. </p> ]]> </entry> </properties> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <db...@us...> - 2010-03-25 21:22:25
|
Revision: 494 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=494&view=rev Author: dbarge Date: 2010-03-25 21:22:19 +0000 (Thu, 25 Mar 2010) Log Message: ----------- This code version has following improvements 1) Quiz responses are more informative. After submitting the responses the players are notified about the correct and incorrect answers. 2) Added an option to the GUI to select the type of treatment from the facilitator end. This is a workaround for selecting either full-vision treatment or limited-vision treatment. Modified Paths: -------------- foraging/trunk/src/main/resources/configuration/round0.xml foraging/trunk/src/main/resources/configuration/round4.xml Added Paths: ----------- foraging/trunk/src/main/webapp/ foraging/trunk/src/main/webapp/WEB-INF/ foraging/trunk/src/main/webapp/WEB-INF/web.xml foraging/trunk/src/main/webapp/client.jar foraging/trunk/src/main/webapp/client.jnlp foraging/trunk/src/main/webapp/csidex.jar foraging/trunk/src/main/webapp/facilitator.jar foraging/trunk/src/main/webapp/facilitator.jnlp foraging/trunk/src/main/webapp/images/ foraging/trunk/src/main/webapp/images/5neighbors.jpg foraging/trunk/src/main/webapp/images/8neighbors.jpg foraging/trunk/src/main/webapp/images/abstract.jpg foraging/trunk/src/main/webapp/images/age-token-graph.jpg foraging/trunk/src/main/webapp/images/bg-grass.jpg foraging/trunk/src/main/webapp/images/blank.gif foraging/trunk/src/main/webapp/images/freeze-self.gif foraging/trunk/src/main/webapp/images/gem-gray.gif foraging/trunk/src/main/webapp/images/gem-other.gif foraging/trunk/src/main/webapp/images/gem-purple.gif foraging/trunk/src/main/webapp/images/gem-red.gif foraging/trunk/src/main/webapp/images/gem-self-explicit.gif foraging/trunk/src/main/webapp/images/gem-self.gif foraging/trunk/src/main/webapp/images/gem-token.gif foraging/trunk/src/main/webapp/images/icon.gif foraging/trunk/src/main/webapp/images/image1.gif foraging/trunk/src/main/webapp/images/image2.gif foraging/trunk/src/main/webapp/images/matte.gif foraging/trunk/src/main/webapp/images/neighborhood.jpg foraging/trunk/src/main/webapp/images/possible-neighboring-tokens.jpg foraging/trunk/src/main/webapp/images/question2.jpg foraging/trunk/src/main/webapp/images/question2_orig.jpg foraging/trunk/src/main/webapp/images/sanction-blue.jpg foraging/trunk/src/main/webapp/images/sanction-yellow.jpg foraging/trunk/src/main/webapp/images/trees.jpg foraging/trunk/src/main/webapp/images/vision-range.jpg foraging/trunk/src/main/webapp/index.html Modified: foraging/trunk/src/main/resources/configuration/round0.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/round0.xml 2010-03-25 21:20:57 UTC (rev 493) +++ foraging/trunk/src/main/resources/configuration/round0.xml 2010-03-25 21:22:19 UTC (rev 494) @@ -46,7 +46,7 @@ </p> <br> <form> -Which of the statements is <b><u>incorrect</u></b>? <br> +(Q1)Which of the statements is <b><u>incorrect</u></b>? <br> <input type="radio" name="q1" value="A">Your decisions of where to collect tokens affects the regeneration of tokens.<br> <input type="radio" name="q1" value="B">When you have collected all tokens on the screen, no new tokens will appear.<br> @@ -56,7 +56,7 @@ to press the space bar while your yellow dot <img src="@CODEBASE_URL@/images/gem-self.gif"> is on a cell with a token.<br> <br><br> -Which sequence of situations is not possible? <br> +(Q2)Which sequence of situations is <b><u>not possible</u></b>? <br> <img src="@CODEBASE_URL@/images/question2.jpg"><br> <input type="radio" name="q2" value="A">A<br> <input type="radio" name="q2" value="B">B<br> Modified: foraging/trunk/src/main/resources/configuration/round4.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/round4.xml 2010-03-25 21:20:57 UTC (rev 493) +++ foraging/trunk/src/main/resources/configuration/round4.xml 2010-03-25 21:22:19 UTC (rev 494) @@ -114,7 +114,7 @@ </p> <form> -Each time I press the numeric keys between 1-5 my tokens will be reduced +(Q1)Each time I press the numeric keys between 1-5 my tokens will be reduced by:<br> <input type="radio" name="q1" value="0">0 tokens<br> <input type="radio" name="q1" value="1">1 token<br> @@ -122,7 +122,7 @@ <input type="radio" name="q1" value="4">4 tokens<br> <br><br> -Each time I press the numeric keys between 1-5 the number of tokens of the +(Q2)Each time I press the numeric keys between 1-5 the number of tokens of the corresponding participant is reduced by:<br> <input type="radio" name="q2" value="0">0 tokens<br> <input type="radio" name="q2" value="1">1 token<br> @@ -130,7 +130,7 @@ <input type="radio" name="q2" value="4">4 tokens<br> <br><br> -The background of your yellow dot <img src="@CODEBASE_URL@/images/gem-self.gif"> turns blue. What does this represent?<br> +(Q3)The background of your yellow dot <img src="@CODEBASE_URL@/images/gem-self.gif"> turns blue. What does this represent?<br> <input type="radio" name="q3" value="0">You collected a token<br> <input type="radio" name="q3" value="1">Another participant is subtracting two tokens from you<br> @@ -139,7 +139,7 @@ <input type="radio" name="q3" value="3">You are moving too fast<br> <br><br> -Every time I press the numeric keys between 1-5:<br> +(Q4)Every time I press the numeric keys between 1-5:<br> <input type="radio" name="q4" value="0">Two tokens are subtracted from my tokens collected this round<br> <input type="radio" name="q4" value="1">One token is subtracted from my tokens Added: foraging/trunk/src/main/webapp/WEB-INF/web.xml =================================================================== --- foraging/trunk/src/main/webapp/WEB-INF/web.xml (rev 0) +++ foraging/trunk/src/main/webapp/WEB-INF/web.xml 2010-03-25 21:22:19 UTC (rev 494) @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +vim:sts=2:sw=2 +--> +<web-app> + + <display-name>The Virtual Commons Foraging Experiment</display-name> + + <welcome-file-list> + <welcome-file>index.html</welcome-file> + </welcome-file-list> + +</web-app> Added: foraging/trunk/src/main/webapp/client.jar =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/client.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/client.jnlp =================================================================== --- foraging/trunk/src/main/webapp/client.jnlp (rev 0) +++ foraging/trunk/src/main/webapp/client.jnlp 2010-03-25 21:22:19 UTC (rev 494) @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- JNLP file for foraging client --> +<jnlp spec="1.6+" codebase="http://localhost:8080/" href="client.jnlp"> + <information> + <title>Virtual Commons Experiment</title> + <vendor>The Virtual Commons, Center for the Study of Institutional Diversity, School of Human Evolution and Social Change, Dr. Marco Janssen, Allen Lee, Deepali Bhagvat</vendor> + <homepage href="http://commons.asu.edu"/> + <description>An experiment brought to you courtesy of The Virtual Commons - http://commons.asu.edu</description> + </information> + <offline-allowed /> + <resources> + <j2se version="1.6+"/> + <jar href="client.jar"/> + <jar href='csidex.jar'/> + <property name="sun.java2d.noddraw" value="true"/> + <extension name="jogl" href="http://download.java.net/media/jogl/builds/archive/jsr-231-webstart-current/jogl.jnlp"/> + </resources> + <application-desc main-class="edu.asu.commons.foraging.client.ForagingClient"/> +</jnlp> + Added: foraging/trunk/src/main/webapp/csidex.jar =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/csidex.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/facilitator.jar =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/facilitator.jar ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/facilitator.jnlp =================================================================== --- foraging/trunk/src/main/webapp/facilitator.jnlp (rev 0) +++ foraging/trunk/src/main/webapp/facilitator.jnlp 2010-03-25 21:22:19 UTC (rev 494) @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- JNLP File for CSAN 2D Facilitator --> +<jnlp spec="1.6+" codebase="http://localhost:8080/" href="facilitator.jnlp"> + <information> + <title>Virtual Commons Experiment</title> + <vendor>The Virtual Commons, Center for the Study of Institutional Diversity, School of Human Evolution and Social Change, Dr. Marco Janssen, Allen Lee, Deepali Bhagvat</vendor> + <homepage href="http://commons.asu.edu"/> + <description>Foraging 2D facilitator interface to control the Foraging 2D experiment.</description> + <icon href="commons.gif"/> + </information> + <offline-allowed /> + <resources> + <j2se version="1.6+"/> + <jar href="facilitator.jar"/> + <jar href='csidex.jar'/> + </resources> + <application-desc main-class="edu.asu.commons.foraging.facilitator.Facilitator"/> +</jnlp> + Added: foraging/trunk/src/main/webapp/images/5neighbors.jpg =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/5neighbors.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/images/8neighbors.jpg =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/8neighbors.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/images/abstract.jpg =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/abstract.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/images/age-token-graph.jpg =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/age-token-graph.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/images/bg-grass.jpg =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/bg-grass.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/images/blank.gif =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/blank.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/images/freeze-self.gif =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/freeze-self.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/images/gem-gray.gif =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/gem-gray.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/images/gem-other.gif =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/gem-other.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/images/gem-purple.gif =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/gem-purple.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/images/gem-red.gif =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/gem-red.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/images/gem-self-explicit.gif =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/gem-self-explicit.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/images/gem-self.gif =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/gem-self.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/images/gem-token.gif =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/gem-token.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/images/icon.gif =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/icon.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/images/image1.gif =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/image1.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/images/image2.gif =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/image2.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/images/matte.gif =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/matte.gif ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/images/neighborhood.jpg =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/neighborhood.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/images/possible-neighboring-tokens.jpg =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/possible-neighboring-tokens.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/images/question2.jpg =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/question2.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/images/question2_orig.jpg =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/question2_orig.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/images/sanction-blue.jpg =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/sanction-blue.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/images/sanction-yellow.jpg =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/sanction-yellow.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/images/trees.jpg =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/trees.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/images/vision-range.jpg =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/webapp/images/vision-range.jpg ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: foraging/trunk/src/main/webapp/index.html =================================================================== --- foraging/trunk/src/main/webapp/index.html (rev 0) +++ foraging/trunk/src/main/webapp/index.html 2010-03-25 21:22:19 UTC (rev 494) @@ -0,0 +1,13 @@ +<html> +<head> +<META HTTP-EQUIV="Refresh" CONTENT="5;URL=client.jnlp"> +<title>Virtual Commons Experiment Client</title> +</head> +<body> +<p> +Automatically starting the client. Please <a href='javascript:void()' +onclick='window.close()'>close</a> this window after the client +loads. NOTE: <b>Do not reload or refresh</b> this window. +</p> +</body> +</html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2010-03-30 02:00:35
|
Revision: 498 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=498&view=rev Author: alllee Date: 2010-03-30 02:00:29 +0000 (Tue, 30 Mar 2010) Log Message: ----------- fixing round initialization bugs stemming from moving initializeRound() above the Utils.wait(roundSignal) - initializeRound was being invoked afterwards so that after all the clients connect we then shuffle the participants to generate the groups and initialize the resource dispenser. Modified Paths: -------------- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/ForagingClient.java foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java foraging/trunk/src/main/java/edu/asu/commons/foraging/server/ForagingServer.java foraging/trunk/src/main/webapp/client.jnlp foraging/trunk/src/main/webapp/facilitator.jnlp Removed Paths: ------------- foraging/trunk/src/main/webapp/client.jar foraging/trunk/src/main/webapp/csidex.jar foraging/trunk/src/main/webapp/facilitator.jar Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/client/ForagingClient.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/ForagingClient.java 2010-03-29 20:10:49 UTC (rev 497) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/client/ForagingClient.java 2010-03-30 02:00:29 UTC (rev 498) @@ -35,9 +35,7 @@ import edu.asu.commons.foraging.event.RoundStartedEvent; import edu.asu.commons.foraging.event.SanctionUpdateEvent; import edu.asu.commons.foraging.event.ShowInstructionsRequest; -import edu.asu.commons.foraging.event.TreatmentTypeRequest; import edu.asu.commons.foraging.event.SynchronizeClientEvent; -import edu.asu.commons.foraging.model.TreatmentType; import edu.asu.commons.util.Duration; import edu.asu.commons.util.Utils; @@ -71,7 +69,6 @@ private ClientDataModel dataModel; - private TreatmentType treatmentType = TreatmentType.FULLVISION; private MessageQueue messageQueue; @@ -128,14 +125,6 @@ gameWindow3D.removeAgentDesigner(); } - private void setTreatmentType(TreatmentType treatmentType) { - this.treatmentType = treatmentType; - } - - private TreatmentType getTreatmentType() { - return treatmentType; - } - @Override @SuppressWarnings("unchecked") protected void initializeEventProcessors() { @@ -143,7 +132,6 @@ public void handle(SetConfigurationEvent event) { RoundConfiguration configuration = (RoundConfiguration) event.getParameters(); dataModel.setRoundConfiguration(configuration); - dataModel.getRoundConfiguration().setTreatmentType(getTreatmentType()); SwingUtilities.invokeLater(new Runnable() { public void run() { clientPanel.removeAll(); @@ -172,13 +160,6 @@ } }); - addEventProcessor(new EventTypeProcessor<TreatmentTypeRequest>(TreatmentTypeRequest.class) { - public void handle(TreatmentTypeRequest request) { - setTreatmentType(request.getTreatmentType()); - dataModel.getRoundConfiguration().setTreatmentType(getTreatmentType()); - } - }); - addEventProcessor(new EventTypeProcessor<RoundStartedEvent>(RoundStartedEvent.class) { public void handle(RoundStartedEvent event) { System.err.println("client starting round: " + dataModel.is2dExperiment()); 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-29 20:10:49 UTC (rev 497) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java 2010-03-30 02:00:29 UTC (rev 498) @@ -10,7 +10,6 @@ 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.TreatmentType; public class RoundConfiguration extends ExperimentRoundParameters.Base<ServerConfiguration> { @@ -28,7 +27,6 @@ private static final double DEFAULT_TOKEN_BIRTH_PROBABILITY = 0.01d; - private TreatmentType treatmentType; private final static Map<String, SanctionType> sanctionTypeMap = new HashMap<String, SanctionType>(3); public enum SanctionType { @@ -118,15 +116,6 @@ || getBooleanProperty("randomize-group", false); } - public void setTreatmentType (TreatmentType treatmentType) { - this.treatmentType = treatmentType; - } - - public TreatmentType getTreatmentType () { - return treatmentType; - } - - /** * Returns the number of seconds that the flashing visualization of * sanctioning should occur. @@ -146,24 +135,11 @@ } public boolean isTokensFieldOfVisionEnabled() { - if (getTreatmentType()== TreatmentType.FULLVISION){ - return false; - } - - else { - return true; - } - //return getBooleanProperty("tokens-field-of-vision", false); + return getBooleanProperty("tokens-field-of-vision", false); } public boolean isSubjectsFieldOfVisionEnabled() { - if (getTreatmentType()== TreatmentType.FULLVISION){ - return false; - } - else { - return true; - } - //return getBooleanProperty("subjects-field-of-vision", false); + return getBooleanProperty("subjects-field-of-vision", false); } public double getViewSubjectsRadius() { Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/server/ForagingServer.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/server/ForagingServer.java 2010-03-29 20:10:49 UTC (rev 497) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/server/ForagingServer.java 2010-03-30 02:00:29 UTC (rev 498) @@ -679,6 +679,13 @@ addEventProcessor(new EventTypeProcessor<BeginRoundRequest>(BeginRoundRequest.class) { public void handle(BeginRoundRequest event) { if (event.getId().equals(facilitatorId)) { + if (getCurrentRoundConfiguration().isFirstRound()) { + // shuffle groups + // set up the Client Group relationships ONLY IF we are in the first round... + // kind of a hack. + shuffleParticipants(); + initializeRound(); + } logger.info("Begin round request from facilitator - starting round."); experimentStarted = true; Utils.notify(roundSignal); @@ -978,11 +985,6 @@ // initialize persister first so we store all relevant events. // persister MUST be initialized early so that we store AddClientEvents etc.. persister.initialize(roundConfiguration); - // set up the Client Group relationships ONLY IF we are in the first round... - // kind of a hack. - if (roundConfiguration.isFirstRound()) { - shuffleParticipants(); - } // set up the resource dispenser, generates the initial resource distributions for the // groups, must be done after creating the client group relationships. resourceDispenser.initialize(); Deleted: foraging/trunk/src/main/webapp/client.jar =================================================================== (Binary files differ) Modified: foraging/trunk/src/main/webapp/client.jnlp =================================================================== --- foraging/trunk/src/main/webapp/client.jnlp 2010-03-29 20:10:49 UTC (rev 497) +++ foraging/trunk/src/main/webapp/client.jnlp 2010-03-30 02:00:29 UTC (rev 498) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <!-- JNLP file for foraging client --> -<jnlp spec="1.6+" codebase="http://localhost:8080/" href="client.jnlp"> +<jnlp spec="1.6+" codebase="http://localhost:8080" href="client.jnlp"> <information> <title>Virtual Commons Experiment</title> <vendor>The Virtual Commons, Center for the Study of Institutional Diversity, School of Human Evolution and Social Change, Dr. Marco Janssen, Allen Lee, Deepali Bhagvat</vendor> Deleted: foraging/trunk/src/main/webapp/csidex.jar =================================================================== (Binary files differ) Deleted: foraging/trunk/src/main/webapp/facilitator.jar =================================================================== (Binary files differ) Modified: foraging/trunk/src/main/webapp/facilitator.jnlp =================================================================== --- foraging/trunk/src/main/webapp/facilitator.jnlp 2010-03-29 20:10:49 UTC (rev 497) +++ foraging/trunk/src/main/webapp/facilitator.jnlp 2010-03-30 02:00:29 UTC (rev 498) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <!-- JNLP File for CSAN 2D Facilitator --> -<jnlp spec="1.6+" codebase="http://localhost:8080/" href="facilitator.jnlp"> +<jnlp spec="1.6+" codebase="http://localhost:8080" href="facilitator.jnlp"> <information> <title>Virtual Commons Experiment</title> <vendor>The Virtual Commons, Center for the Study of Institutional Diversity, School of Human Evolution and Social Change, Dr. Marco Janssen, Allen Lee, Deepali Bhagvat</vendor> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2010-03-31 00:58:55
|
Revision: 499 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=499&view=rev Author: alllee Date: 2010-03-31 00:58:49 +0000 (Wed, 31 Mar 2010) Log Message: ----------- - fixed a number of bugs with sanction animation - implemented quiz feedback - updated configuration for upcoming experiment runs Modified Paths: -------------- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/ClientDataModel.java foraging/trunk/src/main/java/edu/asu/commons/foraging/client/GameWindow2D.java foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ClientData.java foraging/trunk/src/main/java/edu/asu/commons/foraging/server/ForagingServer.java foraging/trunk/src/main/resources/configuration/asu-experiments/voting-limitedvision/round0.xml foraging/trunk/src/main/resources/configuration/asu-experiments/voting-limitedvision/round4.xml foraging/trunk/src/main/resources/configuration/asu-experiments/voting-limitedvision/round5.xml foraging/trunk/src/main/resources/configuration/asu-experiments/voting-limitedvision/round6.xml Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/client/ClientDataModel.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/ClientDataModel.java 2010-03-30 02:00:29 UTC (rev 498) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/client/ClientDataModel.java 2010-03-31 00:58:49 UTC (rev 499) @@ -70,8 +70,10 @@ return Identifier.NULL; } + // FIXME: the logic here is getting complex, refactor later public boolean isSanctioningAllowed() { - return getClientData().isSanctioningAllowed() || isSanctioningEnabled(); + return groupDataModel.getActiveSanctionMechanism() == SanctionMechanism.EVERYBODY_CAN_SANCTION; +// && getClientData().isSanctioningAllowed() || isSanctioningEnabled(); } public boolean isHarvestingAllowed() { @@ -86,9 +88,6 @@ * public Map<Identifier, Duration> getSanctioned() { return sanctioned; } */ public void sanction(Identifier source, Identifier target) { - if (groupDataModel.getClientData(target).getCurrentTokens() < 2) { - return; - } Duration duration = Duration.create(getRoundConfiguration().getSanctionFlashDuration()); sanctioners.put(source, duration); sanctioned.put(target, duration); @@ -185,9 +184,6 @@ * hot-spot, 9% of time spent here. */ public void updateDiffs(ClientPositionUpdateEvent event, GameWindow2D window) { - if (event.getCurrentTokens() > currentTokens) { - window.collectToken(getClientData().getPosition()); - } currentTokens = event.getCurrentTokens(); groupDataModel.updateDiffs(event); handleRealTimeSanctions(event.getLatestSanctions()); @@ -210,16 +206,17 @@ } private synchronized void handleRealTimeSanctions(Queue<RealTimeSanctionRequest> latestSanctions) { - if (!getRoundConfiguration().isRealTimeSanctioningEnabled()) { - return; - } - for (RealTimeSanctionRequest sanctionEvent : latestSanctions) { - if (getId().equals(sanctionEvent.getTarget())) { +// if (!getRoundConfiguration().isRealTimeSanctioningEnabled()) { +// return; +// } + for (RealTimeSanctionRequest sanctionRequest : latestSanctions) { + System.err.println("Processing real time sanction: from " + sanctionRequest.getSource() + " to " + sanctionRequest.getTarget()); + sanction(sanctionRequest.getSource(), sanctionRequest.getTarget()); +// if (getId().equals(sanctionEvent.getTarget())) { // received a penalty, change colors for the duration of the // sanction. - sanction(sanctionEvent.getSource(), getId()); - - } +// sanction(sanctionEvent.getSource(), getId()); +// } } } 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-30 02:00:29 UTC (rev 498) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/client/GameWindow2D.java 2010-03-31 00:58:49 UTC (rev 499) @@ -16,10 +16,15 @@ import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStreamReader; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.Enumeration; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -42,6 +47,8 @@ import javax.swing.text.StyleConstants; import javax.swing.text.StyleContext; import javax.swing.text.StyledDocument; +import javax.swing.text.html.HTMLEditorKit; +import javax.swing.text.html.StyleSheet; import edu.asu.commons.event.Event; import edu.asu.commons.event.EventChannel; @@ -136,7 +143,8 @@ subjectView = new SubjectView(subjectViewSize, dataModel); // subjectView.addKeyListener(this); this.currentRankingInformation = new int [2]; - this.currentRankingInformation[0] = this.currentRankingInformation[1] = -1; + Arrays.fill(currentRankingInformation, -1); +// this.currentRankingInformation[0] = this.currentRankingInformation[1] = -1; initGuiComponents(); } @@ -226,32 +234,39 @@ Collections.sort(correctAnswers); StringBuilder builder = new StringBuilder().append(instructionsBuilder); + HTMLEditorKit editorKit = (HTMLEditorKit) instructionsEditorPane.getEditorKit(); + StyleSheet styleSheet = editorKit.getStyleSheet(); + + StringBuilder correctString = new StringBuilder(); - if (!correctAnswers.isEmpty()) { - correctString.append("<br>Correctly answered questions"); - for (Iterator<String> itr = correctAnswers.iterator(); itr.hasNext();) { - String correctSelected = itr.next(); - String correctValue = configuration.getQuizAnswers().get(correctSelected); - correctString.append("<br>"+correctSelected+": Option "+correctValue); + if (! correctAnswers.isEmpty()) { + correctString.append("<h3>Correctly answered questions</h3><ul>"); + for (String correctQuestionNumber : correctAnswers) { + String styleString = String.format(".%s { color: black; }", correctQuestionNumber); + styleSheet.addRule(styleString); + correctString.append(String.format("<li>Your answer, [ %s ] was correct for question %s.", + actualAnswers.get(correctQuestionNumber), + correctQuestionNumber)); } - correctString.append("<br>"); + correctString.append("</ul>"); } - StringBuilder incorrectString = new StringBuilder(); - incorrectString.append("<br>Incorrectly answered questions"); - for (Iterator<String> itr = incorrectAnswers.iterator(); itr.hasNext();) { - String incorrectSelected = itr.next(); - incorrectString.append("<br>"+incorrectSelected); + correctString.append("<h3>Incorrectly answered questions</h3><ul>"); + for (String incorrectQuestionNumber : incorrectAnswers) { + String styleString = String.format(".%s { color: red; }", incorrectQuestionNumber); + styleSheet.addRule(styleString); + correctString.append(String.format("<li>Your answer [ %s ] was incorrect for question %s.", + actualAnswers.get(incorrectQuestionNumber), + incorrectQuestionNumber)); } - incorrectString.append("<br>"); - - builder.append("<br><b><font color='red'>"+correctString.toString()+incorrectString.toString()+".<br> Please select again and resubmit.</font></b>"); + correctString.append("</ul>"); + builder.append(correctString); setInstructions(builder.toString()); } } }; } - + /** * Invoked when a subject collected a token at Point p. * @@ -616,7 +631,7 @@ // System.out.println("sanctioning event sent"); event = new RealTimeSanctionRequest(dataModel.getId(), sanctionee); // below function must be used for enforcement type4 - dataModel.sanction(dataModel.getId(), sanctionee); +// dataModel.sanction(dataModel.getId(), sanctionee); } else { displayErrorMessage("The participant is out of range ", 1); @@ -859,10 +874,9 @@ public void displaySanctionMechanism() { SwingUtilities.invokeLater(new Runnable() { public void run() { - System.out.println("Inside display sanction"); instructionsBuilder.delete(0, instructionsBuilder.length()); - instructionsBuilder.append("<hr/><h2>Sanction choice voted : </h2><hr/><p>").append(dataModel.getActiveSanctionMechanism().getDescription()).append("</p>"); - instructionsBuilder.append("<hr/><h2>Active enforcement mechanism</h2><hr/><p>").append(dataModel.getActiveEnforcementMechanism().getDescription()).append("</p>"); + instructionsBuilder.append("<h2>Your group voted for the following enforcement mechanism: </h2><hr/><p>").append(dataModel.getActiveSanctionMechanism().getDescription()).append("</p>"); +// instructionsBuilder.append("<hr/><h2>Active enforcement mechanism</h2><hr/><p>").append(dataModel.getActiveEnforcementMechanism().getDescription()).append("</p>"); setInstructions(instructionsBuilder.toString()); addCenterComponent(instructionsScrollPane); } @@ -981,9 +995,9 @@ JPanel rankPanel = new JPanel(); rankPanel.setBackground(Color.WHITE); rankPanel.setLayout(new BoxLayout (rankPanel, BoxLayout.Y_AXIS)); - rankPanel.setBorder(BorderFactory.createTitledBorder("Voting Options")); + rankPanel.setBorder(BorderFactory.createTitledBorder("Voting")); - JLabel sanctionText = new JLabel("Please select one of the below voting options"); + JLabel sanctionText = new JLabel("Please select one of the options below: "); rankPanel.add(Box.createVerticalStrut(5)); @@ -991,7 +1005,7 @@ rankPanel.add(Box.createVerticalStrut(8)); - noSanction = new JRadioButton("No Sanctioning [No one can sanction/reduce tokens]"); + noSanction = new JRadioButton("No penalties [No one can subtract tokens from anyone]"); noSanction.setActionCommand("0"); group.add(noSanction); noSanction.addActionListener(this); @@ -999,7 +1013,7 @@ rankPanel.add(Box.createVerticalStrut(8)); - sanction = new JRadioButton("Allow Sanctioning [Everyone can sanction each other]"); + sanction = new JRadioButton("Allow penalties [Everyone can subtract tokens from each other]"); sanction.setActionCommand("1"); group.add(sanction); sanction.addActionListener(this); 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-30 02:00:29 UTC (rev 498) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java 2010-03-31 00:58:49 UTC (rev 499) @@ -316,7 +316,7 @@ } public int getChatDuration() { - return getIntProperty("chat-duration", 120); + return getIntProperty("chat-duration", 240); } public int getSanctionVotingDuration() { @@ -344,7 +344,11 @@ } public String getSanctionInstructions() { - return getProperty("sanction-instructions","<h2>Please read the below mentioned instructions</h2>.<ul> <li> Please make your choice within the next 30 seconds. <li>The votes of all group participants will determine the outcome.</ul>"); + return getProperty("sanction-instructions","<h2>Voting instructions</h2>" + + "<ul> " + + "<li> You must make a choice within the next 30 seconds. " + + "<li>The votes of all participants in your group will determine the outcome." + + "</ul>"); } public boolean isAlwaysInExplicitCollectionMode() { Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ClientData.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ClientData.java 2010-03-30 02:00:29 UTC (rev 498) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ClientData.java 2010-03-31 00:58:49 UTC (rev 499) @@ -249,6 +249,10 @@ } } + /** + * Returns a queue of sanction requests that have been most recently applied to this client. + * @return + */ public Queue<RealTimeSanctionRequest> getLatestSanctions() { return latestSanctions; } Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/server/ForagingServer.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/server/ForagingServer.java 2010-03-30 02:00:29 UTC (rev 498) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/server/ForagingServer.java 2010-03-31 00:58:49 UTC (rev 499) @@ -278,11 +278,11 @@ public void handle(final EnforcementRankingRequest request) { logger.info("received enforcement ranking request: " + Arrays.asList(request.getRankings())); GroupDataModel group = serverDataModel.getGroup(request.getId()); - group.submitEnforcementRanking(request); - if (group.hasReceivedAllEnforcementRankings()) { - sendEnforcementUpdate(group); - } - // FIXME: this is duplicated. +// group.submitEnforcementRanking(request); +// if (group.hasReceivedAllEnforcementRankings()) { +// sendEnforcementUpdate(group); +// } + // FIXME: this is duplicated with above logic, fix later group.submitSanctionRanking(request); if (group.hasReceivedAllSanctionRankings()) { sendSanctionRankingUpdate(group); @@ -506,6 +506,7 @@ // monitors don't get any sanction costs. targetClient.sanctionPenalty(); // add sanction request to the target client so they can figure out who just sanctioned them + sourceClient.getLatestSanctions().add(request); targetClient.getLatestSanctions().add(request); transmit(new ClientMessageEvent(sourceClient.getId(), String.format("Subtracting %d tokens from # %d at the cost of 0 to yourself." , @@ -613,27 +614,31 @@ return; } sourceClient.sanctionCost(); + int sanctionCost = getCurrentRoundConfiguration().getSanctionCost(); int subtractedTokens = targetClient.sanctionPenalty(); // generate sanction applied event SanctionAppliedEvent sanctionAppliedEvent = new SanctionAppliedEvent(sourceClient.getId()); // the sanction cost should always be set since the client should prevent any sanction requests from being emitted // if the user doesn't have enough tokens to issue the request. - sanctionAppliedEvent.setSanctionCost(getCurrentRoundConfiguration().getSanctionCost()); + sanctionAppliedEvent.setSanctionCost(sanctionCost); // the sanction penalty may be in the range [1, RoundConfiguration.getSanctionPenalty()] - // if target has less than the actual sanction penalty they just get their tokens reduced to 0. sanctionAppliedEvent.setSanctionPenalty(subtractedTokens); sanctionAppliedEvent.setTarget(targetClient.getId()); persister.store(sanctionAppliedEvent); - // add sanction request to the target client so they can figure out who just sanctioned them + sourceClient.getLatestSanctions().add(request); targetClient.getLatestSanctions().add(request); + logger.info("target client " + targetClient.getId() + " has sanctions: " + targetClient.getLatestSanctions()); transmit(new ClientMessageEvent(sourceClient.getId(), String.format("Subtracting %d tokens from # %d at the cost of %d to yourself." , - getCurrentRoundConfiguration().getSanctionPenalty(), + subtractedTokens, targetClient.getAssignedNumber(), - getCurrentRoundConfiguration().getSanctionCost()))); + sanctionCost))); transmit(new ClientMessageEvent(targetClient.getId(), - String.format("# %d subtracted %d tokens from you.", sourceClient.getAssignedNumber(), getCurrentRoundConfiguration().getSanctionPenalty()))); + String.format("# %d subtracted %d tokens from you.", + sourceClient.getAssignedNumber(), + subtractedTokens))); } private void initializeFacilitatorHandlers() { @@ -684,7 +689,7 @@ // set up the Client Group relationships ONLY IF we are in the first round... // kind of a hack. shuffleParticipants(); - initializeRound(); + initializeResourceDispenser(); } logger.info("Begin round request from facilitator - starting round."); experimentStarted = true; @@ -714,6 +719,11 @@ addEventProcessor(new EventTypeProcessor<BeginChatRoundRequest>(BeginChatRoundRequest.class) { public void handle(BeginChatRoundRequest request) { if (getCurrentRoundConfiguration().isChatEnabled()) { + + if (getCurrentRoundConfiguration().isFirstRound()) { + shuffleParticipants(); + initializeResourceDispenser(); + } // FIXME: need to handle properly corner case where chat is enabled before the first round // at that point the clients haven't been added to any groups yet. @@ -784,9 +794,11 @@ Utils.sleep(SERVER_SLEEP_INTERVAL); break; case WAITING: - // initialize the round so that - // the persister is set up for this next round. + // initialize persister first so we store all relevant events. + // persister MUST be initialized early so that we store pre-round events like QuizResponseEvent, ChatEvent, and the various Ranking requests. initializeRound(); + + getLogger().info("Round is initialized: now waiting for facilitator signal to start next round."); if (getCurrentRoundConfiguration().isQuizEnabled()) { getLogger().info("Waiting for all quizzes to be submitted."); @@ -979,12 +991,11 @@ } private void initializeRound() { - // pre-round initialization - // current round configuration should be set. - RoundConfiguration roundConfiguration = getCurrentRoundConfiguration(); - // initialize persister first so we store all relevant events. - // persister MUST be initialized early so that we store AddClientEvents etc.. - persister.initialize(roundConfiguration); + persister.initialize(getCurrentRoundConfiguration()); + initializeResourceDispenser(); + } + + private void initializeResourceDispenser() { // set up the resource dispenser, generates the initial resource distributions for the // groups, must be done after creating the client group relationships. resourceDispenser.initialize(); Modified: foraging/trunk/src/main/resources/configuration/asu-experiments/voting-limitedvision/round0.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/voting-limitedvision/round0.xml 2010-03-30 02:00:29 UTC (rev 498) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/voting-limitedvision/round0.xml 2010-03-31 00:58:49 UTC (rev 499) @@ -46,17 +46,16 @@ </p> <br> <form> -Which of the statements is <b><u>incorrect</u></b>? <br> -<input type="radio" name="q1" value="A">Your decisions of where to collect tokens affects the regeneration of tokens.<br> -<input type="radio" name="q1" value="B">When you have collected all tokens on -the screen, no new tokens will appear.<br> -<input type="radio" name="q1" value="C">Tokens grow from the middle of the +<span class='q1'>Q1. Which of the statements is <b><u>incorrect</u></b>?</span> <br> +<input type="radio" name="q1" value="A">A. Your decisions of where to collect tokens affects the regeneration of tokens.<br> +<input type="radio" name="q1" value="B">B. When you have collected all tokens on the screen, no new tokens will appear.<br> +<input type="radio" name="q1" value="C">C. Tokens grow from the middle of the screen.<br> -<input type="radio" name="q1" value="D">In order to collect a token you need +<input type="radio" name="q1" value="D">D. In order to collect a token you need to press the space bar while your yellow dot <img src="@CODEBASE_URL@/images/gem-self.gif"> is on a cell with a token.<br> <br><br> -Which sequence of situations is not possible? <br> +<span class='q2'>Q2. Which sequence of situations is not possible?</span> <br> <img src="@CODEBASE_URL@/images/question2.jpg"><br> <input type="radio" name="q2" value="A">A<br> <input type="radio" name="q2" value="B">B<br> Modified: foraging/trunk/src/main/resources/configuration/asu-experiments/voting-limitedvision/round4.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/voting-limitedvision/round4.xml 2010-03-30 02:00:29 UTC (rev 498) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/voting-limitedvision/round4.xml 2010-03-31 00:58:49 UTC (rev 499) @@ -17,7 +17,6 @@ <!-- before this round begins, we have a chat session --> <entry key="chat-enabled">true</entry> -<entry key="chat-duration">240</entry> <!-- enable sanctioning --> <entry key="sanction-type">real-time</entry> @@ -29,10 +28,10 @@ <!-- enable quiz --> <entry key='quiz'>true</entry> -<entry key='q1'>1</entry> -<entry key='q2'>2</entry> -<entry key='q3'>1</entry> -<entry key='q4'>1</entry> +<entry key='q1'>B</entry> +<entry key='q2'>C</entry> +<entry key='q3'>B</entry> +<entry key='q4'>B</entry> <entry key="instructions"> <![CDATA[ @@ -114,39 +113,39 @@ </p> <form> -Each time I press the numeric keys between 1-5 my tokens will be reduced -by:<br> -<input type="radio" name="q1" value="0">0 tokens<br> -<input type="radio" name="q1" value="1">1 token<br> -<input type="radio" name="q1" value="2">2 tokens<br> -<input type="radio" name="q1" value="4">4 tokens<br> +<span class='q1'>Q1. Each time I press the numeric keys between 1-5 my tokens will be reduced +by:</span><br> +<input type="radio" name="q1" value="A">A. 0 tokens<br> +<input type="radio" name="q1" value="B">B. 1 token<br> +<input type="radio" name="q1" value="C">C. 2 tokens<br> +<input type="radio" name="q1" value="D">D. 4 tokens<br> <br><br> -Each time I press the numeric keys between 1-5 the number of tokens of the -corresponding participant is reduced by:<br> -<input type="radio" name="q2" value="0">0 tokens<br> -<input type="radio" name="q2" value="1">1 token<br> -<input type="radio" name="q2" value="2">2 tokens<br> -<input type="radio" name="q2" value="4">4 tokens<br> +<span class='q2'>Q2. Each time I press the numeric keys between 1-5 the number of tokens of the +corresponding participant is reduced by:</span><br> +<input type="radio" name="q2" value="A">A. 0 tokens<br> +<input type="radio" name="q2" value="B">B. 1 token<br> +<input type="radio" name="q2" value="C">C. 2 tokens<br> +<input type="radio" name="q2" value="D">D. 4 tokens<br> <br><br> -The background of your yellow dot <img src="@CODEBASE_URL@/images/gem-self.gif"> turns blue. What does this represent?<br> -<input type="radio" name="q3" value="0">You collected a token<br> -<input type="radio" name="q3" value="1">Another participant is subtracting two +<span class='q3'>Q3. The background of your yellow dot <img src="@CODEBASE_URL@/images/gem-self.gif"> turns blue. What does this represent?</span><br> +<input type="radio" name="q3" value="A">A. You collected a token<br> +<input type="radio" name="q3" value="B">B. Another participant is subtracting two tokens from you<br> -<input type="radio" name="q3" value="2">You are subtracting two tokens from another +<input type="radio" name="q3" value="C">C. You are subtracting two tokens from another participant<br> -<input type="radio" name="q3" value="3">You are moving too fast<br> +<input type="radio" name="q3" value="D">D. You are moving too fast<br> <br><br> -Every time I press the numeric keys between 1-5:<br> -<input type="radio" name="q4" value="0">Two tokens are subtracted from my tokens +<span class='q4'>Q4. Every time I press the numeric keys between 1-5:</span><br> +<input type="radio" name="q4" value="A">A. Two tokens are subtracted from my tokens collected this round<br> -<input type="radio" name="q4" value="1">One token is subtracted from my tokens +<input type="radio" name="q4" value="B">B. One token is subtracted from my tokens collected this round<br> -<input type="radio" name="q4" value="2">The background of my yellow dot <img src="@CODEBASE_URL@/images/gem-self.gif"> turns blue +<input type="radio" name="q4" value="C">C. The background of my yellow dot <img src="@CODEBASE_URL@/images/gem-self.gif"> turns blue momentarily<br> -<input type="radio" name="q4" value="3">My yellow dot <img src="@CODEBASE_URL@/images/gem-self.gif"> is paused for two seconds<br> +<input type="radio" name="q4" value="D">D. My yellow dot <img src="@CODEBASE_URL@/images/gem-self.gif"> is paused for two seconds<br> <input type="submit" name="submit" value="Submit"> </form> Modified: foraging/trunk/src/main/resources/configuration/asu-experiments/voting-limitedvision/round5.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/voting-limitedvision/round5.xml 2010-03-30 02:00:29 UTC (rev 498) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/voting-limitedvision/round5.xml 2010-03-31 00:58:49 UTC (rev 499) @@ -24,7 +24,6 @@ <!-- before this round begins, we have a chat session --> <entry key="chat-enabled">true</entry> -<entry key="chat-duration">240</entry> <entry key="instructions"> <![CDATA[ Modified: foraging/trunk/src/main/resources/configuration/asu-experiments/voting-limitedvision/round6.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/voting-limitedvision/round6.xml 2010-03-30 02:00:29 UTC (rev 498) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/voting-limitedvision/round6.xml 2010-03-31 00:58:49 UTC (rev 499) @@ -22,7 +22,6 @@ <!-- before this round begins, we have a chat session --> <entry key="chat-enabled">true</entry> -<entry key="chat-duration">240</entry> <entry key="instructions"> <![CDATA[ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2010-04-07 20:09:42
|
Revision: 506 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=506&view=rev Author: alllee Date: 2010-04-07 20:09:35 +0000 (Wed, 07 Apr 2010) Log Message: ----------- minor updates to configuration instructions and removed errant comma in quiz feedback Modified Paths: -------------- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/GameWindow2D.java foraging/trunk/src/main/java/edu/asu/commons/foraging/event/SanctionUpdateEvent.java foraging/trunk/src/main/resources/configuration/asu-experiments/limitedvision-voting/round1.xml foraging/trunk/src/main/resources/configuration/asu-experiments/voting-limitedvision/round1.xml foraging/trunk/src/main/resources/configuration/asu-experiments/voting-limitedvision/round4.xml Removed Paths: ------------- foraging/trunk/src/main/resources/configuration/round0.xml foraging/trunk/src/main/resources/configuration/round1.xml foraging/trunk/src/main/resources/configuration/round2.xml foraging/trunk/src/main/resources/configuration/round3.xml foraging/trunk/src/main/resources/configuration/round4.xml foraging/trunk/src/main/resources/configuration/round5.xml foraging/trunk/src/main/resources/configuration/round6.xml foraging/trunk/src/main/resources/configuration/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-04-07 19:46:57 UTC (rev 505) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/client/GameWindow2D.java 2010-04-07 20:09:35 UTC (rev 506) @@ -197,6 +197,11 @@ } } + private String createStyleString(String questionNumber, String color) { + return String.format(".%s { color: %s; }", questionNumber, color); + } + + private ActionListener createQuizListener(final RoundConfiguration configuration) { return new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -243,14 +248,14 @@ if (! correctAnswers.isEmpty()) { correctString.append("<h3>Correctly answered questions</h3><ul>"); // FIXME: extract style modifications to method - for (String correctQuestionNumber : correctAnswers) { + for (String correctQuestionNumber : correctAnswers) { String styleString = String.format(".%s { color: black; }", correctQuestionNumber); styleSheet.addRule(styleString); - correctString.append(String.format("<li>Your answer, [ %s ] was correct for question %s.", - actualAnswers.get(correctQuestionNumber), - correctQuestionNumber)); - } - correctString.append("</ul>"); + correctString.append(String.format("<li>Your answer [ %s ] was correct for question %s.", + actualAnswers.get(correctQuestionNumber), + correctQuestionNumber)); + } + correctString.append("</ul>"); } correctString.append("<h3>Incorrectly answered questions</h3><ul>"); Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/event/SanctionUpdateEvent.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/event/SanctionUpdateEvent.java 2010-04-07 19:46:57 UTC (rev 505) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/event/SanctionUpdateEvent.java 2010-04-07 20:09:35 UTC (rev 506) @@ -4,7 +4,7 @@ import edu.asu.commons.foraging.model.GroupDataModel; import edu.asu.commons.net.Identifier; -public class SanctionUpdateEvent extends AbstractEvent{ +public class SanctionUpdateEvent extends AbstractEvent { private static final long serialVersionUID = 3456876534653456891L; Modified: foraging/trunk/src/main/resources/configuration/asu-experiments/limitedvision-voting/round1.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/limitedvision-voting/round1.xml 2010-04-07 19:46:57 UTC (rev 505) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/limitedvision-voting/round1.xml 2010-04-07 20:09:35 UTC (rev 506) @@ -20,20 +20,22 @@ <hr> <p> This is the first round of the experiment. The length of the round is 4 -minutes. Like in the practice round you can collect green tokens. This time -you earn <b>two cents</b> for each token collected. This time you -<b>cannot</b> reset the distribution of green tokens. +minutes. As in the practice round you can collect green tokens but now +you will earn <b>two cents</b> for each token collected. You <b>cannot</b> +reset the distribution of green tokens. </p> <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. One group's resource environment is distinct from the other groups. +selected. Each group's resource environment is distinct from the other groups. </p> <p> Each of you has been assigned a number from 1 to 5. 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. +</p> +<p> The other four 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 Modified: foraging/trunk/src/main/resources/configuration/asu-experiments/voting-limitedvision/round1.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/voting-limitedvision/round1.xml 2010-04-07 19:46:57 UTC (rev 505) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/voting-limitedvision/round1.xml 2010-04-07 20:09:35 UTC (rev 506) @@ -23,7 +23,6 @@ <entry key="sanction-cost">1</entry> <entry key="sanction-multiplier">2</entry> - <entry key="initial-distribution">.25</entry> <!-- enable quiz --> @@ -38,17 +37,31 @@ <h3>Round 1 Instructions</h3> <hr> <p> -This is the first round of the experiment. The length of the round is 4 minutes. Like in the practice round you can collect green tokens. This time you earn two cents for each token collected. This time you cannot reset the distribution of green tokens. +This is the first round of the experiment. The length of the round is 4 +minutes. As in the practice round you can collect green tokens but now +you will earn <b>two cents</b> for each token collected. You <b>cannot</b> +reset the distribution of green tokens. </p> <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. One 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 players in this room that have +been randomly selected. Each group's resource environment is distinct from the +other groups. </p> <p> -Each of you has been assigned a number from 1 to 5. These numbers will remain the same throughout the experiment but you will not be able to identify which person in the room has been assigned which number, so your anonymity is guaranteed. +Each of you has been assigned a number from 1 to 5. These numbers will remain +the same throughout the experiment but you will not be able to identify which +person in the room has been assigned which number, so your anonymity is +guaranteed. </p> <p> -The other four 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. -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 +The other four 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. 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><b>Do you have any questions so far?</b></p> Modified: foraging/trunk/src/main/resources/configuration/asu-experiments/voting-limitedvision/round4.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/voting-limitedvision/round4.xml 2010-04-07 19:46:57 UTC (rev 505) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/voting-limitedvision/round4.xml 2010-04-07 20:09:35 UTC (rev 506) @@ -21,11 +21,12 @@ <p> Round 4 is the same as the previous three rounds with two exceptions: +</p> + <ul> -<li>You cannot chat with other participants of your group before the round start. -<li>You cannot vote in favor or against the use of sanctioning. No sanctioning will be allowed. +<li>You cannot chat with the other members of your group before the round starts. +<li>You cannot vote in favor of or against the use of sanctioning. No sanctioning will be allowed. </ul> -</p> <p> If you have any questions please raise your hand. <b>Do you have any Deleted: foraging/trunk/src/main/resources/configuration/round0.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/round0.xml 2010-04-07 19:46:57 UTC (rev 505) +++ foraging/trunk/src/main/resources/configuration/round0.xml 2010-04-07 20:09:35 UTC (rev 506) @@ -1,68 +0,0 @@ -<?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> -<entry key="resource-width">13</entry> -<entry key="resource-depth">13</entry> -<entry key="practice-round">true</entry> -<entry key="private-property">true</entry> -<entry key="duration">240</entry> - -<entry key='tokens-field-of-vision'>true</entry> -<entry key='subjects-field-of-vision'>true</entry> - -<entry key="quiz">true</entry> -<entry key="q1">C</entry> -<entry key="q2">B</entry> - -<entry key='instructions'> -<![CDATA[ -<h3>Practice Round Instructions</h3> -<hr> -<p> -You will now have four minutes to practice with the experimental environment. -The decisions you make in this round will NOT influence your earnings. At the -At the beginning of the practice round half of the cells are occupied -with green tokens. The environment is a 13 x 13 grid of cells. -</p> -<p> -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><b>Please do not communicate with any other participant.</b></p> -<p>If you have any questions please raise your hand. <b>Do you have any questions so far?</b></p> -]]> -</entry> - -<entry key="quiz-instructions"> -<![CDATA[ -<p> -Before we begin the practice round you need to answer the following questions -correctly. You can only continue when you have answered all questions -correctly. If an error is made you will need to answer the questions again. -</p> -<br> -<form> -<span class='q1'>Q1. Which of the statements is <b><u>incorrect</u></b>?</span> <br> -<input type="radio" name="q1" value="A">A. Your decisions of where to collect tokens affects the regeneration of tokens.<br> -<input type="radio" name="q1" value="B">B. When you have collected all tokens on the screen, no new tokens will appear.<br> -<input type="radio" name="q1" value="C">C. Tokens grow from the middle of the -screen.<br> -<input type="radio" name="q1" value="D">D. In order to collect a token you need -to press the space bar while your yellow dot <img src="@CODEBASE_URL@/images/gem-self.gif"> is on a cell with a token.<br> -<br><br> - -<span class='q2'>Q2. Which sequence of situations is <b><u>not possible</u></b>?</span> <br> -<img src="@CODEBASE_URL@/images/question2.jpg"><br> -<input type="radio" name="q2" value="A">A<br> -<input type="radio" name="q2" value="B">B<br> -<input type="radio" name="q2" value="C">C<br> -<br> -<input type="submit" name="submit" value="Submit"> -</form> -]]> -</entry> - -</properties> Deleted: foraging/trunk/src/main/resources/configuration/round1.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/round1.xml 2010-04-07 19:46:57 UTC (rev 505) +++ foraging/trunk/src/main/resources/configuration/round1.xml 2010-04-07 20:09:35 UTC (rev 506) @@ -1,164 +0,0 @@ -<?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> -<entry key="display-group-tokens">true</entry> -<entry key="clients-per-group">5</entry> -<entry key="resource-depth">29</entry> -<entry key="resource-width">29</entry> -<entry key="duration">240</entry> - -<!-- enable field of vision for tokens and subjects --> -<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> - -<!-- before this round begins, we have a chat session --> -<entry key="chat-enabled">true</entry> - -<!-- enable sanctioning --> -<entry key="sanction-type">real-time</entry> -<entry key="sanction-cost">1</entry> -<entry key="sanction-multiplier">2</entry> - - -<entry key="initial-distribution">.25</entry> - -<!-- enable quiz --> -<entry key='quiz'>true</entry> -<entry key='q1'>B</entry> -<entry key='q2'>C</entry> -<entry key='q3'>B</entry> -<entry key='q4'>B</entry> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 1 Instructions</h3> -<hr> -<p> -This is the first round of the experiment. The length of the round is 4 minutes. Like in the practice round you can collect green tokens. This time you earn two cents for each token collected. This time you cannot reset the distribution of green tokens. -</p> -<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. One group's resource environment is distinct from the other groups. -</p> -<p> -Each of you has been assigned a number from 1 to 5. These numbers will remain the same throughout the experiment but you will not be able to identify which person in the room has been assigned which number, so your anonymity is guaranteed. -</p> -<p> -The other four 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. -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><b>Do you have any questions so far?</b></p> -<p> -Before the next round starts you can anonymously communicate by text messages -for four minutes with the other participants in your group. You can use this -opportunity to discuss the experiment and coordinate your actions to improve -your earnings. You may not promise side-payments after the experiment is -completed or make any threats. You are also not allowed to reveal your real -identity. We are monitoring the chat traffic while you chat. -</p> -<p> -During the next round you will have the option to reduce the earnings of another -participant at a cost to your own earnings. -</p> -<ul> -<li>If you press the numeric key 1-5 corresponding to another participant, you -will reduce the number of tokens they have collected in this round by two -tokens. This will also reduce your own token amount by one token. The decision -whether or when to use this option is up to you. -<li>When you reduce the number of tokens of another participant, they will -receive a message stating that you have reduced their tokens. Likewise, if -another participant reduces your number of tokens, you will also receive a -message. These messages will be displayed on the bottom of your screen. -<li>If your tokens are being reduced or you are reducing another participant's -tokens, you will receive some visual cues. When you are sanctioned your yellow dot will turn red briefly with a blue background. The participant sanctioning you will turn purple with a white background. -<li>You may sanction other participants as long as there are -tokens remaining on the screen and while both you and the other participant -have a positive number of tokens collected during the round. <b>Each time</b> -you press the numeric key corresponding to another participant your token -amount is reduced by <b>one</b>, and their token amount is reduced by -<b>two</b>. <b>Note:</b> You can only remove tokens from a participant that is -visible to you. -</ul> -<p> - -<p> -The length of this round is four minutes. -</p> -<p> -If you have any questions please raise your hand. <b>Do you have any -questions so far?</b> -</p> -]]> -</entry> - -<entry key="chat-instructions"> -<![CDATA[ -<p> -You can now chat with the other participants in your group for 4 minutes -total. During the chat 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 as "1", "2","3", "4", or "5" in the -chat box. You can send a chat message by typing into the textfield at the -bottom of the screen and pressing the "enter" key on your keyboard. -</p> -]]> -</entry> -<entry key="quiz-instructions"> -<![CDATA[ -<p>Before the next round begins you must complete the quiz below. You can -only continue when you have answered all questions correctly. If an error is -made you will need to answer the questions again. -</p> - -<form> -<span class='q1'>Q1. Each time I press the numeric keys between 1-5 my tokens will be reduced -by:</span><br> -<input type="radio" name="q1" value="A">A. 0 tokens<br> -<input type="radio" name="q1" value="B">B. 1 token<br> -<input type="radio" name="q1" value="C">C. 2 tokens<br> -<input type="radio" name="q1" value="D">D. 4 tokens<br> -<br><br> - -<span class='q2'>Q2. Each time I press the numeric keys between 1-5 the number of tokens of the -corresponding participant is reduced by:</span><br> -<input type="radio" name="q2" value="A">A. 0 tokens<br> -<input type="radio" name="q2" value="B">B. 1 token<br> -<input type="radio" name="q2" value="C">C. 2 tokens<br> -<input type="radio" name="q2" value="D">D. 4 tokens<br> -<br><br> - -<span class='q3'>Q3. The background of your yellow dot <img src="@CODEBASE_URL@/images/gem-self.gif"> turns blue. What does this represent?</span><br> -<input type="radio" name="q3" value="A">A. You collected a token<br> -<input type="radio" name="q3" value="B">B. Another participant is subtracting two -tokens from you<br> -<input type="radio" name="q3" value="C">C. You are subtracting two tokens from another -participant<br> -<input type="radio" name="q3" value="D">D. You are moving too fast<br> -<br><br> - -<span class='q4'>Q4. Every time I press the numeric keys between 1-5:</span><br> -<input type="radio" name="q4" value="A">A. Two tokens are subtracted from my tokens -collected this round<br> -<input type="radio" name="q4" value="B">B. One token is subtracted from my tokens -collected this round<br> -<input type="radio" name="q4" value="C">C. The background of my yellow dot <img src="@CODEBASE_URL@/images/gem-self.gif"> turns blue -momentarily<br> -<input type="radio" name="q4" value="D">D. My yellow dot <img src="@CODEBASE_URL@/images/gem-self.gif"> is paused for two seconds<br> - -<input type="submit" name="submit" value="Submit"> -</form> -]]> -</entry> -</properties> Deleted: foraging/trunk/src/main/resources/configuration/round2.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/round2.xml 2010-04-07 19:46:57 UTC (rev 505) +++ foraging/trunk/src/main/resources/configuration/round2.xml 2010-04-07 20:09:35 UTC (rev 506) @@ -1,74 +0,0 @@ -<?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> -<entry key="display-group-tokens">true</entry> -<entry key="clients-per-group">5</entry> -<entry key="resource-depth">29</entry> -<entry key="resource-width">29</entry> -<entry key="duration">240</entry> - -<!-- enable field of vision for tokens and subjects --> -<entry key='tokens-field-of-vision'>true</entry> -<entry key='subjects-field-of-vision'>true</entry> - -<!-- enable sanctioning --> -<entry key="sanction-type">real-time</entry> -<entry key="sanction-cost">1</entry> -<entry key="sanction-multiplier">2</entry> - -<entry key="initial-distribution">.25</entry> - -<entry key='always-explicit'>true</entry> -<entry key='max-cell-occupancy'>1</entry> - -<!-- before this round begins, we have a chat session --> -<entry key="chat-enabled">true</entry> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 2 Instructions</h3> -<hr> -<p> -Round 2 is the same as round 1.</p> -<p> -The length of this round is again four minutes. -</p> -<p> -If you have any questions please raise your hand. <b>Do you have any -questions so far?</b> -</p> -]]> -</entry> - -<entry key="chat-instructions"> -<![CDATA[ -<p> -You can now chat with the other participants in your group for 4 minutes -total. During the chat 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 as "1", "2","3", "4", or "5" in the -chat box. You can send a chat message by typing into the textfield at the -bottom of the screen and pressing the "enter" key on your keyboard. -</p> -]]> -</entry> - -<entry key='private-chat-instructions'> -<![CDATA[ -You may send private messages to a specific participant by clicking on the -appropriately labeled button (1, 2, 3, 4, or 5) before typing your message in -the chat box and sending it. By default you are communicating with all -members of your group. -]]> -</entry> - -</properties> Deleted: foraging/trunk/src/main/resources/configuration/round3.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/round3.xml 2010-04-07 19:46:57 UTC (rev 505) +++ foraging/trunk/src/main/resources/configuration/round3.xml 2010-04-07 20:09:35 UTC (rev 506) @@ -1,61 +0,0 @@ -<?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> -<entry key="display-group-tokens">true</entry> -<entry key="clients-per-group">5</entry> -<entry key="resource-depth">29</entry> -<entry key="resource-width">29</entry> -<entry key="duration">240</entry> - -<entry key='tokens-field-of-vision'>true</entry> -<entry key='subjects-field-of-vision'>true</entry> -<!-- enable sanctioning --> -<entry key="sanction-type">real-time</entry> -<entry key="sanction-cost">1</entry> -<entry key="sanction-multiplier">2</entry> - -<entry key="initial-distribution">.25</entry> - -<entry key='always-explicit'>true</entry> -<entry key='max-cell-occupancy'>1</entry> - -<!-- before this round begins, we have a chat session --> -<entry key="chat-enabled">true</entry> - -<entry key="instructions"> -<![CDATA[ -<h3>Round 3 Instructions</h3> -<hr> -<p> -Round 3 is the same as round 2.</p> -<p> -The length of this round is again four minutes. -</p> -<p> -If you have any questions please raise your hand. <b>Do you have any -questions so far?</b> -</p> -]]> -</entry> - - -<entry key="chat-instructions"> -<![CDATA[ -<p> -You can now chat with the other participants in your group for 4 minutes -total. During the chat 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 detect that somebody has revealed their identity, we will have to stop the -experiment and remove that person's entire group from the experiment. -</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 at the -bottom of the screen and pressing the "enter" key. </p> -]]> -</entry> -</properties> Deleted: foraging/trunk/src/main/resources/configuration/round4.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/round4.xml 2010-04-07 19:46:57 UTC (rev 505) +++ foraging/trunk/src/main/resources/configuration/round4.xml 2010-04-07 20:09:35 UTC (rev 506) @@ -1,36 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> -<properties> -<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='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 4 Instructions</h3> -<hr> - -<p> -Round 4 is the same as the previous three rounds with two exceptions: -<ul> -<li>You cannot chat with other participants of your group before the round start. -<li>You cannot vote in favor or against the use of sanctioning. No sanctioning will be allowed. -</ul> -</p> - -<p> -If you have any questions please raise your hand. <b>Do you have any -questions so far?</b> -</p> -]]> -</entry> -</properties> Deleted: foraging/trunk/src/main/resources/configuration/round5.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/round5.xml 2010-04-07 19:46:57 UTC (rev 505) +++ foraging/trunk/src/main/resources/configuration/round5.xml 2010-04-07 20:09:35 UTC (rev 506) @@ -1,34 +0,0 @@ -<?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> -<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> - - -<!-- enable field of vision for tokens and subjects --> -<entry key='initial-distribution'>.25</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 5 Instructions</h3> -<hr> -<p> -Round 5 is the same as round 4. -</p> -<p> -If you have any questions please raise your hand. <b>Do you have any -questions so far?</b> -</p> -]]> -</entry> -</properties> Deleted: foraging/trunk/src/main/resources/configuration/round6.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/round6.xml 2010-04-07 19:46:57 UTC (rev 505) +++ foraging/trunk/src/main/resources/configuration/round6.xml 2010-04-07 20:09:35 UTC (rev 506) @@ -1,54 +0,0 @@ -<?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> -<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> - -<!-- enable field of vision for tokens and subjects --> -<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="instructions"> -<![CDATA[ -<h3>Round 6 Instructions</h3> -<hr> -<p> -Round 6 is the same as round 5. -</p> -<p> -If you have any questions please raise your hand. <b>Do you have any -questions so far?</b> -</p> -]]> -</entry> - -<entry key="last-round-debriefing"> -<![CDATA[ -<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> -<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 -your survey. -</p> -<p> -Please answer the survey carefully and thank you for participating. -</p> -]]> -</entry> - -</properties> Deleted: foraging/trunk/src/main/resources/configuration/server.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/server.xml 2010-04-07 19:46:57 UTC (rev 505) +++ foraging/trunk/src/main/resources/configuration/server.xml 2010-04-07 20:09:35 UTC (rev 506) @@ -1,98 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> -<properties> -<comment>Costly Sanctioning XML-ized experiment round configuration</comment> -<entry key="hostname">@SERVER_ADDRESS@</entry> -<entry key="port">@PORT_NUMBER@</entry> -<entry key="round0">round0.xml</entry> -<entry key="round1">round1.xml</entry> -<entry key="round2">round2.xml</entry> -<entry key="round3">round3.xml</entry> -<entry key="round4">round4.xml</entry> -<entry key="round5">round5.xml</entry> -<entry key="round6">round6.xml</entry> -<entry key="wait-for-participants">true</entry> -<entry key="number-of-rounds">7</entry> -<entry key="facilitator-instructions"> -<![CDATA[ -<h3>Facilitator Instructions</h3> -<p> -Welcome to the facilitator interface. This interface allows you to control -the experiment. You may only modify configuration parameters <b>before</b> -you start the experiment by selecting the Configuration menu. When all the -participants are ready to begin the experiment, you can start the experiment -by selecting Experiment -> Start. After a round has been completed you -will be able to view the statistics for all of the participants. You can -begin the next round by selecting Round -> Start. -</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. -]]> -</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 -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. |
From: <al...@us...> - 2010-06-30 19:17:54
|
Revision: 522 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=522&view=rev Author: alllee Date: 2010-06-30 19:17:48 +0000 (Wed, 30 Jun 2010) Log Message: ----------- updated svn:keywords and adding quiz response + voting support to ForagingSaveFileConverter Modified Paths: -------------- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/EnforcementPanel.java foraging/trunk/src/main/java/edu/asu/commons/foraging/client/RegulationPanel.java foraging/trunk/src/main/java/edu/asu/commons/foraging/event/EnforcementMechanismUpdateEvent.java foraging/trunk/src/main/java/edu/asu/commons/foraging/event/EnforcementRankingRequest.java foraging/trunk/src/main/java/edu/asu/commons/foraging/event/QuizResponseEvent.java foraging/trunk/src/main/java/edu/asu/commons/foraging/event/RegulationRankingRequest.java foraging/trunk/src/main/java/edu/asu/commons/foraging/event/RegulationSubmissionUpdateEvent.java foraging/trunk/src/main/java/edu/asu/commons/foraging/event/RegulationUpdateEvent.java foraging/trunk/src/main/java/edu/asu/commons/foraging/event/SubmitRegulationRequest.java foraging/trunk/src/main/java/edu/asu/commons/foraging/util/ForagingSaveFileConverter.java foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fullvision/round1.xml Property Changed: ---------------- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/EnforcementPanel.java foraging/trunk/src/main/java/edu/asu/commons/foraging/client/RegulationPanel.java foraging/trunk/src/main/java/edu/asu/commons/foraging/event/CensoredChatRequest.java foraging/trunk/src/main/java/edu/asu/commons/foraging/event/EnforcementMechanismUpdateEvent.java foraging/trunk/src/main/java/edu/asu/commons/foraging/event/EnforcementRankingRequest.java foraging/trunk/src/main/java/edu/asu/commons/foraging/event/FacilitatorCensoredChatRequest.java foraging/trunk/src/main/java/edu/asu/commons/foraging/event/MonitorTaxEvent.java foraging/trunk/src/main/java/edu/asu/commons/foraging/event/QuizResponseEvent.java foraging/trunk/src/main/java/edu/asu/commons/foraging/event/RegulationRankingRequest.java foraging/trunk/src/main/java/edu/asu/commons/foraging/event/RegulationSubmissionUpdateEvent.java foraging/trunk/src/main/java/edu/asu/commons/foraging/event/RegulationUpdateEvent.java foraging/trunk/src/main/java/edu/asu/commons/foraging/event/SanctionAppliedEvent.java foraging/trunk/src/main/java/edu/asu/commons/foraging/event/SanctionUpdateEvent.java foraging/trunk/src/main/java/edu/asu/commons/foraging/event/SubmitRegulationRequest.java foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorChatPanel.java foraging/trunk/src/main/java/edu/asu/commons/foraging/model/EnforcementMechanism.java foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ForagingRole.java foraging/trunk/src/main/java/edu/asu/commons/foraging/model/SanctionMechanism.java foraging/trunk/src/main/java/edu/asu/commons/foraging/util/AviOutputStream.java foraging/trunk/src/main/java/edu/asu/commons/foraging/util/DataAtomOutputStream.java foraging/trunk/src/main/java/edu/asu/commons/foraging/util/DataChunkOutputStream.java foraging/trunk/src/main/java/edu/asu/commons/foraging/util/FilterImageOutputStream.java foraging/trunk/src/main/java/edu/asu/commons/foraging/util/IntervalChecker.java foraging/trunk/src/main/java/edu/asu/commons/foraging/util/MovieCreator.java foraging/trunk/src/main/java/edu/asu/commons/foraging/util/MovieCreatorProcessor.java foraging/trunk/src/main/java/edu/asu/commons/foraging/util/QuickTimeOutputStream.java foraging/trunk/src/main/java/edu/asu/commons/foraging/util/VideoFormat.java Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/client/EnforcementPanel.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/EnforcementPanel.java 2010-06-29 16:08:12 UTC (rev 521) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/client/EnforcementPanel.java 2010-06-30 19:17:48 UTC (rev 522) @@ -20,12 +20,12 @@ import edu.asu.commons.net.Identifier; /** - * $Id: EnforcementPanel.java 45 2008-08-21 00:47:39Z dbarge $ + * $Id$ * * Enforcement panel is used to vote enforcement mechanism * * @author dbarge - * @version $Revision: 45 $ + * @version $Revision$ */ @SuppressWarnings("serial") Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/client/EnforcementPanel.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/client/RegulationPanel.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/client/RegulationPanel.java 2010-06-29 16:08:12 UTC (rev 521) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/client/RegulationPanel.java 2010-06-30 19:17:48 UTC (rev 522) @@ -31,7 +31,7 @@ /** - * $Id: Sanctioning.java 45 2008-08-21 00:47:39Z dbarge $ + * $Id$ * * Sanctioning panel is used to create regulations and * enforcement mechanism @@ -39,7 +39,7 @@ * FIXME: split this functionality out into two different panels, one for submission and the other for voting. * * @author dbarge - * @version $Revision: 45 $ + * @version $Revision$ */ @SuppressWarnings("serial") Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/client/RegulationPanel.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/event/CensoredChatRequest.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/event/EnforcementMechanismUpdateEvent.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/event/EnforcementMechanismUpdateEvent.java 2010-06-29 16:08:12 UTC (rev 521) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/event/EnforcementMechanismUpdateEvent.java 2010-06-30 19:17:48 UTC (rev 522) @@ -7,12 +7,12 @@ /** - * $Id: VoteEvent.java 49 2008-09-04 16:57:40Z dbarge $ + * $Id$ * * Sent from the server to all clients about the * updated vote stats * @author <a href='db...@as...'>Deepak Barge</a> - * @version $Revision: 49 $ + * @version $Revision$ */ public class EnforcementMechanismUpdateEvent extends AbstractEvent { Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/event/EnforcementMechanismUpdateEvent.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/event/EnforcementRankingRequest.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/event/EnforcementRankingRequest.java 2010-06-29 16:08:12 UTC (rev 521) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/event/EnforcementRankingRequest.java 2010-06-30 19:17:48 UTC (rev 522) @@ -2,16 +2,17 @@ import edu.asu.commons.event.AbstractPersistableEvent; +import edu.asu.commons.foraging.model.SanctionMechanism; import edu.asu.commons.net.Identifier; /** - * $Id: RegulationRequest.java 1 2008-07-23 22:15:18Z dbarge $ + * $Id$ * * Sent from a client to the server signaling that the client * has updated the votes to the given options * - * @author <a href='db...@as...'>Deepak Barge</a> - * @version $Revision: 1 $ + * @author <a href='all...@as...'>Allen Lee</a> + * @version $Revision$ */ public class EnforcementRankingRequest extends AbstractPersistableEvent { @@ -28,4 +29,29 @@ public int[] getRankings() { return rankings; } + + @Override + public String toString() { + return String.format("%s, %s, %s", id, "Enforcement Mechanism Ranking", convertRankings()); + } + + private String convertRankings() { + StringBuilder builder = new StringBuilder(); + // FIXME: this will need to be changed after we fix voting which + // needs refactoring + switch (rankings[0]) { + case 0: + // voted for no sanctioning + builder.append("1: no sanctioning, 2: sanctioning"); + break; + case 1: + // voted for sanctioning + builder.append("1: sanctioning, 2: no sanctioning"); + break; + default: + System.err.println("Invalid ranking: " + rankings[0]); + } + return builder.toString(); + } + } Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/event/EnforcementRankingRequest.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/event/FacilitatorCensoredChatRequest.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/event/MonitorTaxEvent.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/event/QuizResponseEvent.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/event/QuizResponseEvent.java 2010-06-29 16:08:12 UTC (rev 521) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/event/QuizResponseEvent.java 2010-06-30 19:17:48 UTC (rev 522) @@ -8,13 +8,13 @@ import edu.asu.commons.net.Identifier; /** - * $Id: QuizResponseEvent.java 461 2010-02-05 00:28:28Z alllee $ + * $Id$ * * A client's quiz responses for a given quiz page. * * * @author <a href='mailto:All...@as...'>Allen Lee</a> - * @version $Rev: 461 $ + * @version $Rev$ */ public class QuizResponseEvent extends AbstractPersistableEvent implements ClientRequest { @@ -38,7 +38,8 @@ return incorrectAnswers; } + @Override public String toString() { - return id + " quiz page response: " + responses + "\n\t incorrect: " + incorrectAnswers; + return String.format("%s, responses: %s, incorrect answers: %s", id, responses, incorrectAnswers); } } Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/event/QuizResponseEvent.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/event/RegulationRankingRequest.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/event/RegulationRankingRequest.java 2010-06-29 16:08:12 UTC (rev 521) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/event/RegulationRankingRequest.java 2010-06-30 19:17:48 UTC (rev 522) @@ -8,12 +8,12 @@ import edu.asu.commons.net.Identifier; /** - * $Id: RegulationRequest.java 1 2008-07-23 22:15:18Z dbarge $ + * $Id$ * * * * @author <a href='db...@as...'>Deepak Barge</a> - * @version $Revision: 1 $ + * @version $Revision$ */ public class RegulationRankingRequest extends AbstractPersistableEvent { Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/event/RegulationRankingRequest.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/event/RegulationSubmissionUpdateEvent.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/event/RegulationSubmissionUpdateEvent.java 2010-06-29 16:08:12 UTC (rev 521) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/event/RegulationSubmissionUpdateEvent.java 2010-06-30 19:17:48 UTC (rev 522) @@ -7,12 +7,12 @@ /** - * $Id: VoteEvent.java 49 2008-09-04 16:57:40Z dbarge $ + * $Id$ * * Sent from the server to all clients about the updated vote stats. * * @author <a href='db...@as...'>Deepak Barge</a> - * @version $Revision: 49 $ + * @version $Revision$ */ public class RegulationSubmissionUpdateEvent extends AbstractEvent { Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/event/RegulationSubmissionUpdateEvent.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/event/RegulationUpdateEvent.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/event/RegulationUpdateEvent.java 2010-06-29 16:08:12 UTC (rev 521) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/event/RegulationUpdateEvent.java 2010-06-30 19:17:48 UTC (rev 522) @@ -7,12 +7,12 @@ /** - * $Id: VoteEvent.java 49 2008-09-04 16:57:40Z dbarge $ + * $Id$ * * Notifices clients of the regulation data receiving the highest vote ranking. * * @author <a href='db...@as...'>Deepak Barge</a> - * @version $Revision: 49 $ + * @version $Revision$ */ public class RegulationUpdateEvent extends AbstractEvent { Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/event/RegulationUpdateEvent.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/event/SanctionAppliedEvent.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/event/SanctionUpdateEvent.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/event/SubmitRegulationRequest.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/event/SubmitRegulationRequest.java 2010-06-29 16:08:12 UTC (rev 521) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/event/SubmitRegulationRequest.java 2010-06-30 19:17:48 UTC (rev 522) @@ -5,12 +5,12 @@ import edu.asu.commons.net.Identifier; /** - * $Id: RegulationRequest.java 1 2008-07-23 22:15:18Z dbarge $ + * $Id$ * * * * @author <a href='db...@as...'>Deepak Barge</a> - * @version $Revision: 1 $ + * @version $Revision$ */ public class SubmitRegulationRequest extends AbstractPersistableEvent { Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/event/SubmitRegulationRequest.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorChatPanel.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/model/EnforcementMechanism.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ForagingRole.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/model/SanctionMechanism.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/util/AviOutputStream.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/util/DataAtomOutputStream.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/util/DataChunkOutputStream.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/util/FilterImageOutputStream.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/util/ForagingSaveFileConverter.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/util/ForagingSaveFileConverter.java 2010-06-29 16:08:12 UTC (rev 521) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/util/ForagingSaveFileConverter.java 2010-06-30 19:17:48 UTC (rev 522) @@ -65,8 +65,8 @@ new AggregateTokenSpatialDistributionProcessor(), new CollectedTokenSpatialDistributionProcessor(), new MovementStatisticsProcessor(), - new AggregateCollectedTokenNeighborProcessor(), - new MovieCreatorProcessor() + new AggregateCollectedTokenNeighborProcessor() + // new MovieCreatorProcessor() )); Persister.processSaveFiles(allSaveFilesDirectory, processors); return true; @@ -294,7 +294,7 @@ for (PersistableEvent event : actions) { long elapsedTime = savedRoundData.getElapsedTimeInSeconds(event); if (isIntervalElapsed(elapsedTime)) { - writeData(writer, serverDataModel, clientSpatialDistributionMap); + writeData(writer, serverDataModel, clientSpatialDistributionMap); } if (event instanceof TokenCollectedEvent) { TokenCollectedEvent tokenCollectedEvent = (TokenCollectedEvent) event; @@ -310,11 +310,12 @@ writeData(writer, serverDataModel, clientSpatialDistributionMap); } - private void writeData( - PrintWriter writer, - ServerDataModel serverDataModel, - Map<Identifier, ClientSpatialDistribution> clientSpatialDistributionMap) { - ArrayList<GroupDataModel> groups = new ArrayList<GroupDataModel>(serverDataModel.getGroups()); + private void writeData( + PrintWriter writer, + ServerDataModel serverDataModel, + Map<Identifier, ClientSpatialDistribution> clientSpatialDistributionMap) + { + ArrayList<GroupDataModel> groups = new ArrayList<GroupDataModel>(serverDataModel.getGroups()); for (GroupDataModel group: groups) { // String groupLabel = "Group # " + groups.indexOf(group); String groupLabel = group.toString(); @@ -548,14 +549,16 @@ } else if (event instanceof QuizResponseEvent) { QuizResponseEvent response = (QuizResponseEvent) event; - Identifier source = response.getId(); - - + Identifier id = response.getId(); + String line = String.format("%s, %s", savedRoundData.toSecondString(event), response.toString()); + writer.println(line); } else if (event instanceof EnforcementRankingRequest) { + System.err.println("enforcement ranking request: " + event); EnforcementRankingRequest request = (EnforcementRankingRequest) event; Identifier id = request.getId(); - String line = String.format("%s, %s, %s, %s", savedRoundData.toSecondString(event), id, request.toString(), Arrays.asList(request.getRankings())); + String line = String.format("%s, %s", savedRoundData.toSecondString(event), request.toString()); + writer.println(line); } else { writer.println(String.format("%s, %s", savedRoundData.toSecondString(event), event.toString())); Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/util/IntervalChecker.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/util/MovieCreator.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/util/MovieCreatorProcessor.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/util/QuickTimeOutputStream.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Property changes on: foraging/trunk/src/main/java/edu/asu/commons/foraging/util/VideoFormat.java ___________________________________________________________________ Added: svn:keywords + Date Revision Id Modified: foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fullvision/round1.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fullvision/round1.xml 2010-06-29 16:08:12 UTC (rev 521) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/voting-fullvision/round1.xml 2010-06-30 19:17:48 UTC (rev 522) @@ -54,12 +54,8 @@ The other four 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. 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 +that displays the remaining time in the round. </p> -<img src="@CODEBASE_URL@/images/vision-range.jpg"> <p><b>Do you have any questions so far?</b></p> <p> Before the next round starts you can anonymously communicate by text messages This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2010-11-23 19:32:03
|
Revision: 533 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=533&view=rev Author: alllee Date: 2010-11-23 19:31:57 +0000 (Tue, 23 Nov 2010) Log Message: ----------- adding linewrapping to the censored chat component Modified Paths: -------------- foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorChatPanel.java foraging/trunk/src/main/resources/configuration/asu-experiments/censored-chat/round1.xml 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-08-17 01:06:37 UTC (rev 532) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java 2010-11-23 19:31:57 UTC (rev 533) @@ -513,7 +513,7 @@ public String getCensoredChatInstructions() { return getProperty("censored-chat-instructions", - "Your messages must be approved by our censor before they will be relayed to the rest of your group."); + "Your messages must be approved before they will be relayed to the rest of your group."); } public int getNumberOfChatsPerSecond() { Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorChatPanel.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorChatPanel.java 2010-08-17 01:06:37 UTC (rev 532) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/facilitator/FacilitatorChatPanel.java 2010-11-23 19:31:57 UTC (rev 533) @@ -25,8 +25,10 @@ /** * $Id$ * - * A JPanel component for approving chat messages. + * Exposes a JPanel for approving chat messages and tied to a specific Facilitator instance. * + * FIXME: should get rid of Facilitator dependency and use EventChannel instead + * * * @author <a href='mailto:All...@as...'>Allen Lee</a> * @version $Rev$ @@ -105,7 +107,9 @@ /** * - * Mini component for a chat request that can be approved or denied. + * Mini component for a chat request that can be approved or denied. + * Contains a TextArea for the message, approve and deny buttons, + * and a label to be shown once the request has been approved or denied. * */ public class CensoredChatRequestView { @@ -167,6 +171,7 @@ private JTextArea createTextArea(CensoredChatRequest request) { JTextArea textArea = new JTextArea( toString( request ) ); + textArea.setLineWrap(true); textArea.setEditable(false); return textArea; } @@ -176,5 +181,4 @@ } } - } Modified: foraging/trunk/src/main/resources/configuration/asu-experiments/censored-chat/round1.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/censored-chat/round1.xml 2010-08-17 01:06:37 UTC (rev 532) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/censored-chat/round1.xml 2010-11-23 19:31:57 UTC (rev 533) @@ -40,7 +40,7 @@ <entry key='censored-chat-instructions'> <![CDATA[ <p> -Your messages must first be approved by our censor before they will be relayed to the rest of your group. +Your messages must first be approved before they will be relayed to the rest of your group. </p> ]]> </entry> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2011-05-08 02:02:45
|
Revision: 534 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=534&view=rev Author: alllee Date: 2011-05-08 02:02:39 +0000 (Sun, 08 May 2011) Log Message: ----------- initial changes to round configuration for proposed fall 2011 experiments Modified Paths: -------------- foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java Added Paths: ----------- foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/ foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/stationary-limitedvision/ foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/stationary-limitedvision/round0.xml foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/stationary-limitedvision/round1.xml foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/stationary-limitedvision/round2.xml foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/stationary-limitedvision/round3.xml foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/stationary-limitedvision/round4.xml foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/stationary-limitedvision/round5.xml foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/stationary-limitedvision/round6.xml foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/stationary-limitedvision/server.xml 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-11-23 19:31:57 UTC (rev 533) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java 2011-05-08 02:02:39 UTC (rev 534) @@ -43,22 +43,15 @@ private static final double DEFAULT_TOKEN_BIRTH_PROBABILITY = 0.01d; - - private final static Map<String, SanctionType> sanctionTypeMap = new HashMap<String, SanctionType>(3); public enum SanctionType { - REAL_TIME("real-time"), POST_ROUND("post-round"), NONE("none"); - private SanctionType(String name) { - sanctionTypeMap.put(name, this); - } + REAL_TIME, POST_ROUND, NONE; public static SanctionType find(String name) { - SanctionType type = sanctionTypeMap.get(name); - if (type == null) { - type = valueOf(name); - if (type == null) { - type = NONE; - } + try { + return valueOf(name.toUpperCase().replaceAll("-", "_")); } - return type; + catch (Exception exception) { + return NONE; + } } } @@ -511,6 +504,14 @@ return getBooleanProperty("censored-chat-enabled", false); } + public boolean isTrustGameEnabled() { + return getBooleanProperty("trust-game", false); + } + + public boolean isInRoundChatEnabled() { + return getBooleanProperty("in-round-chat-enabled", false); + } + public String getCensoredChatInstructions() { return getProperty("censored-chat-instructions", "Your messages must be approved before they will be relayed to the rest of your group."); @@ -568,7 +569,6 @@ instructionsBuilder.append("<hr><b>"); instructionsBuilder.append(getQuizInstructions()).append("</b>"); } - return instructionsBuilder; } Added: foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/stationary-limitedvision/round0.xml =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/stationary-limitedvision/round0.xml ___________________________________________________________________ Added: svn:mime-type + application/xml Added: foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/stationary-limitedvision/round1.xml =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/stationary-limitedvision/round1.xml ___________________________________________________________________ Added: svn:mime-type + application/xml Added: foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/stationary-limitedvision/round2.xml =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/stationary-limitedvision/round2.xml ___________________________________________________________________ Added: svn:mime-type + application/xml Added: foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/stationary-limitedvision/round3.xml =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/stationary-limitedvision/round3.xml ___________________________________________________________________ Added: svn:mime-type + application/xml Added: foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/stationary-limitedvision/round4.xml =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/stationary-limitedvision/round4.xml ___________________________________________________________________ Added: svn:mime-type + application/xml Added: foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/stationary-limitedvision/round5.xml =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/stationary-limitedvision/round5.xml ___________________________________________________________________ Added: svn:mime-type + application/xml Added: foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/stationary-limitedvision/round6.xml =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/stationary-limitedvision/round6.xml ___________________________________________________________________ Added: svn:mime-type + application/xml Added: foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/stationary-limitedvision/server.xml =================================================================== (Binary files differ) Property changes on: foraging/trunk/src/main/resources/configuration/asu-experiments/fall-2011/stationary-limitedvision/server.xml ___________________________________________________________________ Added: svn:mime-type + application/xml This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |