コード例 #1
0
ファイル: HTMSensor.cs プロジェクト: ArtiDi/HTM.Net
        /**
         * Searches through the specified {@link MultiEncoder}'s previously configured
         * encoders to find and return one that is of type {@link DateEncoder}
         *
         * @param enc   the containing {@code MultiEncoder}
         * @return
         */
        private Optional <SDRPassThroughEncoder> GetSDRPassThroughEncoder(MultiEncoder enc)
        {
            foreach (EncoderTuple t in enc.GetEncoders(enc))
            {
                if (t.GetEncoder() is SDRPassThroughEncoder)
                {
                    return(new Optional <SDRPassThroughEncoder>(t.GetEncoder <SDRPassThroughEncoder>())); // Optional.of((SDRPassThroughEncoder)t.getEncoder());
                }
            }

            return(Optional <SDRPassThroughEncoder> .Empty());
        }
コード例 #2
0
ファイル: HTMSensor.cs プロジェクト: ArtiDi/HTM.Net
        /**
         * Searches through the specified {@link MultiEncoder}'s previously configured
         * encoders to find and return one that is of type {@link DateEncoder}
         *
         * @param enc   the containing {@code MultiEncoder}
         * @return
         */
        private Optional <DateEncoder> GetDateEncoder(MultiEncoder enc)
        {
            foreach (EncoderTuple t in enc.GetEncoders(enc))
            {
                if (t.GetEncoder() is DateEncoder)
                {
                    return(new Optional <DateEncoder>(t.GetEncoder <DateEncoder>()));//Optional.of((DateEncoder)t.GetEncoder());
                }
            }

            return(Optional <DateEncoder> .Empty());
        }
コード例 #3
0
ファイル: HTMSensor.cs プロジェクト: ArtiDi/HTM.Net
        /**
         * Searches through the specified {@link MultiEncoder}'s previously configured
         * encoders to find and return one that is of type {@link CategoryEncoder} or
         * {@link SDRCategoryEncoder}
         *
         * @param enc   the containing {@code MultiEncoder}
         * @return
         */
        private Optional <IEncoder> GetCategoryEncoder(MultiEncoder enc)
        {
            foreach (EncoderTuple t in enc.GetEncoders(enc))
            {
                if ((t.GetEncoder() is CategoryEncoder) || (t.GetEncoder() is SDRCategoryEncoder))
                {
                    return(new Optional <IEncoder>(t.GetEncoder())); //Optional.of(t.getEncoder());
                }
            }

            return(Optional <IEncoder> .Empty());
        }
コード例 #4
0
ファイル: HTMSensor.cs プロジェクト: ArtiDi/HTM.Net
        /**
         * Searches through the specified {@link MultiEncoder}'s previously configured
         * encoders to find and return one that is of type {@link CoordinateEncoder} or
         * {@link GeospatialCoordinateEncoder}
         *
         * @param enc   the containing {@code MultiEncoder}
         * @return
         */
        private Optional <IEncoder> GetCoordinateEncoder(MultiEncoder enc)
        {
            foreach (EncoderTuple t in enc.GetEncoders(enc))
            {
                if ((t.GetEncoder() is CoordinateEncoder) || (t.GetEncoder() is GeospatialCoordinateEncoder))
                {
                    return(new Optional <IEncoder>(t.GetEncoder()));  // Optional.of(t.getEncoder());
                }
            }

            return(Optional <IEncoder> .Empty());
        }
コード例 #5
0
ファイル: HTMSensor.cs プロジェクト: ArtiDi/HTM.Net
        /**
         * Sets the local parameters used to configure the major
         * algorithmic components.
         */
        public override void InitEncoder(Parameters p)
        {
            localParameters = p;

            Map <string, Map <string, object> > encoderSettings;

            if ((encoderSettings = (Map <string, Map <string, object> >)p.GetParameterByKey(Parameters.KEY.FIELD_ENCODING_MAP)) != null &&
                !encoder.GetEncoders().Any() &&
                indexToEncoderMap == null)
            {
                InitEncoders(encoderSettings);
                MakeIndexEncoderMap();
            }
        }
コード例 #6
0
ファイル: HTMSensor.cs プロジェクト: ArtiDi/HTM.Net
        /**
         * Searches through the specified {@link MultiEncoder}'s previously configured
         * encoders to find and return one that is of type {@link ScalarEncoder},
         * {@link RandomDistributedScalarEncoder}, {@link AdaptiveScalarEncoder},
         * {@link LogEncoder} or {@link DeltaEncoder}.
         *
         * @param enc   the containing {@code MultiEncoder}
         * @return
         */
        private Optional <IEncoder> GetNumberEncoder(MultiEncoder enc)
        {
            foreach (EncoderTuple t in enc.GetEncoders(enc))
            {
                if ((t.GetEncoder() is RandomDistributedScalarEncoder) ||
                    (t.GetEncoder() is ScalarEncoder) ||
                    (t.GetEncoder() is AdaptiveScalarEncoder) ||
                    (t.GetEncoder() is LogEncoder) ||
                    (t.GetEncoder() is DeltaEncoder))
                {
                    return(new Optional <IEncoder>(t.GetEncoder())); // Optional.of(t.getEncoder());
                }
            }

            return(Optional <IEncoder> .Empty());
        }