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); }
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(); }
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); }
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); }
// 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); }
public void SetHints(TrainingSetHints trainingSetHints) { foreach (var kvp in trainingSetHints) { CurrentWorld.SetHint(kvp.Key, kvp.Value); } }
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 } }); }
public LTDebugging(SchoolWorld w) : base(w) { TSHints = new TrainingSetHints { { TSHintAttributes.IMAGE_NOISE, 0 }, { TSHintAttributes.MAX_NUMBER_OF_ATTEMPTS, 10000 } }; TSProgression.Add(TSHints.Clone()); }
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()); }
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); }
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); }
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; }
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); }
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); }
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); }
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 } }); }
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); }
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); }
// 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); }
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); }
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); }
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); }
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 } }); }
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); }
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); }
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(); } } )); }