[virtualcommons-svn] SF.net SVN: virtualcommons:[369] irrigation/trunk/src/main
Status: Beta
Brought to you by:
alllee
From: <al...@us...> - 2009-11-19 07:48:08
|
Revision: 369 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=369&view=rev Author: alllee Date: 2009-11-19 07:48:01 +0000 (Thu, 19 Nov 2009) Log Message: ----------- minor interface improvement, lifted chat instructions to config file. should look into templating language at some point... Modified Paths: -------------- irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/InfrastructureEfficiencyChartPanel.java irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/MainIrrigationGameWindow.java irrigation/trunk/src/main/java/edu/asu/commons/irrigation/conf/ServerConfiguration.java irrigation/trunk/src/main/resources/configuration/asu-fall-2009/mixed-pretest/irrigation.xml Property Changed: ---------------- irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/MainIrrigationGameWindow.java Modified: irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/InfrastructureEfficiencyChartPanel.java =================================================================== --- irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/InfrastructureEfficiencyChartPanel.java 2009-11-19 03:42:52 UTC (rev 368) +++ irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/InfrastructureEfficiencyChartPanel.java 2009-11-19 07:48:01 UTC (rev 369) @@ -48,39 +48,40 @@ } private ChartPanel createChartPanel() { - final XYSeries actualFlowCapacitySeries = new XYSeries("Actual"); - final XYSeries potentialFlowCapacitySeries = new XYSeries("Potential"); - // final XYSeries actualFlowCapacitySeriesY = new XYSeries("Actual"); - final XYSeries initialInfrastructureEfficiencySeries = new XYSeries("Initial"); + final XYSeries postInvestmentInfrastructureEfficiencySeries = new XYSeries("Infrastructure Efficiency After Investment"); + final XYSeries potentialInfrastructureEfficiencySeries = new XYSeries("Infrastructure Efficiency Potential"); + final XYSeries preInvestmentInfrastructureEfficiencySeries = new XYSeries("Infrastructure Efficiency Before Investment"); final XYSeries waterSupplySeries = new XYSeries("Available water supply"); GroupDataModel group = client.getClientDataModel().getGroupDataModel(); final int actualInfrastructureEfficiency = group.getInfrastructureEfficiency(); final int actualFlowCapacity = group.getWaterDeliveryCapacity(); for (int y = 0; y <= actualFlowCapacity; y++) { - actualFlowCapacitySeries.add(actualInfrastructureEfficiency, y); + postInvestmentInfrastructureEfficiencySeries.add(actualInfrastructureEfficiency, y); } RoundConfiguration roundConfiguration = client.getRoundConfiguration(); int maximumInfrastructureEfficiency = roundConfiguration.getMaximumInfrastructureEfficiency(); int waterSupplyCapacity = roundConfiguration.getWaterSupplyCapacity(); for (int x = 0; x <= maximumInfrastructureEfficiency; x++) { int flowCapacity = group.calculateWaterDeliveryCapacity(x); - potentialFlowCapacitySeries.add(x,flowCapacity); + potentialInfrastructureEfficiencySeries.add(x,flowCapacity); waterSupplySeries.add(x, waterSupplyCapacity); } final int infrastructureEfficiencyBeforeInvestment = group.getInfrastructureEfficiencyBeforeInvestment(); final int irrigationCapacityBeforeInvestment = group.getIrrigationCapacityBeforeInvestment(); for (int y = 0; y <= irrigationCapacityBeforeInvestment; y++) { - initialInfrastructureEfficiencySeries.add(infrastructureEfficiencyBeforeInvestment, y); + preInvestmentInfrastructureEfficiencySeries.add(infrastructureEfficiencyBeforeInvestment, y); } final XYSeriesCollection data = new XYSeriesCollection(); - data.addSeries(initialInfrastructureEfficiencySeries); - // the second series gets turned blue. + data.addSeries(potentialInfrastructureEfficiencySeries); data.addSeries(waterSupplySeries); - data.addSeries(actualFlowCapacitySeries); - data.addSeries(potentialFlowCapacitySeries); + data.addSeries(preInvestmentInfrastructureEfficiencySeries); + data.addSeries(postInvestmentInfrastructureEfficiencySeries); + + + final JFreeChart chart = ChartFactory.createXYLineChart( "Water Delivery Capacity vs. Infrastructure Efficiency", "Infrastructure Efficiency (%)", Modified: irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/MainIrrigationGameWindow.java =================================================================== --- irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/MainIrrigationGameWindow.java 2009-11-19 03:42:52 UTC (rev 368) +++ irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/MainIrrigationGameWindow.java 2009-11-19 07:48:01 UTC (rev 369) @@ -461,10 +461,10 @@ int irrigationCapacity = clientDataModel.getIrrigationCapacity(); int waterSupply = clientDataModel.getWaterSupplyCapacity(); irrigationCapacityLabel.setText( - String.format("Irrigation capacity: %d cubic feet per second (cfps)", + String.format("Water delivery capacity: %d cubic feet per second (cfps)", irrigationCapacity)); waterSupplyLabel.setText( - String.format("Water supply: %d cubic feet per second (cfps)", + String.format("Available water supply: %d cubic feet per second (cfps)", waterSupply)); revalidate(); } Property changes on: irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/MainIrrigationGameWindow.java ___________________________________________________________________ Added: svn:keywords + Date Id Revision Modified: irrigation/trunk/src/main/java/edu/asu/commons/irrigation/conf/ServerConfiguration.java =================================================================== --- irrigation/trunk/src/main/java/edu/asu/commons/irrigation/conf/ServerConfiguration.java 2009-11-19 03:42:52 UTC (rev 368) +++ irrigation/trunk/src/main/java/edu/asu/commons/irrigation/conf/ServerConfiguration.java 2009-11-19 07:48:01 UTC (rev 369) @@ -87,7 +87,11 @@ } public String getInitialInstructions() { - return assistant.getProperty("initial-instructions"); + String initialInstructions = assistant.getProperty("initial-instructions", ""); + if (initialInstructions.contains("%d")) { + return String.format(initialInstructions, getChatDuration()); + } + return initialInstructions; } public String getWelcomeInstructions() { @@ -139,16 +143,11 @@ } public String getChatInstructions() { - return assistant.getProperty("chat-instructions", - String.format( - "<h3>Chat Instructions</h3><p>You now have the opportunity to chat for %d seconds. You can discuss whatever you want" + - " related to the experiment with some restrictions. You may not promise the other participant(s) side " + - "payments or threaten them with any consequence (e.g., physical violence) after the experiment is finished. Also, you may not reveal your real identity." + - "We are monitoring chat traffic - if we notice a violation of the rules we will remove the group from the room until the other groups are finished with the experiment.</p>" + - "<p>You can send messages by typing in the text field at the bottom of the screen and then hit return or click send. " + - "The time left for the discussion is displayed above the text field at the bottom of the screen.</p>", - getChatDuration()) - ); + String chatInstructions = assistant.getProperty("chat-instructions", ""); + if (chatInstructions.contains("%d")) { + return String.format(chatInstructions, getChatDuration()); + } + return chatInstructions; } public String getGameScreenshotInstructions() { Modified: irrigation/trunk/src/main/resources/configuration/asu-fall-2009/mixed-pretest/irrigation.xml =================================================================== --- irrigation/trunk/src/main/resources/configuration/asu-fall-2009/mixed-pretest/irrigation.xml 2009-11-19 03:42:52 UTC (rev 368) +++ irrigation/trunk/src/main/resources/configuration/asu-fall-2009/mixed-pretest/irrigation.xml 2009-11-19 07:48:01 UTC (rev 369) @@ -75,7 +75,9 @@ ]]> </entry> - +<!-- FIXME: lots of parameterizable fields here. should make instructions +template-language-pluggable +--> <entry key="initial-instructions"> <![CDATA[ <p> @@ -88,18 +90,19 @@ The amount of money you earn will depend on the decisions made by you and the other members of your group. This exercise mimics decisions people make in irrigation systems. In each round you will receive 10 tokens which you can invest in the -irrigation infrastructure. Given the capacity of the irrigation infrastructure and -the availability of water, you can grow crops. Tokens earned in a round is the sum -of tokens not invested plus tokens earned by growing crops. Each token is worth 5 -cents. In each round you will first make a decision as to how much to invest in the -irrigation infrastructure. Based on the combined contributions of all 5 participants -in your group in each round, your group can maintain the capacity of the irrigation -infrastructure for growing crops. +irrigation infrastructure. Based on the <b>water delivery capacity</b> of the +irrigation infrastructure and the availability of water you will be able to +grow crops. Tokens earned in a round is the sum of tokens not invested plus +tokens earned by growing crops. Each token is worth 5 cents. In each round you +will first decide how much to invest in the irrigation infrastructure. Based +on the combined contributions of all 5 participants in your group in each +round, your group can maintain the capacity of the irrigation infrastructure +for growing crops. </p> <p> We will now start a practice round to help illustrate the experiment. Before each -round in this experiment you will have a chat period of 60 seconds where you can +round in this experiment you will have a chat period of %d seconds where you can send text messages to the other participants. You may discuss any aspect of the exercise with two important exceptions: </p> @@ -114,12 +117,8 @@ We will be monitoring the chat traffic. If we detect any violation of these rules, we will have to remove <b>all members of the group where the violation occurred</b> from the experiment. That group will have to wait until the entire experiment is -finished to receive their payment. +finished to receive payment. </p> -<p> -You will see a text box appear on your screen when a chat period starts. The amount -of time left in the chat period will be displayed <b>below the chat messages window</b>.<br> -</p> ]]> </entry> @@ -284,9 +283,36 @@ ]]> </entry> +<entry key='chat-instructions'> +<![CDATA[ +<h3>Chat Instructions</h3> +You may now chat for %d seconds with the other members of your group. You may +discuss any aspect of the exercise with two important exceptions: +</p> +<ol> +<li>You are <b>not allowed</b> to promise the other participants +side-payments or threaten them with any consequence after the experiment is +finished. +</li> +<li>You are <b>not allowed to reveal your real identity</b>.</li> +</ol> +<p> +We will be monitoring the chat traffic. If we detect any violation of these rules, +we will have to remove <b>all members of the group where the violation occurred</b> +from the experiment. That group will have to wait until the entire experiment is +finished to receive payment. +</p> +<p> +You can send messages by typing in the text field at the bottom of the screen +and then pressing the return key or clicking the send button. The time left +for the discussion is displayed with a progress bar above the text field at +the bottom of the screen. +</p> +]]> +</entry> + <entry key="investment-instructions"> <![CDATA[ -<h3>Invest tokens in the irrigation infrastructure</h3> <p> You have been endowed with 10 tokens to invest. You must make a decision about how much you wish to invest [0,10] in the irrigation infrastructure. You can This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |