public void startMoving() { RandomeNumberGenerator.SetSeedFromSystemTime(); GetEncapsulatingCell(); //myNearCluster = getNearestCluster(); sinkDirection = GetUniformDirection(); PastDirections.Push(sinkDirection); if (Settings.Default.SinkSpeed > 0) { timer_changeInter.Interval = TimeSpan.FromSeconds(3); timer_changeInter.Start(); timer_changeInter.Tick += timer_tick_speed; //Moves the sink according to its speed and direction timer_move.Interval = TimeSpan.FromSeconds(0.5); timer_move.Start(); timer_move.Tick += timer_tick_move; //Changes the direction of the sink timer_checkSinkGoingOut.Interval = TimeSpan.FromSeconds(1); timer_checkSinkGoingOut.Tick += timer_tick_direction; timer_checkSinkGoingOut.Start(); timer_getNewDirection.Interval = TimeSpan.FromSeconds(getDirectionInterval()); timer_getNewDirection.Tick += timer_getNewDirection_Tick; timer_getNewDirection.Start(); } }
public void RandomDeplayment() { PublicParamerters.NumberofNodes = myNetWork.Count; NeighborsDiscovery overlappingNodesFinder = new NeighborsDiscovery(myNetWork); overlappingNodesFinder.GetOverlappingForAllNodes(); isCoverageSelected = true; DisplaySimulationParameters("Random"); EngageMacAndRadioProcol(); TopologyConstractor.BuildToplogy(Canvas_SensingFeild, myNetWork); // merged path PublicParamerters.clusterRadius = 100; RandomeNumberGenerator.SetSeedFromSystemTime(); Ring.getCenterOfNetwork(); foreach (Sensor sen in myNetWork) { sen.NetworkCenter = PublicParamerters.networkCenter; sen.RingNeighborRule = new RingNeighbor(sen); } Ring.setInitialParameters(100, 10, Canvas_SensingFeild); Ring.startRingConstruction(); // RingNodes are all defined }
//start moving the sink here //Changes the interval between each one pixel move of the sink public void startMoving() { RandomeNumberGenerator.SetSeedFromSystemTime(); timer_changeInter.Interval = TimeSpan.FromSeconds(3); timer_changeInter.Start(); timer_changeInter.Tick += timer_tick_speed; //Moves the sink according to its speed and direction timer_move.Interval = TimeSpan.FromSeconds(0.5); timer_move.Start(); timer_move.Tick += timer_tick_move; //Changes the direction of the sink timer_changeDir.Interval = TimeSpan.FromSeconds(2); timer_changeDir.Start(); timer_changeDir.Tick += timer_tick_direction; }