[virtualcommons-svn] SF.net SVN: virtualcommons:[319] irrigation/trunk/src/main
Status: Beta
Brought to you by:
alllee
|
From: <al...@us...> - 2009-10-22 08:06:44
|
Revision: 319
http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=319&view=rev
Author: alllee
Date: 2009-10-22 08:06:27 +0000 (Thu, 22 Oct 2009)
Log Message:
-----------
- updated configuration for first pretest, 10 actual rounds, 3 normal constant decline 25% and 5 fluctuating between 10 and 85%.
- made GroupDataModel hold its own copy of the RoundConfiguration instead of delegating to its transient ServerDataModel which causes NPEs when invoked on the client side.
Modified Paths:
--------------
irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/ExperimentGameWindow.java
irrigation/trunk/src/main/java/edu/asu/commons/irrigation/conf/RoundConfiguration.java
irrigation/trunk/src/main/java/edu/asu/commons/irrigation/server/GroupDataModel.java
irrigation/trunk/src/main/java/edu/asu/commons/irrigation/server/ServerDataModel.java
irrigation/trunk/src/main/resources/configuration/asu-fall-2009/irrigation.xml
irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round0.xml
irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round1.xml
irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round10.xml
irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round11.xml
irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round2.xml
irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round6.xml
irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round7.xml
irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round8.xml
irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round9.xml
Modified: irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/ExperimentGameWindow.java
===================================================================
--- irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/ExperimentGameWindow.java 2009-10-22 07:02:10 UTC (rev 318)
+++ irrigation/trunk/src/main/java/edu/asu/commons/irrigation/client/ExperimentGameWindow.java 2009-10-22 08:06:27 UTC (rev 319)
@@ -599,6 +599,15 @@
}
else {
instructionsBuilder.append(roundConfiguration.getInstructions());
+ instructionsBuilder.append("<hr/>");
+ int irrigationCapacity = clientDataModel.getGroupDataModel().getFlowCapacity();
+ int clientCapacity = roundConfiguration.getMaximumClientFlowCapacity();
+
+ instructionsBuilder.append(
+ String.format("<p><b>The irrigation capacity is %d and the maximum available water to you is %d cfps.</b></p>",
+ irrigationCapacity,
+ Math.min(irrigationCapacity, clientCapacity)
+ ));
setInstructions(instructionsBuilder.toString());
}
addCenterComponent(getInstructionsPanel());
Modified: irrigation/trunk/src/main/java/edu/asu/commons/irrigation/conf/RoundConfiguration.java
===================================================================
--- irrigation/trunk/src/main/java/edu/asu/commons/irrigation/conf/RoundConfiguration.java 2009-10-22 07:02:10 UTC (rev 318)
+++ irrigation/trunk/src/main/java/edu/asu/commons/irrigation/conf/RoundConfiguration.java 2009-10-22 08:06:27 UTC (rev 319)
@@ -101,7 +101,7 @@
}
public boolean shouldResetInfrastructureEfficiency() {
- return getBooleanProperty("reset-infrastructure-efficiency", false);
+ return isPracticeRound() || getBooleanProperty("reset-infrastructure-efficiency", false);
}
public String getInstructions() {
Modified: irrigation/trunk/src/main/java/edu/asu/commons/irrigation/server/GroupDataModel.java
===================================================================
--- irrigation/trunk/src/main/java/edu/asu/commons/irrigation/server/GroupDataModel.java 2009-10-22 07:02:10 UTC (rev 318)
+++ irrigation/trunk/src/main/java/edu/asu/commons/irrigation/server/GroupDataModel.java 2009-10-22 08:06:27 UTC (rev 319)
@@ -6,7 +6,6 @@
import java.util.Set;
import java.util.logging.Logger;
-import edu.asu.commons.event.EventChannel;
import edu.asu.commons.experiment.DataModel;
import edu.asu.commons.irrigation.conf.RoundConfiguration;
import edu.asu.commons.net.Identifier;
@@ -28,8 +27,11 @@
private transient ServerDataModel serverDataModel;
- private transient Logger logger = Logger.getLogger(GroupDataModel.class.getName());
+ private RoundConfiguration roundConfiguration;
+
+ private transient Logger logger = Logger.getLogger(GroupDataModel.class.getName());
+
private int currentlyAvailableFlowCapacity = 0;
private int maximumAvailableFlowCapacity = 0;
@@ -41,6 +43,7 @@
public GroupDataModel(ServerDataModel serverDataModel) {
this.serverDataModel = serverDataModel;
+ setRoundConfiguration(serverDataModel.getRoundConfiguration());
}
public ClientData getClientData(Identifier id) {
@@ -80,27 +83,27 @@
}
public boolean isFull() {
- return clients.size() == serverDataModel.getRoundConfiguration().getClientsPerGroup();
+ return clients.size() == getRoundConfiguration().getClientsPerGroup();
}
public void clear() {
clients.clear();
}
- public void setServerDataModel(ServerDataModel state) {
- this.serverDataModel = state;
+ public void setServerDataModel(ServerDataModel serverDataModel) {
+ this.serverDataModel = serverDataModel;
}
public Map<Identifier, ClientData> getClientDataMap() {
return Collections.unmodifiableMap(clients);
}
- public int getAvailableClientFlowCapacity(){
+ public int getAvailableClientFlowCapacity() {
return Math.min(currentlyAvailableFlowCapacity, getRoundConfiguration().getMaximumClientFlowCapacity());
}
public RoundConfiguration getRoundConfiguration() {
- return serverDataModel.getRoundConfiguration();
+ return roundConfiguration;
}
public int getTotalContributedTokens() {
@@ -213,10 +216,6 @@
public int getMaximumAvailableFlowCapacity() {
return maximumAvailableFlowCapacity;
}
-
- public EventChannel getEventChannel() {
- return serverDataModel.getEventChannel();
- }
public int getInfrastructureEfficiency() {
return infrastructureEfficiency;
@@ -232,6 +231,11 @@
}
return logger;
}
+
+
+ public void setRoundConfiguration(RoundConfiguration roundConfiguration) {
+ this.roundConfiguration = roundConfiguration;
+ }
}
Modified: irrigation/trunk/src/main/java/edu/asu/commons/irrigation/server/ServerDataModel.java
===================================================================
--- irrigation/trunk/src/main/java/edu/asu/commons/irrigation/server/ServerDataModel.java 2009-10-22 07:02:10 UTC (rev 318)
+++ irrigation/trunk/src/main/java/edu/asu/commons/irrigation/server/ServerDataModel.java 2009-10-22 08:06:27 UTC (rev 319)
@@ -36,6 +36,9 @@
public void setRoundConfiguration(RoundConfiguration roundConfiguration) {
this.roundConfiguration = roundConfiguration;
+ for (GroupDataModel group: clientsToGroups.values()) {
+ group.setRoundConfiguration(roundConfiguration);
+ }
}
public synchronized void addClient(ClientData clientData) {
Modified: irrigation/trunk/src/main/resources/configuration/asu-fall-2009/irrigation.xml
===================================================================
--- irrigation/trunk/src/main/resources/configuration/asu-fall-2009/irrigation.xml 2009-10-22 07:02:10 UTC (rev 318)
+++ irrigation/trunk/src/main/resources/configuration/asu-fall-2009/irrigation.xml 2009-10-22 08:06:27 UTC (rev 319)
@@ -30,7 +30,7 @@
<entry key="wait-for-participants">true</entry>
-<entry key="number-of-rounds">22</entry>
+<entry key="number-of-rounds">12</entry>
<entry key="undisrupted-flow-required">true</entry>
@@ -689,15 +689,16 @@
<![CDATA[
<h3>Invest tokens in the irrigation infrastructure</h3>
<p>
-You have 10 tokens to invest. You must make a decision about how much you wish to
-invest [0,10] in the irrigation infrastructure. As a reminder we have included the
-table relating irrigation infrastructure and the total available flow capacity in
-the figure below. After you have entered the number of tokens you'd like to invest,
-hit the enter key or click the submit button to confirm your investment. When
-everybody has made their decision, the total investment will be calculated and the
-overall irrigation infrastructure will be displayed. Each token you invest
-corresponds to one percent of infrastructure efficiency, so if you invest 10 tokens
-you are contributing 10% to the overall infrastructure efficiency.
+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
+see the relationship between total investment and irrigation infrastructure in
+the table below. After you have entered the number of tokens you'd like to
+invest, hit the enter key or click the submit button to confirm your
+investment. When everybody has made their decision, the total investment will
+be calculated and the overall irrigation infrastructure will be displayed.
+Each token you invest corresponds to one percent of infrastructure efficiency,
+so if you invest 10 tokens you are contributing 10% to the overall
+infrastructure efficiency.
</p>
<table border="1" cellspacing="2" cellpadding="2">
<thead>
Modified: irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round0.xml
===================================================================
--- irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round0.xml 2009-10-22 07:02:10 UTC (rev 318)
+++ irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round0.xml 2009-10-22 08:06:27 UTC (rev 319)
@@ -4,9 +4,7 @@
<comment>Irrigation experiment round configuration</comment>
<entry key='max-canal-flow-capacity'>40</entry>
<entry key='max-client-flow-capacity'>25</entry>
-<entry key="max-total-token-contribution">50</entry>
<entry key="practice-round">true</entry>
-<entry key="clients-per-group">5</entry>
<entry key="instructions">
<![CDATA[
Modified: irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round1.xml
===================================================================
--- irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round1.xml 2009-10-22 07:02:10 UTC (rev 318)
+++ irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round1.xml 2009-10-22 08:06:27 UTC (rev 319)
@@ -2,7 +2,6 @@
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>Irrigation experiment round configuration</comment>
-<entry key="max-total-token-contribution">50</entry>
<entry key="practice-round">true</entry>
<entry key="instructions">
Modified: irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round10.xml
===================================================================
--- irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round10.xml 2009-10-22 07:02:10 UTC (rev 318)
+++ irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round10.xml 2009-10-22 08:06:27 UTC (rev 319)
@@ -2,16 +2,15 @@
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>Irrigation experiment round configuration</comment>
-<entry key="max-total-token-contribution">50</entry>
-<entry key="practice-round">false</entry>
-<entry key="clients-per-group">5</entry>
+<entry key='infrastructure-degradation-factor'>10</entry>
+
<entry key="instructions">
<![CDATA[
<h3>Round 9 Instructions</h3>
<p>
-This round is the same as the previous round, but the infrastructure irrigation has
-been decreased by 25%.
+This round is the same as the previous round, but the irrigation
+infrastructure efficiency has declined by 10%.
</p>
]]>
</entry>
Modified: irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round11.xml
===================================================================
--- irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round11.xml 2009-10-22 07:02:10 UTC (rev 318)
+++ irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round11.xml 2009-10-22 08:06:27 UTC (rev 319)
@@ -2,14 +2,15 @@
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>Irrigation experiment round configuration</comment>
-<entry key="max-total-token-contribution">50</entry>
+<entry key='infrastructure-degradation-factor'>85</entry>
+
<entry key="instructions">
<![CDATA[
<h3>Round 10 Instructions</h3>
<p>
-This round is the same as the previous round, but the infrastructure irrigation has
-been decreased by 25%.
+This round is the same as the previous round, but the infrastructure
+irrigation efficiency has experienced a severe decline of 85%.
</p>
]]>
Modified: irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round2.xml
===================================================================
--- irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round2.xml 2009-10-22 07:02:10 UTC (rev 318)
+++ irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round2.xml 2009-10-22 08:06:27 UTC (rev 319)
@@ -9,12 +9,12 @@
<![CDATA[
<h3>Round 1 Instructions</h3>
<p>
-This is the first round of twenty. Before this round begins you will have the
-opportunity to text chat with the other participant for forty seconds, then
-decide on your level of investment in the irrigation infrastructure. After
-the total irrigation infrastructure investment has been determined you will
-begin the experiment and make decisions on when to open your irrigation gates
-and grow crops.
+This is the first actual round of the experiment. Before this round begins
+you will have the opportunity to text chat with the other participant for
+forty seconds, then decide on your level of investment in the irrigation
+infrastructure. After the total irrigation infrastructure investment has been
+determined you will begin the experiment and make decisions on when to open
+your irrigation gates and grow crops.
</p>
]]>
</entry>
Modified: irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round6.xml
===================================================================
--- irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round6.xml 2009-10-22 07:02:10 UTC (rev 318)
+++ irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round6.xml 2009-10-22 08:06:27 UTC (rev 319)
@@ -3,14 +3,28 @@
<properties>
<comment>Irrigation experiment round configuration</comment>
+<entry key='infrastructure-degradation-factor'>10</entry>
+
<entry key="instructions">
<![CDATA[
<h3>Round 5 Instructions</h3>
<p>
-This round is the same as the previous round, but the infrastructure irrigation has
-been decreased by 25%.
+In the past rounds the infrastructure efficiency declined from one round to
+the next at a constant amount of 25%. In the following rounds the <b>average
+decline</b> of the infrastructure efficiency will remain the same, but the
+<b>actual amount</b> of decline can vary from round to round. This means that
+in some rounds the decline will be larger than 25% and some rounds the decline
+will be smaller than 25%. Before each round begins you will continue to make a
+decision on how much to invest in the irrigation infrastructure. After all of
+your investment contributions have been submitted the resulting level of
+infrastructure efficiency will be displayed and then the round will begin. If
+you have any questions, please ask them now.
</p>
+<p>
+In this round, the infrastructure has declined by 10%.
+</p>
+
]]>
</entry>
</properties>
Modified: irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round7.xml
===================================================================
--- irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round7.xml 2009-10-22 07:02:10 UTC (rev 318)
+++ irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round7.xml 2009-10-22 08:06:27 UTC (rev 319)
@@ -3,14 +3,14 @@
<properties>
<comment>Irrigation experiment round configuration</comment>
-<entry key="max-total-token-contribution">50</entry>
+<entry key='infrastructure-degradation-factor'>85</entry>
<entry key="instructions">
<![CDATA[
<h3>Round 6 Instructions</h3>
<p>
-This round is the same as the previous round, but the infrastructure irrigation has
-been decreased by 25%.
+This round is the same as the previous round, but the irrigation
+infrastructure efficiency has experienced a severe decline of 85%.
</p>
]]>
Modified: irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round8.xml
===================================================================
--- irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round8.xml 2009-10-22 07:02:10 UTC (rev 318)
+++ irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round8.xml 2009-10-22 08:06:27 UTC (rev 319)
@@ -2,15 +2,15 @@
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>Irrigation experiment round configuration</comment>
-<entry key="max-total-token-contribution">50</entry>
-<entry key="clients-per-group">5</entry>
+<entry key='infrastructure-degradation-factor'>30</entry>
+
<entry key="instructions">
<![CDATA[
<h3>Round 7 Instructions</h3>
<p>
-This round is the same as the previous round, but the infrastructure irrigation has
-been decreased by 25%.
+This round is the same as the previous round, but the irrigation
+infrastructure efficiency has declined by 30%.
</p>
]]>
</entry>
Modified: irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round9.xml
===================================================================
--- irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round9.xml 2009-10-22 07:02:10 UTC (rev 318)
+++ irrigation/trunk/src/main/resources/configuration/asu-fall-2009/round9.xml 2009-10-22 08:06:27 UTC (rev 319)
@@ -2,15 +2,15 @@
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>Irrigation experiment round configuration</comment>
-<entry key="max-total-token-contribution">50</entry>
-<entry key="clients-per-group">5</entry>
+<entry key='infrastructure-degradation-factor'>10</entry>
+
<entry key="instructions">
<![CDATA[
<h3>Round 8 Instructions</h3>
<p>
-This round is the same as the previous round, but the infrastructure irrigation has
-been decreased by 25%.
+This round is the same as the previous round, but the irrigation
+infrastructure efficiency has declined by 10%.
</p>
]]>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|