WSN Localization Simulator Readme

Embed Size (px)

Citation preview

Wireless Sensor Network Localization Simulator v1.1Written by Abdelhady Mohammad Naguib May,2011 Thank you for using the WSN Localization Simulator.

Figure 1: WSN Localization Simulator

INTRODUCTIONA wireless sensor network (WSN) is a network composed of a large number of sensor nodes, which are deployed in the monitoring field. With the rapid development of WSNs, providing development tools such as simulation environment before deploying real nodes in physical environments is getting more important. A well simulation environment can help developers build their prototype models to know the interactions and the behavior of each node. In addition, most of WSN applications will deploy a large number of nodes in a simulation environment. However, the simulation speed depends on the simulation fidelity and scale. WSN localization is the operation of determining the position of sensor nodes; this position is estimated and not accurate. Because GPS have high cost and works outdoors only, there are many localization algorithm that tries to be more accurate in

determining the position of sensor nodes (i.e. have low localization error). In order to effectively design and develop new localization algorithms targeted towards WSNs, there is a strong need to use an equally effective and reliable simulation environment. Sensor nodes are, by design, tiny and inexpensive, but due to their need to work in large numbers make full-scale testing a fairly expensive process to be carried out using real hardware. Analytical modeling using tools such as MATLAB help in acquiring a quick insight, but they fail to provide anything close to realistic results that can be acquired through proper implementations and good simulation tools.

The problem and its solution:Most of WSNs simulators don't support one or two of the following criteria: easy, extendable and scalable, so that we design and implement an integrated framework used for localization in WSNs and available for the analysis of different types of localization schemes (Range-free, Range-based and Hybrid localization algorithms). The obtained framework is simple and easy to be used to demonstrate the performance evaluation and comparison of different types of localization schemes. It can also be extended to include many localization algorithms by future researchers.

Design criteria for our framework:1- Supports completely large scale networks, e.g. 400 nodes x 400 nodes which are fully interconnected which implies 160,000 network connections. So, our proposed framework is scalable. 2- The network can be deployed based on a wide range of parameters: network size, sensor nodes communication distance, locator radius (communication range), sector angle (rotation angle) and locator beam width. 3- Supports Multithreading, where the simulated algorithm runs on a separate thread from the thread controlling the developer interface. 4- Packaging all simulator classes into a referenced DLL file for better modularity design. 5- Ease of implementing various localization algorithms by encapsulating each one into a separate DLL file. Developers can write their own localization algorithm into a DLL file and reference it into our framework. 6- Can be extended to implement many different localization algorithms with different categories (range-free, range-based and a hybrid of both).

7- Suitable developer interface to enable deploying and moving sensor and locator nodes and changing various simulation parameters.

Framework ArchitectureOur framework is composed of two main components: simulator and a localization algorithm. A simulator includes two classes; the first one is network DLL file which contains all simulator classes (e.g. sensor class, locator class, packet class ...etc.) and the second one is developer interface class which contains all control functions (e.g. run and stop simulator, painting method, etc.). The second component of our framework is the localization algorithm which is written by the developer into a DLL file and referencing this file into our framework, so that the developer has the ability to write his localization algorithm but under certain design specifications as shown in Fig. 2.

The first method (Set_Parameters) is responsible to get all control data from user interface. The second method is used to test the connectivity between a sensor node and a locator node. The third method (Send), after a valid connection this method is used to transmit packets between different nodes. Finally, after getting all necessary packets from locator nodes, a sensor node can estimate its position using the fourth method (Localize). As shown in Fig. 3, we illustrate the sequence diagram for submitting parameters from the user through simulator and getting the response back from the localization algorithm. First, the user set the required parameters via user interface and the simulator receives these parameters and applies it using Set_Parameters method which gives the needed argument to the localization algorithm. Second, the algorithm will reply to the simulator. Third, calling Connect method to test the connectivity between different nodes, if there is a connection, fill array list of connections between different nodes. Fourth, calling send method to carry out sending packets between connected nodes by filling array list which contains the sent packets for each sensor node. Finally, calling Localize method to

estimate the position of a sensor node and returning the results back to the user into an external text file.

Customizing a Localization AlgorithmA localization algorithm can be customized as follows: 1- Creating a class library (DLL). 2- Writing a localization algorithm according to the design specifications mentioned

above. 3- Reference this class library as shown in the snapshot of Fig. 4.

angle5, int sangle6, int sangle7, int sangle8, int Sweepangle, int stepx, int stepy, bool radio1, bool radio2, int combo1, int c

Finally, the proposed framework is easy to use, scalable that supports 400x400 nodes and extendable which allows developers to write their own localization algorithms and referencing it to our framework.

How does this framework help developers?This framework allows developers to write their own localization algorithms (DLL file) according to the design specifications mentioned above. Hence, their algorithms can be referenced to our framework as shown in Fig. 3.

How does the code actually work?Our framework is composed of two main components: simulator and a localization algorithm. A simulator includes two classes; the first one is network DLL file which contains all simulator classes as shown below:

1- Network Class Which is used for initialization of user interface parameters.

public void BuildNetwork() aSensors = new ArrayList(); aLocators = new ArrayList(); aBeacons = new ArrayList(); //Array of Locators //Array of Beacons

if (radio1 == true && radio2 == false) //Adding Locators to network if (combo1 == 0) if (combo1 == 4) int m = 0; int m = 0; while ((aLocators.Count) < noRLocators) while ((aLocators.Count) < 2) ocator = new Locator(m, r.Next(iMaxX - 10) + 5, r.Next(iMaxY - 10) + 5, LocatorRadius, r.Next(0, 315)); if (m == 0) aLocators.Insert(m, locator); m++; Locator locator = new Locator(m, 20, 520, LocatorRadius, sangle1); aLocators.Insert(m, locator); else if (combo1 == 1) else int x = 20, y = 20;if (m == 1) int m = 0; Locator locator = new Locator(m, 520, 520, LocatorRadius, sangle2); aLocators.Insert(m, while ((aLocators.Count) < 8)locator); if (m == 0) m++; x = 20; y = 20; locator = newint s = 0, x = 70,LocatorRadius, sangle1); Locator(m, x, y, y = 70; aLocators.Insert(m, locator); while (aSensors.Count < 25) else if (m == 1)

WirelessSensor = 20; = new WirelessSensor(x, y); x = 270; y sensor aSensors.Insert(s, sensor); locator = new Locator(m, x, y, LocatorRadius, sangle2); if (x < 470) x += 100; aLocators.Insert(m, locator); BuildNetwork() method else x = 70; y += 100; allows deploying s++; beacon nodes as follows: else if (m == 2)

of various network objects: sensor, locator and

x = 520; y = 20; else ocator = new Locator(m, x, y, LocatorRadius, sangle3); aLocators.Insert(m, locator); int s = 0; while (aSensors.Count < NoSensors) else if (m == 3)

x = 20; y = 270; WirelessSensorLocator(m, x, y, LocatorRadius, sangle4); locator = new sensor = new WirelessSensor(r.Next(iMaxX - 10) + 5, r.Next(iMaxY - 10) + 5); aSensors.Insert(s, sensor); aLocators.Insert(m, locator); s++; else if (m == 4)

x = 520; y = 270; locator = new Locator(m, x, y, LocatorRadius, sangle5); aLocators.Insert(m, locator); else if (m == 5)

x = 20; y = 520; locator = new Locator(m, x, y, LocatorRadius, sangle6); aLocators.Insert(m, locator); else if (m == 6)

x = 270; y = 520; ocator = new Locator(m, x, y, LocatorRadius, sangle7);

else if (m == 7)

x = 520; y = 520; ocator = new Locator(m, x, y, LocatorRadius, sangle8); aLocators.Insert(m, locator); m++; else if (combo1 == 2) int x = 20, y = 20; int m = 0; while ((aLocators.Count) < 5) if (m == 0) x = 270; y = 20; locator = new Locator(m, x, y, LocatorRadius, sangle1); aLocators.Insert(m, locator); else if (m == 1)

x = 20; y = 270; locator = new Locator(m, x, y, LocatorRadius, sangle2); aLocators.Insert(m, locator); else if (m == 2)

x = 270; y = 270; locator = new Locator(m, x, y, LocatorRadius, sangle3); aLocators.Insert(m, locator); else if (m == 3)

x = 520; y = 270; locator = new Locator(m, x, y, LocatorRadius, sangle4); aLocators.Insert(m, locator); else if (m == 4)

x = 270; y = 520; ocator = new Locator(m, x, y, LocatorRadius, sangle5); aLocators.Insert(m, locator); m++; else if (combo1 == 3) int x = 20, y = 20; int m = 0; while ((aLocators.Count) < 6) if (m == 0)

x = 145; y = 100; ocator = new Locator(m, x, y, LocatorRadius, sangle1); aLocators.Insert(m, locator); else if (m == 1)

x = 270; y = 100; locator = new Locator(m, x, y, LocatorRadius, sangle2); aLocators.Insert(m, locator); else if (m == 2)

x = 395; y = 100; ocator = new Locator(m, x, y, LocatorRadius, sangle3); aLocators.Insert(m, locator); else if (m == 3)

x = 145; y = 400; ocator = new Locator(m, x, y, LocatorRadius, sangle4); aLocators.Insert(m, locator); else if (m == 4)

x = 270; y = 400; ocator = new Locator(m, x, y, else if (m == 6)sangle5); LocatorRadius, aLocators.Insert(m, locator); x = 270; y = 520; Locator locator = new Locator(m, x, y, LocatorRadius, sangle7); aLocators.Insert(m, locator); else if (m == 5)

x = 395; y = 400; ocator = new Locator(m, x, y, else if (m == 7)sangle5); LocatorRadius, aLocators.Insert(m, locator); x = 520; y = 520; Locator locator = new Locator(m, x, y, LocatorRadius, sangle8); aLocators.Insert(m, locator); m++; m++; //Deploy Beacons if (checkBeacons == true) int b = 0; while (aBeacons.Count < noBeacons)

eacon = new Beacon(b, r.Next(iMaxX - 10), r.Next(iMaxY - 10), BeaconRadius); aBeacons.Insert(b, beacon); b++;

//Deployment of Beacons if (checkBeacons == true) int b = 0; while (aBeacons.Count < noBeacons) Beacon beacon = new Beacon(b, r.Next(iMaxX - 10), r.Next(iMaxY - 10), BeaconRadius); aBeacons.Insert(b, beacon); b++;

2- Wireless Sensor Node Class

ll; //packets between this node and any locator 3- Wireless Sensor Connection ll; //packets between this node and any beacon Class If the distance between sensor node and other s; // the coordinatestransmission range, this class will be called. of the node x, int y) //constructor for static sensor

sensor node or locator node is less than the

w ArrayList();

x, int y, int dx, int dy) //Mobile sensor const.

w ArrayList();

a communications link between two wireless devices.

sorConnection

tor; 4- Mobile Sensor Node Class on; or sSender; // the upstream sensor ; tart angle of locator sector //Power levels for PTA algorithm

public WirelessSensor sReceiver; // the downstream sensor

d antenna SeRLoc-HiRLoc onnection(Locator sLocator, WirelessSensor

= sLocator; = sReceiver; Sangle;

ectional antenna (Centroid algorithm) onnection(Locator sLocator, WirelessSensor sReceiver)

= sLocator; = sReceiver;

r,reciver and power level for PTA algorithm onnection(Locator sLocator, WirelessSensor sReceiver, short Prlevel) = sLocator; = sReceiver; Prlevel;

,locator and start angle for sector (DIL algorithm) onnection(Beacon sBeacon, Locator sLocator, WirelessSensor sReceiver, int Sangle)

= sBeacon; = sLocator; = sReceiver; Sangle;

of mobile sensors.

,top or down) stepy) sensors ex to control access to the sensor list (20, 520), r.Next(20, of a sensor stepy)); X and Y coordinates 520), stepx, r generator

, Random r) ,top or down) stepy)

(20, 520), r.Next(20, 520), stepx, stepy));

t(iMaxX), r.Next(iMaxY), stepx, 0));

t(iMaxX), r.Next(iMaxY), 0, stepy));

t(iMaxX), r.Next(iMaxY), ds it to the sensor list -stepx, 0));

t(iMaxX), r.Next(iMaxY), 0, -stepy)); stepy)

veling right and up or down aSensors.Add(new WirelessSensor(-5, r.Next(iMaxY), r.Next(stepx + 2) + stepx, r.Next(stepy + rs around, and and left or rightthat have //traveled out of bounds raveling down removes those motion r.Next(stepx + 4) - stepx, r.Next(stepy + 2) + stepy)); axX), -5, traveling left and up or down ewr.Next(iMaxY), r.Next(stepx) - stepx, r.Next(stepy + 4) - stepy)); 5, ArrayList(); in aSensors) r, traveling up and left or right aSensors.Add(new WirelessSensor(r.Next(iMaxX), iMaxY + 5, r.Next(stepx + 4) - stepx, r.Ne

ensor.y == 140 || sensor.y == 200 || sensor.y == 260 || sensor.y == 320 || sensor.y == 380 || sensor.y == 440 || sensor.y p or down) 0 || sensor.y step = 16.666 m/sec = //60 km/hour, == 290 0 km/hour, 2 == 170 || sensor.y == 230 || sensor.yand so on|| sensor.y == 350 || sensor.y == 410 || sensor.y == 470 || se epy)

raveling right xt(iMaxY), stepx, 0)); der, traveling down MaxX), 20, 0, stepy)); order, traveling left nsor.x > iMaxX + 5) 0)); ext(iMaxY), -stepx, || (sensor.y > iMaxY + 5)) r); m border, traveling up MaxX), 520, 0, -stepy)); veSensors)

public class pkt this function moves the sensors around, and removes those that have traveled out of bounds public int x, y, sangle; public void Update() //traditional motion public int ID; public short prlevel; ArrayList aRemoveSensors = new ArrayList(); foreach (WirelessSensor sensor in aSensors) public pkt(int ID, int x, int y) //Omnidirectional antenna sensor.x += sensor.dx; this.ID = ID; sensor.y += sensor.dy; this.x = x; this.y = y; if ((sensor.x < -5) || (sensor.y < -5) || (sensor.x > iMaxX + 5) || (sensor.y > iMaxY + 5)) aRemoveSensors.Add(sensor); public pkt(int ID, int x, int y, int sangle) //Directed antenna foreach (WirelessSensor sensor in aRemoveSensors) this.ID = ID; aSensors.Remove(sensor); this.x = x; this.y = y; this.sangle = sangle;

public pkt(int ID, int x, int y, short prlevel) //omin-power levels this.prlevel = prlevel; this.ID = ID; this.x = x; this.y = y;

5- Packet Class

public class Beacon public class Locator public int id, y, dx, public int id, x,x, y; dy, sangle, dsangle; public int BeaconRadius; public int LocatorRadius; public short prlevel; public Beacon(int 6- Locator Node Class id, int x, int y, int BeaconRadius) public Locator(int is aint x, int y, int LocatorRadius, int sangle) Locator node id, sensor node but with larger transmission range and this.x = x; this.y x; this.x == y; this.id y; this.y = = id; this.BeaconRadius = BeaconRadius; this.id = id; this.LocatorRadius = LocatorRadius; this.sangle = sangle;

known posirion.

7- Beacon Node Class Beacon node the same as locator node. Used with DIL algorithm.

The second class of simulator component is developer interface class which contains all control functions (e.g. run and stop simulator, painting method, timer event handler,etc.).

private void picNetwork_Paint(object sender, System.Windows.Forms.PaintEventArgs e) if (network != null) network.bPainting = true; network.bPaint = false;

Paint method works as follows:Font font = new Font("Times New Roman", 7.0f); StringFormat format = new StringFormat(); format.Alignment = StringAlignment.Center; Graphics g = e.Graphics; g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; // draw background g.FillRectangle(System.Drawing.Brushes.FloralWhite, e.ClipRectangle); // draw network objects (if network has been deployed) if (network != null) // draw static sensor nodes int j = 0; foreach (networkdll.Class1.WirelessSensor sensor in network.aSensors) g.DrawEllipse(Pens.Blue, sensor.x - 4, sensor.y - 4, 9, 9); g.FillEllipse(Brushes.Azure, sensor.x - 4, sensor.y - 4, 9, 9); j++; // draw mobile sensor nodes if ((network.bRunningSimulation == true) && (network.sensors != null)) network.sensors.mutexSensor.WaitOne(); foreach (networkdll.Class1.WirelessSensor sensor in network.sensors.aSensors) g.DrawEllipse(Pens.Blue, sensor.x - 4, sensor.y - 4, 9, 9); g.FillEllipse(Brushes.Azure, sensor.x - 4, sensor.y - 4, 9, 9); network.sensors.mutexSensor.ReleaseMutex();

evels

;

work.aLocators)

oBox1.SelectedIndex==0)

or.x - network.LocatorRadius, locator.y - network.LocatorRadius, network.LocatorRadius * 2, network.LocatorRadius * 2, net

x8.Text) + prsep, locator.y - int.Parse(textBox8.Text) + prsep, (int.Parse(textBox8.Text) - prsep) * 2, (int.Parse(textBox8.Te

8.Text) + 2 * prsep, locator.y - int.Parse(textBox8.Text) + 2 * prsep, (int.Parse(textBox8.Text) - 2 * prsep) * 2, (int.Parse(te

8.Text) + 3 * prsep, locator.y - int.Parse(textBox8.Text) + 3 * prsep, (int.Parse(textBox8.Text) - 3 * prsep) * 2, (int.Parse(te

8.Text) + 4 * prsep, locator.y - int.Parse(textBox8.Text) + 4 * prsep, (int.Parse(textBox8.Text) - 4 * prsep) * 2, (int.Parse(te

g.DrawEllipse(locatorPen, locator.x - 5, locator.y - 5, 10, 10); g.FillEllipse(lBrush, locator.x - 5, locator.y - 5, 10, 10); g.DrawString(locator.id.ToString(), font, lbrush, locator.x + 5, locator.y + 5); g.DrawString("(" + locator.x + " , " + locator.y + ")", font, lbrush, locator.x + 5, locator.y - 15);

ocatorRadius + prsep, locator.y - network.LocatorRadius + prsep, (network.LocatorRadius - prsep) * 2, (network.LocatorRad ocatorRadius + 2 * prsep, locator.y - network.LocatorRadius + 2 * prsep, (network.LocatorRadius - 2 * prsep) * 2, (network catorRadius + 3 * prsep, locator.y - network.LocatorRadius + 3 * prsep, (network.LocatorRadius - 3 * prsep) * 2, (network.L catorRadius + 4 * prsep, locator.y - network.LocatorRadius + 4 * prsep, (network.LocatorRadius - 4 * prsep) * 2, (network.L

catorRadius + prsep, locator.y - network.LocatorRadius + prsep, (network.LocatorRadius - prsep) * 2, (network.LocatorRad

catorRadius + 2 * prsep, locator.y - network.LocatorRadius + 2 * prsep, (network.LocatorRadius - 2 * prsep) * 2, (network.L

ocatorRadius + 3 * prsep, locator.y - network.LocatorRadius + 3 * prsep, (network.LocatorRadius - 3 * prsep) * 2, (network.

catorRadius + 4 * prsep, locator.y - network.LocatorRadius + 4 * prsep, (network.LocatorRadius - 4 * prsep) * 2, (network.L

.x - network.LocatorRadius, locator.y - network.LocatorRadius, network.LocatorRadius * 2, network.LocatorRadius * 2, netw

ator.x - network.LocatorRadius, locator.y - network.LocatorRadius, network.LocatorRadius * 2, network.LocatorRadius * 2);

Radius + prsep, locator.y - network.LocatorRadius + prsep, (network.LocatorRadius - prsep) * 2, (network.LocatorRadius - p

Radius + 2 * prsep, locator.y - network.LocatorRadius + 2 * prsep, (network.LocatorRadius - 2 * prsep) * 2, (network.Locato

Radius + 3 * prsep, locator.y - network.LocatorRadius + 3 * prsep, (network.LocatorRadius - 3 * prsep) * 2, (network.Locat

Radius + 4 * prsep, locator.y - network.LocatorRadius + 4 * prsep, (network.LocatorRadius - 4 * prsep) * 2, (network.Locat

.x - network.LocatorRadius, locator.y - network.LocatorRadius, network.LocatorRadius * 2, network.LocatorRadius * 2, netw

ator.x - network.LocatorRadius, locator.y - network.LocatorRadius, network.LocatorRadius * 2, network.LocatorRadius * 2);

Radius + prsep, locator.y - network.LocatorRadius + prsep, (network.LocatorRadius - prsep) * 2, (network.LocatorRadius -

Radius + 2 * prsep, locator.y - network.LocatorRadius + 2 * prsep, (network.LocatorRadius - 2 * prsep) * 2, (network.Locato

Radius + 3 * prsep, locator.y - network.LocatorRadius + 3 * prsep, (network.LocatorRadius - 3 * prsep) * 2, (network.Locato

catorRadius + 4 * prsep, locator.y - network.LocatorRadius + 4 * prsep, (network.LocatorRadius - 4 * prsep) * 2, (network.L

kBox8.Checked, checkBox9.Checked, checkBox10.Checked, network.LocatorRadius, network.Sweepangle, network.sangle1

ckBox8.Checked, checkBox9.Checked, checkBox10.Checked, network.LocatorRadius, network.Sweepangle, network.sangl

checkBox8.Checked, checkBox9.Checked, checkBox10.Checked, network.LocatorRadius, txtOutputFolder.Text); //Centroid

OutputFolder.Text); //PTA Algorithm

, int.Parse(textBox5.Text), network.LocatorRadius, network.Sweepangle, network.sangle1, network.sangle2, network.sang

.Text), int.Parse(textBox5.Text), network.LocatorRadius, network.Sweepangle, network.sangle1, network.sangle2, network

(textBox4.Text), int.Parse(textBox5.Text), network.LocatorRadius, network.BeaconRadius, network.Sweepangle, network.s

network.sangle3, network.sangle4, network.sangle5, network.sangle6, network.sangle7, network.sangle8, txtOutputFolder

heckBox8.Checked, checkBox9.Checked, checkBox10.Checked, network.LocatorRadius, network.Sweepangle, network.san

checkBox8.Checked, checkBox9.Checked, checkBox10.Checked, network.LocatorRadius, network.Sweepangle, network.sa

ked, checkBox8.Checked, checkBox9.Checked, checkBox10.Checked, network.LocatorRadius, txtOutputFolder.Text);//Cent

/PTA Algorithm

Text), int.Parse(textBox5.Text), network.LocatorRadius, network.Sweepangle, network.sangle1, network.sangle2, network.s

Box4.Text), int.Parse(textBox5.Text), network.LocatorRadius, network.Sweepangle, network.sangle1, network.sangle2, net

se(textBox4.Text), int.Parse(textBox5.Text), network.LocatorRadius, network.BeaconRadius, network.Sweepangle, network

ngle2, network.sangle3, network.sangle4, network.sangle5, network.sangle6, network.sangle7, network.sangle8, txtOutpu

at locatorRadius, float sweepangle, int sangle1, int sangle2, int sangle3, int sangle4, int sangle5, int sangle6, int sangle7, in eckBox4, bool checkBox5, bool checkBox6, bool checkBox7, bool checkBox8, float locatorRadius, float sweepangle, int san atorRadius; epangle;

What is going on inside the code snippets?textbox);

The second component of our framework is localization algorithm that is written in DLL file by a developer then referencing it to the simulator and running it. We take a sample localization algorithm as an example to show how the code actually works.

High Resolution Localization algorithm (HiRLoc)Any localization algorithm consists of four methods: set_parameters, connect, send and localize. These methods differ from one to another. Localization algorithm constructor:

1- Set_parameters method, used to receive initialization parameters from user interface:

2- Connect method, used to test the connectivity between sensor node and locator node.

void connect(ArrayList asensor, ArrayList alocator) for (int j = 0; j < asensor.Count; j++)

kdll.Class1.WirelessSensor jSensor = networkdll.Class1.WirelessSensor)asensor[j]; jSensor.apkts = new ArrayList(); jSensor.Connections = new ArrayList(); for (int i = 0; i < alocator.Count; i++) networkdll.Class1.Locator iLocator = (networkdll.Class1.Locator)alocator[i]; if (i == 0) iLocator.sangle = sangle1; if (i == 1) iLocator.sangle = sangle2; if (i == 2) iLocator.sangle = sangle3; else if (i == 3) iLocator.sangle = sangle4; if (i == 4) iLocator.sangle = sangle5; for if (i == 5) iLocator.sangle = k++) (int k = 1; k < sweepangle; sangle6; if (i == 6) iLocator.sangle = sangle7; if (i == 7) iLocator.sangle = sangle8; if (theta1 == iLocator.sangle)

sRadius = networkdll.Class1.WirelessSensorConnection(iLocator, jSensor, (iLocator.sangle - res))); break;//,iLocator.sweep) s.Add(new (float)(Math.Sqrt(Math.Pow(iLocator.x - jSensor.x, 2) + Math.Pow(iLocator.y - jSensor.y, 2))); eta1 = (int)Math.Floor((Math.Acos(Math.Abs(jSensor.x - iLocator.x) / lsRadius) * (180 * 7 / 22))); eta = (int)Math.Floor((Math.Acos(Math.Abs(jSensor.y - iLocator.y) / lsRadius) * (180 * 7 / 22))); or.sangle = (iLocator.sangle + 1); eta2 = theta + 90; eta3 = theta1 + 180; eta4 = 270 + theta; = System.DateTime.Now.Ticks; if (lsRadius = iLocator.x && jSensor.y >= iLocator.y) //Region 1

eta1 >= iLocator.sangle && theta1 = hsa[0] && theta1 = hsa[0] && theta2