Esempio n. 1
0
        //MATLAB REFERENCE. You must add the matlab reference via the project menu before this will work
        //MLApp.MLApp matlab;
        public AdaptiveProvider(RandomizedQueue <StudyTestPair> stp, IArrayView <string> presentation, IArrayView <string> class1, IArrayView <string> class2,
                                AdaptiveSettings settings, IEEGDataSource dataSource, IArray <ClassificationScheme> classifiers)
        {
            this.pres         = stp;
            this.settings     = settings;
            this.dataSource   = dataSource;
            this.presentation = presentation;
            this.class1       = class1;
            this.class2       = class2;
            this.classifiers  = classifiers;
            //NOTE: It will always take the first classification scheme chosen
            //TODO: Make it so that only one classification scheme can be specified
            classifier = new ClassifierManager(classifiers[0]);
            //MATLAB REFERENCE
            //matlab = new MLApp.MLApp();

            blocks = new RandomizedQueue <string> [settings.NumBlocks * 2];
            int limit = 0;

            for (int i = 0; i < settings.NumBlocks * 2; i += 2)
            {
                blocks[i]     = new RandomizedQueue <string>();
                blocks[i + 1] = new RandomizedQueue <string>();

                for (int j = 0 + limit * settings.BlockSize; j < (limit + 1) * settings.BlockSize; j++)
                {
                    blocks[i].Add(this.class1[j]);
                    blocks[i + 1].Add(this.class2[j]);
                }
                limit++;
            }
        }
Esempio n. 2
0
 public KRMonitorProvider(IArrayView <string> presentation, RandomizedQueue <StudyTestPair> stp,
                          KRMonitorSettings settings, IEEGDataSource dataSource)
 {
     this.presentation = presentation;
     this.stp          = stp;
     this.settings     = settings;
     this.dataSource   = dataSource;
 }
        /// <summary>
        /// Invokes the connected action
        /// </summary>
        public void SourceConnected(IEEGDataSource source)
        {
            if (this.source == null)
                this.source = source;
            else if (this.source != source)
                throw new Exception("Listener connected to multiple sources!");

            if (this.onSourceConnected != null)
                this.invoker.BeginInvoke(() => this.onSourceConnected(source));
        }
Esempio n. 4
0
 /// <summary>
 /// Construct an experiment with the given parameters
 /// </summary>
 public ExperimentProvider(ExperimentSettings settings,
                           StimulusClass stimulusClass1,
                           StimulusClass stimulusClass2,
                           IArrayView <ClassificationScheme> classificationSchemes,
                           IEEGDataSource dataSource)
 {
     this.Settings              = settings;
     this.StimulusClass1        = stimulusClass1;
     this.StimulusClass2        = stimulusClass2;
     this.ClassificationSchemes = classificationSchemes;
     this.DataSource            = dataSource;
 }
Esempio n. 5
0
        /// <summary>
        /// Invokes the connected action
        /// </summary>
        public void SourceConnected(IEEGDataSource source)
        {
            if (this.source == null)
            {
                this.source = source;
            }
            else if (this.source != source)
            {
                throw new Exception("Listener connected to multiple sources!");
            }

            if (this.onSourceConnected != null)
            {
                this.invoker.BeginInvoke(() => this.onSourceConnected(source));
            }
        }
Esempio n. 6
0
        public CompetitionExperimentProvider(IArrayView <string> presentation, IArrayView <string> class1, IArrayView <string> class2,
                                             CompetitionExperimentSettings settings, IEEGDataSource dataSource)
        {
            this.presentation = presentation;
            this.class1       = class1;
            this.class2       = class2;
            this.settings     = settings;
            this.dataSource   = dataSource;
            blocks            = new RandomizedQueue <string> [settings.NumBlocks * 2];
            int limit = 0;

            for (int i = 0; i < settings.NumBlocks * 2; i += 2)
            {
                blocks[i]     = new RandomizedQueue <string>();
                blocks[i + 1] = new RandomizedQueue <string>();

                for (int j = 0 + limit * settings.BlockSize; j < (limit + 1) * settings.BlockSize; j++)
                {
                    blocks[i].Add(this.class1[j]);
                    blocks[i + 1].Add(this.class2[j]);
                }
                limit++;
            }
        }