[virtualcommons-svn] SF.net SVN: virtualcommons:[392] foraging/branches/deepak-branch-fall-09/ src
Status: Beta
Brought to you by:
alllee
From: <al...@us...> - 2009-12-03 01:15:49
|
Revision: 392 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=392&view=rev Author: alllee Date: 2009-12-03 01:15:41 +0000 (Thu, 03 Dec 2009) Log Message: ----------- new enums representing an enforcement mechanism and a foraging role, might rethink how these are represented later Added Paths: ----------- foraging/branches/deepak-branch-fall-09/src/main/java/edu/asu/commons/foraging/model/EnforcementMechanism.java foraging/branches/deepak-branch-fall-09/src/main/java/edu/asu/commons/foraging/model/ForagingRole.java Added: foraging/branches/deepak-branch-fall-09/src/main/java/edu/asu/commons/foraging/model/EnforcementMechanism.java =================================================================== --- foraging/branches/deepak-branch-fall-09/src/main/java/edu/asu/commons/foraging/model/EnforcementMechanism.java (rev 0) +++ foraging/branches/deepak-branch-fall-09/src/main/java/edu/asu/commons/foraging/model/EnforcementMechanism.java 2009-12-03 01:15:41 UTC (rev 392) @@ -0,0 +1,28 @@ +package edu.asu.commons.foraging.model; + +public enum EnforcementMechanism { + + NONE("No enforcement", "Everybody can harvest. Nobody can subtract tokens from others"), + EVERYONE_CAN_SANCTION("Everybody can reduce", "Every participant can reduce the tokens of other participants by pressing the number key associated with that participant."), + RANDOM_MONITOR("Random monitor", "Randomly, one of the participants is selected to be the monitoring participant. This participant cannot harvest but can subtract tokens from other participants by pressing the number key associated with that participant. At the end of the round each harvesting participant pays 25% of their earned tokens to the monitoring participant."), + ROTATING_MONITOR("Rotating monitor", "Each participant is given an equal amount of time to be a monitor, with the ability to reduce the tokens of other participants by pressing the number key associated with that participant."); + + private final String title; + private final String description; + + EnforcementMechanism(String title, String description) { + this.title = title; + this.description = description; + } + + public String getTitle() { + return title; + } + + public String getDescription() { + return description; + } + + + +} Added: foraging/branches/deepak-branch-fall-09/src/main/java/edu/asu/commons/foraging/model/ForagingRole.java =================================================================== --- foraging/branches/deepak-branch-fall-09/src/main/java/edu/asu/commons/foraging/model/ForagingRole.java (rev 0) +++ foraging/branches/deepak-branch-fall-09/src/main/java/edu/asu/commons/foraging/model/ForagingRole.java 2009-12-03 01:15:41 UTC (rev 392) @@ -0,0 +1,30 @@ +package edu.asu.commons.foraging.model; + +public enum ForagingRole { + + HARVEST("Harvest"), MONITOR("Monitor"), + SANCTION("Sanction"), SANCTION_AND_HARVEST("Sanction and harvest"); + + private final String label; + + ForagingRole(String label) { + this.label = label; + } + + public String toString() { + return label; + } + + public String getLabel() { + return label; + } + + public boolean isMonitor() { + return this == MONITOR; + } + + public boolean canSanction() { + return this == SANCTION || this == SANCTION_AND_HARVEST; + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |