because it generate randomly, so it's position and radius is could be same or difference. And to calculate the sensor's coverage wide, i used this formula :
where's :
is sensor's y coordinate value
is sensor's x coordinate value
is service area's x coordinate value
is service area's y coordinate value
is sensor's x radius
Here's the example of type A sensor's coverage calculation :
Type A sensor's position is on {xA, yA} and it has radius as A m. So, with the formula i used, it could be determine which is covered by sensor or not. If it coverage by sensors, it must be painted red as picture above.
on java programing, it'll be like this :
note : this program is continued from the last post, so that may consist a part or variable from previous post.
and the output is like this :
Since i print "1" for sensor's coverage n "0" for service area that wasn't covered so the output becomes like above. That's why i put it on word n analyze it :
Where's x is count from up to down and y count from left to right, picture above shows 4 type of sensors from Individu 1. We could calculate coverage total use this program :
Then the result is :
for sensor composition like this :
0 comments:
Post a Comment