Exemplo n.º 1
0
 public TypedLearningPair(Type eventType, bool isTargetProcess)
 {
     EventType = eventType;
     EventNameSpacePower = Enum.GetValues(eventType).Length;
     input = new Input(EventNameSpacePower);
     output[0] = isTargetProcess ? 1 : 0;
     output[1] = isTargetProcess ? 0 : 1;
 }
Exemplo n.º 2
0
        private IDictionary<Type, Input> GetPairs(HistorySnapshot snapshot)
        {
            IDictionary<Type, Input> learningDict = new Dictionary<Type, Input>();
            foreach (IProcessAction action in snapshot.Events)
            {
                Type type = Significator.ToSignificantType(action.EventName);
                if (type == null)
                    continue;

                Input input;
                if (!learningDict.ContainsKey(type))
                {
                    input = new Input(Enum.GetValues(type).Length);
                    learningDict.Add(type, input);
                }
                else
                {
                    input = learningDict[type];
                }
                input.Modify(type, Significator.ToSignificant(action.EventName));
            }
            return learningDict;
        }