Changeset 37
- Timestamp:
- 04/17/08 00:45:03 (9 months ago)
- Location:
- trunk
- Files:
-
- 6 modified
-
conf/chord.properties (modified) (2 diffs)
-
conf/master.properties (modified) (1 diff)
-
src/planet/chord/ChordNode.java (modified) (5 diffs)
-
src/planet/generic/commonapi/NodeImpl.java (modified) (1 diff)
-
src/planet/symphony/SymphonyNode.java (modified) (6 diffs)
-
src/planet/util/timer/SimulationTimerImpl.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/conf/chord.properties
r34 r37 53 53 54 54 # The default initial network size 55 FACTORIES_NETWORKSIZE = 100 55 FACTORIES_NETWORKSIZE = 1000 56 56 57 57 … … 86 86 # The print level for whole network (to use by GenericApp.printNetwork() method) 87 87 # Default possible values: 0 (no print), 1 (pretty print), 2 (full print) 88 SIMULATOR_PRINT_LEVEL = 288 SIMULATOR_PRINT_LEVEL = 0 89 89 90 90 # The environment for the current simulation -
trunk/conf/master.properties
r34 r37 36 36 37 37 ################################################################################ 38 SIMNETTEST = ../conf/chord.properties39 #SIMNETTEST = ../conf/symphony.properties38 #SIMNETTEST = ../conf/chord.properties 39 SIMNETTEST = ../conf/symphony.properties 40 40 41 41 ################################################################################ -
trunk/src/planet/chord/ChordNode.java
r34 r37 28 28 import planet.util.Properties; 29 29 import planet.util.Queue; 30 import planet.util.timer.TimerTask; 30 31 import planet.util.timer.TimerTaskImpl; 31 32 … … 45 46 public class ChordNode extends planet.generic.commonapi.NodeImpl { 46 47 48 private static final long serialVersionUID = -3646239557272943682L; 49 47 50 /* ****************** CONSTANTS FOR MODE OF ROUTEMESSAGE *******/ 48 51 … … 236 239 protected NodeHandle[] temp; 237 240 241 /* 242 * Periodic tasks 243 */ 244 /** 245 * Stabilization task 246 */ 247 private TimerTask stabilizeTask = new StabilizeTask(); 248 /** 249 * Stabilization period (num. of steps) 250 */ 251 private int stabPeriod = ((ChordProperties)Properties.overlayPropertiesInstance).stabilizeSteps; 252 /** 253 * FixFinger task 254 */ 255 private TimerTask fixFingerTask = new FixFingerTask(); 256 /** 257 * FixFinger period (num. of steps) 258 */ 259 private int fixFingerPeriod = ((ChordProperties)Properties.overlayPropertiesInstance).fixFingerSteps; 260 /** 261 * Step when node has joined. 262 */ 263 private int nodeHasJoinedStep = Logger.getStep(); 264 238 265 239 266 /** … … 250 277 hasFailed = false; 251 278 hasReceivedSucc = true; //permits the send 252 253 //add stabilize timer254 setTimer(new StabilizeTask(), ((ChordProperties)Properties.overlayPropertiesInstance).stabilizeSteps,255 ((ChordProperties)Properties.overlayPropertiesInstance).stabilizeSteps);256 // add fix finger timer257 setTimer(new FixFingerTask(), ((ChordProperties)Properties.overlayPropertiesInstance).fixFingerSteps,258 ((ChordProperties)Properties.overlayPropertiesInstance).fixFingerSteps);259 260 279 } 261 280 … … 838 857 clearFingerChanges(); 839 858 super.process(actualStep); 859 if (((actualStep - nodeHasJoinedStep)%stabPeriod)==0) 860 stabilizeTask.run(); 861 if (((actualStep - nodeHasJoinedStep)%fixFingerPeriod)==0) 862 fixFingerTask.run(); 840 863 while (hasMoreMessages()) { 841 864 dispatcher(nextMessage()); -
trunk/src/planet/generic/commonapi/NodeImpl.java
r11 r37 106 106 public boolean process(int actualStep) { 107 107 processed = 0; 108 processTasks(); 108 if (tasks.size()>0) 109 processTasks(); 109 110 return true; 110 111 } -
trunk/src/planet/symphony/SymphonyNode.java
r36 r37 19 19 import planet.generic.commonapi.behaviours.BehavioursPatternImpl; 20 20 import planet.generic.commonapi.factory.GenericFactory; 21 import planet.results.LinkStateResults;22 21 import planet.simulate.Globals; 23 22 import planet.simulate.Logger; … … 26 25 import planet.symphony.messages.NeighbourMessagePool; 27 26 import planet.util.Properties; 27 import planet.util.timer.TimerTask; 28 28 import planet.util.timer.TimerTaskImpl; 29 29 … … 42 42 extends planet.generic.commonapi.NodeImpl 43 43 { 44 private static final long serialVersionUID = 3721749298036723514L; 44 45 45 46 /* ****************** CONSTANTS FOR MODE OF ROUTEMESSAGE *******/ … … 137 138 private NodeHandle estimationNH = null; 138 139 139 140 /** 141 * Stabilization task 142 */ 143 private TimerTask stabilizeTask = new StabilizeTask(); 144 /** 145 * Stabilization period (num. of steps) 146 */ 147 private int stabPeriod = ((SymphonyProperties)Properties.overlayPropertiesInstance).stabilizeSteps; 148 /** 149 * Step when node has joined. 150 */ 151 private int nodeHasJoinedStep = Logger.getStep(); 152 140 153 /** 141 154 * Gets the maximum number of successors per node. … … 171 184 statisticStabilizationSteps = SymphonyNode.getSuccessorsNumber()*24; 172 185 behPool = GenericFactory.getDefaultBehavioursPool(); 173 174 // Stabilize Timer175 setTimer(new StabilizeTask(), ((SymphonyProperties)Properties.overlayPropertiesInstance).stabilizeSteps,176 ((SymphonyProperties)Properties.overlayPropertiesInstance).stabilizeSteps);177 186 } 178 187 … … 707 716 requestedNewLongDistance = false; //permits only one QUERY_CONNECT by step 708 717 super.process(actualStep); 718 if (((actualStep - nodeHasJoinedStep)%stabPeriod)==0) 719 stabilizeTask.run(); 709 720 while (hasMoreMessages()) { 710 721 //planet.results.LinkStateResults.updateIncoming(this.id); -
trunk/src/planet/util/timer/SimulationTimerImpl.java
r34 r37 15 15 */ 16 16 public class SimulationTimerImpl implements SimulationTimer { 17 private static final long serialVersionUID = 1228039166338775231L; 17 18 private TreeSet tasks = null; 18 19
