[virtualcommons-svn] commit/foraging: alllee: forgot to clear out group diff lists after processing
Status: Beta
Brought to you by:
alllee
From: Bitbucket <com...@bi...> - 2012-01-24 05:59:24
|
1 new commit in foraging: https://bitbucket.org/virtualcommons/foraging/changeset/903c3ed75982/ changeset: 903c3ed75982 user: alllee date: 2012-01-24 06:59:07 summary: forgot to clear out group diff lists after processing & transmission to all group members affected #: 3 files diff -r 11c973f697d5c23bc2901b267efb698415894296 -r 903c3ed759823de338f5947407d5b96a2941c59f src/main/java/edu/asu/commons/foraging/model/GroupDataModel.java --- a/src/main/java/edu/asu/commons/foraging/model/GroupDataModel.java +++ b/src/main/java/edu/asu/commons/foraging/model/GroupDataModel.java @@ -312,7 +312,8 @@ * Perform all cleanup. */ public void cleanupRound() { - clearResourceDistribution(); + resourceDistribution.clear(); + clearDiffLists(); tokensCollectedDuringInterval = 0; activeEnforcementMechanism = EnforcementMechanism.NONE; activeSanctionMechanism = SanctionMechanism.NONE; @@ -320,11 +321,6 @@ activeMonitor = null; } - public void clearResourceDistribution() { - resourceDistribution.clear(); - clearDiffLists(); - } - public boolean isResourceAt(Point position) { return resourceDistribution.containsKey(position); } diff -r 11c973f697d5c23bc2901b267efb698415894296 -r 903c3ed759823de338f5947407d5b96a2941c59f src/main/java/edu/asu/commons/foraging/model/ServerDataModel.java --- a/src/main/java/edu/asu/commons/foraging/model/ServerDataModel.java +++ b/src/main/java/edu/asu/commons/foraging/model/ServerDataModel.java @@ -63,9 +63,6 @@ private transient boolean dirty = false; - - - // Maps client Identifiers to the GroupDataModel that the client belongs to private final Map<Identifier, GroupDataModel> clientsToGroups = new HashMap<Identifier, GroupDataModel>(); @@ -318,12 +315,6 @@ group.harvestFruits(id, event.getResource()); } - public void clearDiffLists() { - for (GroupDataModel group : getGroups()) { - group.clearDiffLists(); - } - } - public Queue<RealTimeSanctionRequest> getLatestSanctions(Identifier id) { return clientsToGroups.get(id).getClientData(id).getLatestSanctions(); } diff -r 11c973f697d5c23bc2901b267efb698415894296 -r 903c3ed759823de338f5947407d5b96a2941c59f src/main/java/edu/asu/commons/foraging/server/ForagingServer.java --- a/src/main/java/edu/asu/commons/foraging/server/ForagingServer.java +++ b/src/main/java/edu/asu/commons/foraging/server/ForagingServer.java @@ -953,6 +953,8 @@ data.clearCollectedTokens(); data.resetLatestSanctions(); } + // after transmitting all the changes to the group, make sure to cleanup + group.clearDiffLists(); } // FIXME: refine this, send basic info to the facilitator (how many resources left, etc.) if (shouldUpdateFacilitator()) { Repository URL: https://bitbucket.org/virtualcommons/foraging/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. |