Exemple #1
0
        public static POI ReadFromFile(string path)
        {
            var reader = XmlReader.Create(path);
            var poi    = new POI();

            poi.ReadXml(reader);
            reader.Close();
            return(poi);
        }
Exemple #2
0
 public bool IsCovered(POI poi)
 {
     foreach (Sensor sensor in SensorCollection)
     {
         if (sensor.Battery.IsActive && sensor.IsInRange(poi))
         {
             return(true);
         }
     }
     return(false);
 }
Exemple #3
0
        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);
        }
Exemple #4
0
 public bool IsInRange(POI poi)
 {
     return(this.DistanceTo(poi.Point) <= this.Radius);
 }