[virtualcommons-svn] SF.net SVN: virtualcommons:[498] foraging/trunk/src/main
Status: Beta
Brought to you by:
alllee
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. |