예제 #1
0
 /// <summary>
 /// 매개변수로 전달받은 SIMONObject 독립된 객체에 관한 학습 동작을 수행합니다.
 /// </summary>
 /// <param name="sObject">학습을 진행시킬 SIMONObject 단일객체.</param>
 public void TeachObject(SIMONObject sObject)
 {
     SIMONCollection subCollection = new SIMONCollection();
     subCollection.Add(sObject.ObjectID, sObject);
     SIMONCollection subActionMap = CreateActionMap(subCollection);
     IntelligenceManager.Learn(subCollection, subActionMap, SimonFunctions);
     IntelligenceManager.LearnProperty(subCollection, SimonFunctions);
 }
예제 #2
0
 /// <summary>
 /// 그룹에 대한 ActionMap을 구현합니다.
 /// </summary>
 /// <param name="group">ActionMap을 구조할 group입니다.</param>
 /// <returns>만들어진 ActionMap SIMONCollection을 반환합니다.</returns>
 private SIMONCollection CreateActionMap(SIMONCollection group)
 {
     SIMONCollection actionMap = new SIMONCollection();
     for (int i = 0; i < group.Count; i++)
     {
         SIMONObject element = (SIMONObject)group.ValueOfIndex(i);
         for (int j = 0; j < element.Actions.Count; j++)
         {
             if (!actionMap.Contains(element.Actions[j].ActionName))
             {
                 actionMap.Add(element.Actions[j].ActionName, new List<SIMONObject>());
             }
             DictionaryEntry val = (DictionaryEntry)actionMap[element.Actions[j].ActionName];
             var mapElement = val.Value;
             ((List<SIMONObject>)mapElement).Add(element);
             actionMap[element.Actions[j].ActionName] = mapElement;
         }
     }
     return actionMap;
 }