Esempio n. 1
0
        public void Init()
        {
            _u1 = new Dictionary <string, Dictionary <string, int> >();
            _u2 = new Dictionary <string, Dictionary <string, int> >();
            _x  = new StrategyArray(this, _u1);
            _y  = new StrategyArray(this, _u2);
            _x.AlterContainer = _y;
            _y.AlterContainer = _x;

            _isInitialized = true;

            OnInitialized(new EventArgs());
        }
Esempio n. 2
0
        public void Init(Situation[,] data)
        {
            int i, j;

            _u1 = new Dictionary <string, Dictionary <string, int> >();
            _u2 = new Dictionary <string, Dictionary <string, int> >();
            _x  = new StrategyArray(this, _u1);
            _y  = new StrategyArray(this, _u2);
            _x.AlterContainer = _y;
            _y.AlterContainer = _x;

            for (i = 0; i < data.GetLength(0); i++)
            {
                _x.AddWithoutRefresh("X" + (i + 1).ToString());
            }
            for (j = 0; j < data.GetLength(1); j++)
            {
                _y.AddWithoutRefresh("Y" + (j + 1).ToString());
            }

            RefreshStructure();

            for (i = 0; i < _x.Count; i++)
            {
                for (j = 0; j < _y.Count; j++)
                {
                    Situation s = new Situation(data[i, j][0], data[i, j][1]);

                    if (_f1 == Function.Min)
                    {
                        s[0] = -s[0];
                    }
                    if (_f2 == Function.Min)
                    {
                        s[1] = -s[1];
                    }

                    this[i, j] = s;
                }
            }

            _isInitialized = true;

            OnInitialized(new EventArgs());
        }
Esempio n. 3
0
 public Strategy(string name, StrategyArray alterContainer, Dictionary <string, Dictionary <string, int> > u)
 {
     _name           = name;
     _alterContainer = alterContainer;
     _u = u;
 }