public static POI ReadFromFile(string path) { var reader = XmlReader.Create(path); var poi = new POI(); poi.ReadXml(reader); reader.Close(); return(poi); }
public bool IsCovered(POI poi) { foreach (Sensor sensor in SensorCollection) { if (sensor.Battery.IsActive && sensor.IsInRange(poi)) { return(true); } } return(false); }
private List <POI> InitPoiCollection(Area parent) { var poiCollection = new List <POI>(); var poiCount = Settings.ParamSettings.PoiCount; var poiSqrt = Math.Round(Math.Sqrt(poiCount)) - 1; var distanceBetweenPOI = Settings.ParamSettings.AreaWidth / poiSqrt; double x = 0, y = 0; int id = 1; for (int row = 1; row <= poiSqrt + 1; row++, y += distanceBetweenPOI) { for (int col = 1; col <= poiSqrt + 1; col++, x += distanceBetweenPOI) { var poi = new POI(id++, new Point(x, y), parent); poiCollection.Add(poi); } x = 0; } return(poiCollection); }
public bool IsInRange(POI poi) { return(this.DistanceTo(poi.Point) <= this.Radius); }