Author: mrogers
Date: 2006-11-17 13:57:48 +0000 (Fri, 17 Nov 2006)
New Revision: 10973
Modified:
trunk/apps/load-balancing-sims/phase7/sim/Node.java
Log:
Rudimentary search throttle (not tested)
Modified: trunk/apps/load-balancing-sims/phase7/sim/Node.java
===================================================================
--- trunk/apps/load-balancing-sims/phase7/sim/Node.java 2006-11-17 13:51:32 UTC
(rev 10972)
+++ trunk/apps/load-balancing-sims/phase7/sim/Node.java 2006-11-17 13:57:48 UTC
(rev 10973)
@@ -491,7 +491,8 @@
private void addToSearchQueue (Search s)
{
searchQueue.add (s);
- if (USE_THROTTLE && searchQueue.size() == 1) {
+ if (USE_THROTTLE) {
+ if (searchQueue.size() > 1) return; // Already waiting
double now = Event.time();
double then = searchThrottle.nextSearchTime (now);
Event.schedule (this, then - now, SEND_SEARCH, null);