Exemplo n.º 1
0
        public override void Open(object o, QState initialState)
        {
            QValues.Clear();
            ClearLearningTable();

            foreach (KeyValuePair <object[], decimal> kv in ((Dictionary <object[], decimal>)o))
            {
                QValues.Add(new QStateActionPair(initialState.Open(kv.Key[0]), (QAction)kv.Key[1]), kv.Value);
            }

            int i = 1;

            foreach (KeyValuePair <QStateActionPair, decimal> kv in QValues)
            {
                UpdateLearningTable(i++, kv.Key.state, kv.Key.action, kv.Value);
            }
        }
Exemplo n.º 2
0
        public override void Open(object o, QState initialState)
        {
            QValues.Clear();
            ClearLearningTable();

            foreach (KeyValuePair<object[], decimal> kv in ((Dictionary<object[], decimal>)o))
            {
                QValues.Add(new QStateActionPair(initialState.Open(kv.Key[0]), (QAction)kv.Key[1]), kv.Value);
            }
            
            int i=1;
            foreach (KeyValuePair<QStateActionPair, decimal> kv in QValues)
            {
                UpdateLearningTable(i++, kv.Key.state, kv.Key.action, kv.Value);
            }
        }