Exemplo n.º 1
0
        /**
         * Convenience method to compute a metric over an indices trace, excluding
         * resets.
         *
         * @param trace     Trace of indices
         * @return
         */
        public virtual Metric <int> mmGetMetricFromTrace(IndicesTrace trace)
        {
            List <HashSet <int> > data          = null;
            BoolsTrace            excludeResets = mmGetTraceResets();

            if (excludeResets != null)
            {
                int[] i = { 0 };
                data = trace.items.Where(t => !excludeResets.items[i[0]++]).ToList();
            }

            trace.items = data;
            CountsTrace iTrace = trace.makeCountsTrace();

            return(Metric <int> .createFromTrace(iTrace, mmGetTraceResets()));
        }
Exemplo n.º 2
0
        /**
         * Returns a {@code Metric} object created from the specified {@link Trace}
         * @param trace
         * @param excludeResets
         * @return
         */
        public static Metric <TNumber> createFromTrace <T>(T trace, BoolsTrace excludeResets)
            where T : Trace <TNumber>, ITrace
        {
            List <TNumber> data = (List <TNumber>)trace.items;

            if (excludeResets != null)
            {
                data = new List <TNumber>();
                for (int k = 0; k < trace.items.Count; k++)
                {
                    if (!excludeResets.items[k])
                    {
                        TNumber n = trace.items[k];
                        data.Add(n);
                    }
                }
            }
            return(new Metric <TNumber>(trace.monitor, trace.title, data));
        }
Exemplo n.º 3
0
        public virtual List <Metric <int> > mmGetDefaultMetrics(int verbosity)
        {
            BoolsTrace           resetsTrace = mmGetTraceResets();
            List <Metric <int> > metrics     = new List <Metric <int> >();

            List <ITrace> utilTraces = mmGetDefaultTraces(verbosity);

            for (int i = 0; i < utilTraces.Count - 3; i++)
            {
                metrics.Add(Metric <int> .createFromTrace((Trace <int>)utilTraces[i], resetsTrace));
            }
            for (int i = utilTraces.Count - 3; i < utilTraces.Count - 1; i++)
            {
                metrics.Add(Metric <int> .createFromTrace((Trace <int>)utilTraces[i], null));
            }
            metrics.Add(mmGetMetricSequencesPredictedActiveCellsPerColumn());
            metrics.Add(mmGetMetricSequencesPredictedActiveCellsShared());

            return(metrics);
        }
Exemplo n.º 4
0
        //public abstract List<Metric> mmGetDefaultMetrics(int verbosity);

        public virtual string mmPrettyPrintTraces(List <ITrace> traces, BoolsTrace breakOnResets)
        {
            throw new NotImplementedException();
        }