Ejemplo n.º 1
0
        /// <summary>
        /// For a given decision maker, get all sensor ranges which they currently have (max range per sensor object)
        /// </summary>
        /// <param name="dmID"></param>
        /// <returns></returns>
        public List <SensorRange> GetDecisionMakersSensorRanges(String dmID)
        {
            List <SensorRange> ranges = new List <SensorRange>();

            lock (GroundTruthLock)
            {
                DMView      view  = _dddConnection.GetDMView(dmID);
                SensorRange range = null;
                if (view != null)
                {
                    foreach (String s in view.MyObjects.Keys)
                    {
                        if (view.MyObjects[s].Location.exists)
                        {
                            double maxRange = 0;
                            foreach (SensorValue sv in view.MyObjects[s].Sensors.sensors)
                            {
                                if (sv.maxRange > maxRange)
                                {
                                    maxRange = sv.maxRange;
                                }
                            }
                            range = new SensorRange(DataValueFactory.BuildFromDataValue(view.MyObjects[s].Location) as LocationValue, maxRange);
                            ranges.Add(range);
                        }
                    }
                }
            }
            return(ranges);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// For a given decision maker, get all of their object locations
        /// </summary>
        /// <param name="dmID"></param>
        /// <returns></returns>
        public List <LocationValue> GetDecisionMakersObjectPositions(String dmID)
        {
            List <LocationValue> positions = new List <LocationValue>();

            lock (GroundTruthLock)
            {
                DMView view = _dddConnection.GetDMView(dmID);
                if (view != null)
                {
                    foreach (String s in view.MyObjects.Keys)
                    {
                        if (view.MyObjects[s].Location.exists)
                        {
                            positions.Add(DataValueFactory.BuildFromDataValue(view.MyObjects[s].Location) as LocationValue);
                        }
                    }
                }
            }
            return(positions);
        }