Ejemplo n.º 1
0
        public async Task <bool?> AmIInTram(IEnumerable <SensorsReadingUnitsDTO> sensorsReadings)
        {
            var readings = _mapper.Map <IEnumerable <SensorsReading> >(sensorsReadings).ToList();

            foreach (var sensorsReading in readings)
            {
                if (!TryToHandleSensorsReading(sensorsReading))
                {
                    return(null);
                }
            }

            return(await _modelsManager.IsInTram(readings));
        }
Ejemplo n.º 2
0
        public async Task <bool?> AmIInTram(IEnumerable <SensorsReadingUnitsDTO> sensorsReadings, bool useNeuralNetwork,
                                            bool useLocation)
        {
            var readings = _mapper.Map <IEnumerable <SensorsReading> >(sensorsReadings).ToList();

            foreach (var sensorsReading in readings)
            {
                if (!TryToHandleSensorsReading(sensorsReading))
                {
                    return(null);
                }
            }

            var neuralReply = useNeuralNetwork ? await _modelsManager.IsInTram(readings) : true;

            var gpsSimilarity = useLocation ? IsLocationSimilar(readings) : true;

            return(neuralReply && gpsSimilarity);
        }