コード例 #1
0
        public LTSimpleDistance(SchoolWorld w)
            : base(w)
        {
            TSHints = new TrainingSetHints
            {
                { TSHintAttributes.IS_VARIABLE_COLOR, 0 },
                { TSHintAttributes.IS_VARIABLE_SIZE, 0 },
                { ERROR_TOLERANCE, 0.25f },
                { TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 1 },
                { TSHintAttributes.IMAGE_NOISE, 0 },
                { TSHintAttributes.GIVE_PARTIAL_REWARDS, 1 },
                { TSHintAttributes.MAX_NUMBER_OF_ATTEMPTS, 10000 }
            };

            TSProgression.Add(TSHints.Clone());
            TSProgression.Add(new TrainingSetHints {
                { TSHintAttributes.IS_VARIABLE_COLOR, 1 },
                { ERROR_TOLERANCE, 0.15f },
                { TSHintAttributes.GIVE_PARTIAL_REWARDS, 0 }
            });
            TSProgression.Add(new TrainingSetHints {
                { TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 2 }
            });
            TSProgression.Add(new TrainingSetHints {
                { TSHintAttributes.IS_VARIABLE_SIZE, 1 },
                { ERROR_TOLERANCE, 0.10f },
            });
            TSProgression.Add(new TrainingSetHints {
                { ERROR_TOLERANCE, 0.05f },
                { TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 3 },
            });
            TSProgression.Add(TSHintAttributes.IMAGE_NOISE, 1);
        }
コード例 #2
0
        public LTDetectShapeColor(SchoolWorld w)
            : base(w)
        {
            TSHints = new TrainingSetHints
            {
                { TSHintAttributes.MAX_NUMBER_OF_ATTEMPTS, 10000 },
                { TSHintAttributes.IMAGE_NOISE, 0 },
                { TSHintAttributes.IS_VARIABLE_SIZE, 0 },
                { TSHintAttributes.IS_VARIABLE_POSITION, 0 },
                { TSHintAttributes.IS_VARIABLE_ROTATION, 0 },
                { TSHintAttributes.DEGREES_OF_FREEDOM, 2 },
                { TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 2 },
                { COLOR_COUNT, 2 },
            };

            TSProgression.Add(TSHints.Clone());
            TSProgression.Add(TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 3);
            TSProgression.Add(TSHintAttributes.IS_VARIABLE_POSITION, 1);
            TSProgression.Add(COLOR_COUNT, 3);
            TSProgression.Add(TSHintAttributes.IMAGE_NOISE, 1);
            TSProgression.Add(TSHintAttributes.DEGREES_OF_FREEDOM, 3);
            TSProgression.Add(TSHintAttributes.IS_VARIABLE_SIZE, 1);
            TSProgression.Add(TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 4);
            TSProgression.Add(TSHintAttributes.IS_VARIABLE_ROTATION, 1);
            TSProgression.Add(COLOR_COUNT, 4);
            TSProgression.Add(TSHintAttributes.DEGREES_OF_FREEDOM, 4);
            TSProgression.Add(TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 5);
            TSProgression.Add(COLOR_COUNT, 5);

            SetClasses();
        }
コード例 #3
0
        public LTSimpleSize(SchoolWorld w)
            : base(w)
        {
            TSHints = new TrainingSetHints
            {
                { TSHintAttributes.IS_VARIABLE_COLOR, 0 },
                { TARGET_SIZE_LEVELS, 2 },
                { TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 1 },
                { TSHintAttributes.IMAGE_NOISE, 0 },
                { TSHintAttributes.GIVE_PARTIAL_REWARDS, 1 },
                { TSHintAttributes.MAX_NUMBER_OF_ATTEMPTS, 10000 }
            };

            TSProgression.Add(TSHints.Clone());
            TSProgression.Add(new TrainingSetHints {
                { TSHintAttributes.IS_VARIABLE_COLOR, 1 },
                { TSHintAttributes.GIVE_PARTIAL_REWARDS, 0 }
            });
            TSProgression.Add(new TrainingSetHints {
                { TARGET_SIZE_LEVELS, 5 },
                { TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 2 }
            });
            TSProgression.Add(new TrainingSetHints {
                { TARGET_SIZE_LEVELS, 10 },
                { TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 3 },
            });
            TSProgression.Add(TSHintAttributes.IMAGE_NOISE, 1);
        }
コード例 #4
0
        public LTClassComposition(SchoolWorld w)
            : base(w)
        {
            TSHints = new TrainingSetHints {
                { TSHintAttributes.IMAGE_NOISE, 0 },
                { TSHintAttributes.IS_VARIABLE_POSITION, 0 },
                { TSHintAttributes.IS_VARIABLE_COLOR, 0 },
                { TSHintAttributes.IS_VARIABLE_SIZE, 0 },
                { TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 4f },
                { TSHintAttributes.MAX_NUMBER_OF_ATTEMPTS, 10000 }
            };

            TSProgression.Add(TSHints.Clone());

            TSProgression.Add(TSHintAttributes.IS_VARIABLE_COLOR, 1.0f);
            TSProgression.Add(TSHintAttributes.IS_VARIABLE_POSITION, 1.0f);
            TSProgression.Add(TSHintAttributes.IMAGE_NOISE, 1);
            TSProgression.Add(TSHintAttributes.IS_VARIABLE_SIZE, 1.0f);
            TSProgression.Add(TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 6f);
            TSProgression.Add(TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 8f);

            m_positiveExamples.Add(Shape.Shapes.Star);
            m_positiveExamples.Add(Shape.Shapes.Circle);
            m_positiveExamples.Add(Shape.Shapes.T);
            m_positiveExamples.Add(Shape.Shapes.Tent);
            m_positiveExamples.Add(Shape.Shapes.Mountains);

            m_negativeExamples.Add(Shape.Shapes.DoubleRhombus);
            m_negativeExamples.Add(Shape.Shapes.Pentagon);
            m_negativeExamples.Add(Shape.Shapes.Rhombus);
            m_negativeExamples.Add(Shape.Shapes.Square);
            m_negativeExamples.Add(Shape.Shapes.Triangle);
        }
コード例 #5
0
        // Construct the learning task
        public LTConditionalTarget(SchoolWorld w)
            : base(w)
        {
            TSHints = new TrainingSetHints {
                { MOVING_CONDITION, 0 },
                { TSHintAttributes.IS_VARIABLE_SIZE, 0 },
                { TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 1 },
                { TSHintAttributes.IMAGE_NOISE, 0 },
                { CONDITION_SALIENCE, 1 },
                //{ TSHintAttributes.DEGREES_OF_FREEDOM, 1 },
                { TSHintAttributes.GIVE_PARTIAL_REWARDS, 1 },
                { TSHintAttributes.MAX_NUMBER_OF_ATTEMPTS, 10000 },
                // Currently, target locations are always uniformly distributed inside POW
                //{ TSHintAttributes.DEPRECATED_MAX_TARGET_DISTANCE, .3f }
                { TSHintAttributes.IMAGE_TEXTURE_BACKGROUND, 0 },
            };

            TSProgression.Add(TSHints.Clone());
            TSProgression.Add(MOVING_CONDITION, 1);
            //TSProgression.Add(TSHintAttributes.DEGREES_OF_FREEDOM, 2);
            //TSProgression.Add(TSHintAttributes.DEPRECATED_MAX_TARGET_DISTANCE, -1);
            TSProgression.Add(TSHintAttributes.IMAGE_NOISE, 1);
            TSProgression.Add(TSHintAttributes.IS_VARIABLE_SIZE, 1);
            TSProgression.Add(TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 2);
            TSProgression.Add(TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 3);
            TSProgression.Add(CONDITION_SALIENCE, .5f);
            TSProgression.Add(TSHintAttributes.GIVE_PARTIAL_REWARDS, 0);
            TSProgression.Add(TSHintAttributes.IMAGE_TEXTURE_BACKGROUND, 1);
        }
コード例 #6
0
 public void SetHints(TrainingSetHints trainingSetHints)
 {
     foreach (var kvp in trainingSetHints)
     {
         CurrentWorld.SetHint(kvp.Key, kvp.Value);
     }
 }
コード例 #7
0
        public LTPongWithoutBricks(SchoolWorld w)
            : base(w)
        {
            TSHints = new TrainingSetHints {
                { TSHintAttributes.IMAGE_NOISE, 0 },
                { TSHintAttributes.MAX_NUMBER_OF_ATTEMPTS, 10000 }
            };

            TSHints.Add(MAX_MISSES_ALLOWED, 1);
            TSHints.Add(BALL_HITS_NEEDED, 1);
            ballHitSum = 0f;
            ballHitSum = 0f;

            TSProgression.Add(TSHints.Clone());

            TSProgression.Add(
                new TrainingSetHints {
                { MAX_MISSES_ALLOWED, 1 },
                { BALL_HITS_NEEDED, 1 }
            });

            TSProgression.Add(
                new TrainingSetHints {
                { MAX_MISSES_ALLOWED, 10 },
                { BALL_HITS_NEEDED, 6 }
            });

            TSProgression.Add(
                new TrainingSetHints {
                { MAX_MISSES_ALLOWED, 10 },
                { BALL_HITS_NEEDED, 10 }
            });

            TSProgression.Add(
                new TrainingSetHints {
                { MAX_MISSES_ALLOWED, 10 },
                { BALL_HITS_NEEDED, 20 }
            });

            TSProgression.Add(
                new TrainingSetHints {
                { MAX_MISSES_ALLOWED, 10 },
                { BALL_HITS_NEEDED, 30 }
            });

            TSProgression.Add(
                new TrainingSetHints {
                { MAX_MISSES_ALLOWED, 10 },
                { BALL_HITS_NEEDED, 40 }
            });

            TSProgression.Add(
                new TrainingSetHints {
                { MAX_MISSES_ALLOWED, 1 },
                { BALL_HITS_NEEDED, 10 }
            });
        }
コード例 #8
0
        public LTDebugging(SchoolWorld w)
            : base(w)
        {
            TSHints = new TrainingSetHints {
                { TSHintAttributes.IMAGE_NOISE, 0 },
                { TSHintAttributes.MAX_NUMBER_OF_ATTEMPTS, 10000 }
            };

            TSProgression.Add(TSHints.Clone());
        }
コード例 #9
0
        public Ltsct1(SchoolWorld w)
            : base(w)
        {
            TSHints = new TrainingSetHints {
                { TSHintAttributes.MAX_NUMBER_OF_ATTEMPTS, 1000000000 },
                { TSHintAttributes.IMAGE_NOISE, 1 },
                { TSHintAttributes.IMAGE_NOISE_BLACK_AND_WHITE, 1 }
            };

            TSProgression.Add(TSHints.Clone());
        }
コード例 #10
0
        public LTCompatibilityMatching(SchoolWorld w)
            : base(w)
        {
            TSHints = new TrainingSetHints {
                { TSHintAttributes.IMAGE_NOISE, 0 },
                { ROTATION_ALLOWED, 0 },
                { TSHintAttributes.MAX_NUMBER_OF_ATTEMPTS, 10000 }
            };

            TSProgression.Add(TSHints.Clone());
            TSProgression.Add(ROTATION_ALLOWED, 1);
            TSProgression.Add(TSHintAttributes.IMAGE_NOISE, 1);
        }
コード例 #11
0
        public LTDetectColor(SchoolWorld w)
            : base(w)
        {
            TSHints = new TrainingSetHints {
                { TSHintAttributes.IMAGE_NOISE, 0 },
                { NUMBER_OF_COLORS, 2 },
                { TSHintAttributes.MAX_NUMBER_OF_ATTEMPTS, 10000 }
            };

            TSProgression.Add(TSHints.Clone());
            TSProgression.Add(TSHintAttributes.IMAGE_NOISE, 1);
            TSProgression.Add(NUMBER_OF_COLORS, 4);
            TSProgression.Add(NUMBER_OF_COLORS, 8);
        }
コード例 #12
0
        public LTSinglePixelRL(SchoolWorld w)
            : base(w)
        {
            TSHints = new TrainingSetHints {
                { TSHintAttributes.IS_VARIABLE_COLOR, 0 },
                { TSHintAttributes.MAX_NUMBER_OF_ATTEMPTS, 10000 }
            };

            TSProgression.Add(TSHints.Clone());
            TSProgression.Add(TSHintAttributes.IS_VARIABLE_COLOR, 1);

            m_objectColor[ObjectType.Target]       = 0;
            m_objectColor[ObjectType.Empty]        = 1;
            m_objectColor[ObjectType.BeforeTarget] = 2;
        }
コード例 #13
0
        public LTVisualEquivalence(SchoolWorld w)
            : base(w)
        {
            TSHints = new TrainingSetHints {
                { TSHintAttributes.IMAGE_NOISE, 0 },
                { TSHintAttributes.MAX_NUMBER_OF_ATTEMPTS, 10000 },
                { NUMBER_OF_DIFFERENT_OBJECTS, 2 },
                { ROTATE_SHAPE, 0 },
                { SCALE_SHAPE, 0 }
            };

            TSProgression.Add(TSHints.Clone());
            TSProgression.Add(NUMBER_OF_DIFFERENT_OBJECTS, 3);
            TSProgression.Add(SCALE_SHAPE, 1);
            TSProgression.Add(ROTATE_SHAPE, 1);
            TSProgression.Add(NUMBER_OF_DIFFERENT_OBJECTS, 5);
        }
コード例 #14
0
        public LTCopyAction(SchoolWorld w)
            : base(w)
        {
            TSHints = new TrainingSetHints
            {
                { STOP_REQUEST, 0 },
                { TSHintAttributes.DEGREES_OF_FREEDOM, 1 },
                { TSHintAttributes.IMAGE_NOISE, 0 },
                { TEACHER_ON_DIFF_START_POSITION, 0 },
                { TSHintAttributes.MAX_NUMBER_OF_ATTEMPTS, 10000 },
                { TSHintAttributes.IMAGE_TEXTURE_BACKGROUND, 1 },
            };

            TSProgression.Add(TSHints.Clone());
            TSProgression.Add(TSHintAttributes.DEGREES_OF_FREEDOM, 2);
            TSProgression.Add(TSHintAttributes.IMAGE_NOISE, 1);
            TSProgression.Add(TEACHER_ON_DIFF_START_POSITION, 1);
        }
コード例 #15
0
        public LTShapeSorting(SchoolWorld w)
            : base(w)
        {
            TSHints = new TrainingSetHints
            {
                { TSHintAttributes.MAX_NUMBER_OF_ATTEMPTS, 10000 },
                { TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 2 },
                { TSHintAttributes.DEGREES_OF_FREEDOM, 1 },
                { TSHintAttributes.IMAGE_NOISE, 0 },
                // Rotation about origin
                { TSHintAttributes.IS_VARIABLE_POSITION, 0 },
                // Shape scaling
                { TSHintAttributes.IS_VARIABLE_SIZE, 0 },
                // Rotation about center of gravity (of each shape)
                { TSHintAttributes.IS_VARIABLE_ROTATION, 0 },
                // Random color
                { TSHintAttributes.IS_VARIABLE_COLOR, 0 },
                // Random distance from origin
                { IS_VARIABLE_DISTANCE, 0 },
                { RANDOMNESS_LEVEL, 1 },
            };

            TSProgression.Add(TSHints.Clone());

            TSProgression.Add(TSHintAttributes.IS_VARIABLE_ROTATION, 1);
            TSProgression.Add(new TrainingSetHints {
                { TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 3 },
                { TSHintAttributes.DEGREES_OF_FREEDOM, 2 }
            });

            TSProgression.Add(TSHintAttributes.IS_VARIABLE_SIZE, 1);
            TSProgression.Add(TSHintAttributes.IMAGE_NOISE, 1);

            TSProgression.Add(IS_VARIABLE_DISTANCE, 1);
            TSProgression.Add(TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 4);

            TSProgression.Add(TSHintAttributes.IS_VARIABLE_POSITION, 1);
            TSProgression.Add(RANDOMNESS_LEVEL, 1.2f);

            TSProgression.Add(TSHintAttributes.IS_VARIABLE_COLOR, 1);
            TSProgression.Add(TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 5);
            TSProgression.Add(RANDOMNESS_LEVEL, 1.4f);
        }
コード例 #16
0
        public LTDetectBlackAndWhite(SchoolWorld w)
            : base(w)
        {
            TSHints = new TrainingSetHints
            {
                { TSHintAttributes.IS_VARIABLE_SIZE, 0 },
                { TSHintAttributes.IMAGE_NOISE, 0 },
                { TSHintAttributes.MAX_NUMBER_OF_ATTEMPTS, 10000 },
                { IS_TARGET_MOVING, 0 }
            };

            TSProgression.Add(TSHints.Clone());
            TSProgression.Add(
                new TrainingSetHints {
                { TSHintAttributes.IS_VARIABLE_SIZE, 1 },
                { TSHintAttributes.IMAGE_NOISE, 1 },
                { IS_TARGET_MOVING, 1 }
            });
        }
コード例 #17
0
        public LTDetectDifference(SchoolWorld w)
            : base(w)
        {
            TSHints = new TrainingSetHints {
                { TSHintAttributes.IMAGE_NOISE, 0 },
                { TSHintAttributes.IS_VARIABLE_COLOR, 0 },
                { TSHintAttributes.IS_VARIABLE_SIZE, 0 },
                { TSHintAttributes.NUMBER_OBJECTS, 2 },
                { TSHintAttributes.MAX_NUMBER_OF_ATTEMPTS, 10000 }
            };

            TSProgression.Add(TSHints.Clone());
            TSProgression.Add(TSHintAttributes.IMAGE_NOISE, 1);
            TSProgression.Add(TSHintAttributes.NUMBER_OBJECTS, 4f);
            TSProgression.Add(TSHintAttributes.IS_VARIABLE_COLOR, 1f);
            TSProgression.Add(TSHintAttributes.NUMBER_OBJECTS, 8f);
            TSProgression.Add(TSHintAttributes.IS_VARIABLE_SIZE, 1f);
            TSProgression.Add(TSHintAttributes.NUMBER_OBJECTS, 10f);
        }
コード例 #18
0
        public LTSinglePixelTransducerRL(SchoolWorld w)
            : base(w)
        {
            m_symbolColor    = new Dictionary <int, int>();
            m_symbolColor[0] = 0; // action 0: white color
            m_symbolColor[1] = 1; // action 1: black color
            m_symbolColor[2] = 2; // action 3: gray color

            m_rnd = new Random();

            m_currentObject = null;

            TSHints = new TrainingSetHints {
                { TSHintAttributes.IS_VARIABLE_COLOR, 0 },
                { TSHintAttributes.MAX_NUMBER_OF_ATTEMPTS, 10000 }
            };

            TSProgression.Add(TSHints.Clone());
            //TSProgression.Add(TSHintAttributes.IS_VARIABLE_COLOR, 1);
        }
コード例 #19
0
        // Construct the learning task
        public LTHiddenTarget(SchoolWorld w)
            : base(w)
        {
            TSHints = new TrainingSetHints {
                { TSHintAttributes.IS_VARIABLE_SIZE, 0 },
                { NUMBER_OF_FALSE_TARGETS, 1 },
                { TSHintAttributes.IMAGE_NOISE, 0 },
                { TSHintAttributes.GIVE_PARTIAL_REWARDS, 1 },
                { TSHintAttributes.MAX_NUMBER_OF_ATTEMPTS, 10000 },
                { TSHintAttributes.IMAGE_TEXTURE_BACKGROUND, 0 },
            };

            TSProgression.Add(TSHints.Clone());
            TSProgression.Add(TSHintAttributes.IMAGE_NOISE, 1);
            TSProgression.Add(TSHintAttributes.IS_VARIABLE_SIZE, 1f);
            TSProgression.Add(NUMBER_OF_FALSE_TARGETS, 2);
            TSProgression.Add(NUMBER_OF_FALSE_TARGETS, 3);
            TSProgression.Add(TSHintAttributes.GIVE_PARTIAL_REWARDS, 0);
            TSProgression.Add(TSHintAttributes.IMAGE_TEXTURE_BACKGROUND, 1);
        }
コード例 #20
0
ファイル: LTApproach.cs プロジェクト: xeronith/BrainSimulator
        public LTApproach(SchoolWorld w)
            : base(w)
        {
            TSHints = new TrainingSetHints
            {
                { TSHintAttributes.IS_VARIABLE_SIZE, 0 },
                { TSHintAttributes.IMAGE_NOISE, 0 },
                { TSHintAttributes.DEGREES_OF_FREEDOM, 1 },
                { TSHintAttributes.GIVE_PARTIAL_REWARDS, 1 },
                { TSHintAttributes.IMAGE_TEXTURE_BACKGROUND, 1 },
            };

            TSHints.Add(DISTANCE_BONUS_COEFFICENT, 1);

            TSProgression.Add(TSHints.Clone());
            TSProgression.Add(TSHintAttributes.DEGREES_OF_FREEDOM, 2);
            TSProgression.Add(TSHintAttributes.IMAGE_NOISE, 1);
            TSProgression.Add(TSHintAttributes.IS_VARIABLE_SIZE, 1);
            TSProgression.Add(TSHintAttributes.GIVE_PARTIAL_REWARDS, 0);
            //TSProgression.Add(TSHintAttributes.IMAGE_TEXTURE_BACKGROUND, 1);
        }
コード例 #21
0
        public LTSimpleAngle(SchoolWorld w)
            : base(w)
        {
            TSHints = new TrainingSetHints {
                { TSHintAttributes.IS_VARIABLE_SIZE, 0 },
                { TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 0 },
                { TSHintAttributes.IS_VARIABLE_COLOR, 0 },
                { TSHintAttributes.IMAGE_NOISE, 0 },
                { ERROR_TOLERANCE, 0.2f },
                { FIXED_DISTANCE, 1 },
                { TSHintAttributes.MAX_NUMBER_OF_ATTEMPTS, 10000 }
            };

            TSProgression.Add(TSHints.Clone());
            TSProgression.Add(TSHintAttributes.IS_VARIABLE_COLOR, 1);
            TSProgression.Add(TSHintAttributes.IMAGE_NOISE, 1);
            TSProgression.Add(TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 1);
            TSProgression.Add(ERROR_TOLERANCE, 0.1f);
            TSProgression.Add(TSHintAttributes.IS_VARIABLE_SIZE, 1);
            TSProgression.Add(ERROR_TOLERANCE, 0.05f);
        }
コード例 #22
0
        public LTSimpleRhythm(SchoolWorld w)
            : base(w)
        {
            TSHints = new TrainingSetHints {
                { TSHintAttributes.IMAGE_NOISE, 0 },
                { RHYTHM_MAX_SIZE, 1 },
                { DELAY, 0 },
                { TSHintAttributes.IS_VARIABLE_POSITION, 0 },
                { TSHintAttributes.MAX_NUMBER_OF_ATTEMPTS, 10000 }
            };

            TSProgression.Add(TSHints.Clone());
            TSProgression.Add(DELAY, 1);
            TSProgression.Add(RHYTHM_MAX_SIZE, 2);
            TSProgression.Add(TSHintAttributes.IMAGE_NOISE, 1);
            TSProgression.Add(DELAY, 2);
            TSProgression.Add(TSHintAttributes.IS_VARIABLE_POSITION, 1);
            TSProgression.Add(RHYTHM_MAX_SIZE, 4);
            TSProgression.Add(RHYTHM_MAX_SIZE, 6);
            TSProgression.Add(RHYTHM_MAX_SIZE, 8);
        }
コード例 #23
0
        public LTPongWithBricks(SchoolWorld w)
            : base(w)
        {
            TSHints = new TrainingSetHints {
                { TSHintAttributes.IMAGE_NOISE, 0 },
                { TSHintAttributes.MAX_NUMBER_OF_ATTEMPTS, 10000 }
            };

            TSHints.Add(MAX_MISSES_ALLOWED, 1);
            TSHints.Add(BALL_HITS_NEEDED, 1);
            ballHitSum = 0f;
            ballHitSum = 0f;

            TSProgression.Add(TSHints.Clone());

            // TODO: modify Difficulty according also to current pong level
            TSProgression.Add(
                new TrainingSetHints {
                { MAX_MISSES_ALLOWED, 1 },
                { BALL_HITS_NEEDED, 1 }
            });

            TSProgression.Add(
                new TrainingSetHints {
                { MAX_MISSES_ALLOWED, 6 },
                { BALL_HITS_NEEDED, 10 }
            });

            TSProgression.Add(
                new TrainingSetHints {
                { MAX_MISSES_ALLOWED, 6 },
                { BALL_HITS_NEEDED, 20 }
            });

            TSProgression.Add(
                new TrainingSetHints {
                { MAX_MISSES_ALLOWED, 5 },
                { BALL_HITS_NEEDED, 30 }
            });
        }
コード例 #24
0
        public LTDetectShape(SchoolWorld w)
            : base(w)
        {
            TSHints = new TrainingSetHints {
                { TSHintAttributes.IMAGE_NOISE, 0 },
                { TSHintAttributes.IS_VARIABLE_COLOR, 0 },
                { TSHintAttributes.IS_VARIABLE_SIZE, 0 },
                { TSHintAttributes.IS_VARIABLE_POSITION, 0 },
                { TSHintAttributes.IS_VARIABLE_ROTATION, 0 },
                { TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 2 },
                { TSHintAttributes.MAX_NUMBER_OF_ATTEMPTS, 10000 }
            };

            TSProgression.Add(TSHints.Clone());
            TSProgression.Add(TSHintAttributes.IMAGE_NOISE, 1);
            TSProgression.Add(TSHintAttributes.IS_VARIABLE_POSITION, 1.0f);
            TSProgression.Add(TSHintAttributes.IS_VARIABLE_SIZE, 1.0f);
            TSProgression.Add(TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 4);
            TSProgression.Add(TSHintAttributes.IS_VARIABLE_COLOR, 1.0f);
            TSProgression.Add(TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 8);
            TSProgression.Add(TSHintAttributes.IS_VARIABLE_ROTATION, 1.0f);
        }
コード例 #25
0
        public LT2BackBinaryTest(SchoolWorld w)
            : base(w)
        {
            m_lastNShapes = new Shape[N_BACK + 1];

            TSHints = new TrainingSetHints {
                { TSHintAttributes.IMAGE_NOISE, 0 },
                { TSHintAttributes.IS_VARIABLE_COLOR, 0 },
                { TSHintAttributes.IS_VARIABLE_SIZE, 0 },
                { TSHintAttributes.IS_VARIABLE_POSITION, 0 },
                { TSHintAttributes.IS_VARIABLE_ROTATION, 0 },
                { TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 2 },
                { TSHintAttributes.MAX_NUMBER_OF_ATTEMPTS, 10000 }
            };

            TSProgression.Add(TSHints.Clone());
            TSProgression.Add(TSHintAttributes.IS_VARIABLE_COLOR, 1f);
            TSProgression.Add(TSHintAttributes.IMAGE_NOISE, 1f);
            TSProgression.Add(TSHintAttributes.IS_VARIABLE_SIZE, 1f);
            TSProgression.Add(TSHintAttributes.IS_VARIABLE_POSITION, 1f);
            TSProgression.Add(TSHintAttributes.IS_VARIABLE_ROTATION, 1f);
            //TSProgression.Add(TSHintAttributes.NUMBER_OF_DIFFERENT_OBJECTS, 3f);
        }
コード例 #26
0
        private void dataGridView1_SelectionChanged(object sender, EventArgs e)
        {
            Invoke((MethodInvoker)(() =>
            {
                LearningTaskNode ltNode = SelectedLearningTask;

                // if no selection, clear table and return
                if (ltNode == null)
                {
                    tabControlLevels.TabPages.Clear();
                    prevGridViewSelection = null;
                    return;
                }
                // if there is no change, do nothing
                if (ltNode.Equals(prevGridViewSelection))
                {
                    return;
                }
                prevGridViewSelection = ltNode;

                //
                // LT text hint
                //

                richTextBoxLTInfo.Clear();

                const string HTML_DIRECTORY = @"Resources\html";
                string htmlFileName = (ltNode as LearningTaskNode).TaskType.Name + ".html";
                string fullPath = MyResources.GetMyAssemblyPath() + "\\" + HTML_DIRECTORY + "\\" + htmlFileName;


                if (File.Exists(fullPath))
                {
                    // Create a file to write to.
                    string htmlPage = File.ReadAllText(fullPath);

                    string name = System.Text.RegularExpressions.Regex.Match(htmlPage, "<title>.*</title>").ToString();
                    if (name.Length > 0)
                    {
                        name = name.Split('>', '<')[2];
                    }
                    richTextBoxLTInfo.AppendText(name + "\r\n\r\n");
                    richTextBoxLTInfo.SelectAll();
                    richTextBoxLTInfo.SelectionFont = new Font(richTextBoxLTInfo.Font, FontStyle.Bold);

                    string description = System.Text.RegularExpressions.Regex.Match(htmlPage,
                                                                                    "Description(.*?)<td(.*?)</td>", System.Text.RegularExpressions.RegexOptions.Singleline).ToString();
                    if (description.Length > 0)
                    {
                        description = description.Split('>', '<')[4];
                    }
                    description = description.Replace(System.Environment.NewLine, "");
                    richTextBoxLTInfo.AppendText(description);
                }

                //
                // LVL tab
                //
                tabControlLevels.TabPages.Clear();

                Type ltType = ltNode.TaskType;
                ILearningTask lt = LearningTaskFactory.CreateLearningTask(ltType);
                TrainingSetHints hints = lt.TSProgression[0];

                Levels = new List <LevelNode>();
                LevelGrids = new List <DataGridView>();
                Attributes = new List <List <AttributeNode> >();
                AttributesChange = new List <List <int> >();

                for (int i = 0; i < lt.TSProgression.Count; i++)
                {
                    // create tab
                    LevelNode ln = new LevelNode(i + 1);
                    Levels.Add(ln);
                    TabPage tp = new TabPage(ln.Text);
                    tabControlLevels.TabPages.Add(tp);

                    // create grid
                    DataGridView dgv = new DataGridView();

                    dgv.Parent = tp;
                    dgv.Margin = new Padding(3);
                    dgv.Dock = DockStyle.Fill;
                    dgv.RowHeadersVisible = false;
                    dgv.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
                    dgv.AllowUserToResizeRows = false;
                    // create attributes
                    Attributes.Add(new List <AttributeNode>());
                    if (i > 0)
                    {
                        hints.Set(lt.TSProgression[i]);
                    }
                    foreach (var attribute in hints)
                    {
                        AttributeNode an = new AttributeNode(attribute.Key, attribute.Value);
                        Attributes[i].Add(an);
                        // create tooltips
                    }

                    Attributes[i].Sort(Comparer <AttributeNode> .Create((x, y) => x.Name.CompareTo(y.Name)));
                    dgv.DataSource = Attributes[i];

                    dgv.Columns[0].Width = 249;
                    dgv.Columns[0].ReadOnly = true;
                    dgv.Columns[1].ReadOnly = true;

                    AttributesChange.Add(new List <int>());
                    if (i > 0)
                    {
                        foreach (var attribute in lt.TSProgression[i])
                        {
                            int attributeIdx = Attributes[i].IndexOf(new AttributeNode(attribute.Key.Name));
                            AttributesChange[i].Add(attributeIdx);
                        }
                    }

                    LevelGrids.Add(dgv);
                    dgv.ColumnWidthChanged += levelGridColumnSizeChanged;
                    dgv.CellFormatting += levelGrid_CellFormatting;
                    dgv.SelectionChanged += levelGrid_SelectionChanged;
                    dgv.ClearSelection();

                    tabControlLevels.Update();
                }
            }
                                   ));
        }