OMNET++ SENSOR NETWORK

OMNET++ SENSOR NETWORK helps to communicate among them using radio signals, and deployed in quantity to sense, monitor and understand the physical world. Wireless Sensor nodes are called motes. Wireless Sensor Network is a self-configuring network.

Applications of WSN:

• Industrial applications.
• Transportation.
• Civil infrastructure services.
• Security.
• Science .

Characteristics of WSN:

• Vast or small number of nodes per unit area, very application-dependent.
• Support large number of nodes.
• Re-programmability of nodes in the field might be necessary, improves flexibility.
• Lifetime of individual nodes relatively unimportant.
• Incorporate possible additional resources, say for example newly deployed nodes.
• Be robust against node failure.

Research work on wsn:

• Robotic sensor in underwater environment.
• Research on agricultural environment.
• Introducing zigbee in WSN.
• Energy efficient designing in Emergency situation.
• Distributed computing and decision making.

Sample code for WSN:

```double segmentsIntersectAt(Coord p1From, Coord p1To, Coord p2From, Coord p2To) {
Coord p1Vec = p1To - p1From;
Coord p2Vec = p2To - p2From;
Coord p1p2 = p1From - p2From;
double D = (p1Vec.x * p2Vec.y - p1Vec.y * p2Vec.x);
double p1Frac = (p2Vec.x * p1p2.y - p2Vec.y * p1p2.x) / D;
if (p1Frac < 0 || p1Frac > 1) return -1;
double p2Frac = (p1Vec.x * p1p2.y - p1Vec.y * p1p2.x) / D;
if (p2Frac < 0 || p2Frac > 1) return -1;
return p1Frac;
}

double WSN::calculateAttenuation(const Coord& senderPos, const Coord& receiverPos) const {
if (getShape().size() < 2) return 1;
std::multiset<double> intersectAt;
bool doesIntersect = false;
const Obstacle::Coords& shape = getShape();
Obstacle::Coords::const_iterator i = shape.begin();
Obstacle::Coords::const_iterator j = (shape.rbegin()+1).base();
for (; i != shape.end(); j = i++) {
Coord c1 = *i;
Coord c2 = *j;

double i = segmentsIntersectAt(senderPos, receiverPos, c1, c2);
if (i != -1) {
doesIntersect = true;
intersectAt.insert(i);
}
}
bool senderInside = isPointInObstacle(senderPos, *this);
if (!doesIntersect && !senderInside && !receiverInside) return 1;
double numWalls = intersectAt.size();
if (senderInside) intersectAt.insert(0);