示例#1
0
        public GraphForm(Hub h)
        {
            InitializeComponent();
            hub = h;
            max_value_num = 50;
            dot_size = 4;
            lei = new List<EventInfo>();

            foreach (int eid in hub.EventNums())
            {
                if (eid == 0)
                    continue;

                lei.Add(hub.GetEventInfo(eid));
            }

            foreach (EventInfo ei in lei)
            {
                comboBox1.Items.Add(new NumberedString(ei.name, ei.eid));
            }
            comboBox1.SelectedIndex = 0;

            this.GraphBox.Paint += new System.Windows.Forms.PaintEventHandler(this.GraphBox_Paint);

            timer = new Timer();
            timer.Tick += new EventHandler(timer_Tick);
            timer.Interval = 500; // in miliseconds
            timer.Start();
        }
示例#2
0
        public TradeForm()
        {
            InitializeComponent();
            h = new Hub();
            nosel = false;

            h.MakeUser("Kozak");
            h.SetMoney(1, 100000);

            h.MakeUser("Wojtek");
            h.SetMoney(2, 100000);

            h.MakeEvent(200000, "Finał", new string[] { "Borussia Dortmund", "(REMIS)", "Bayern Munchen" });
            h.MakeEvent(200000, "Konklawe", new string[] { "Bergoglio", "Scola", "Turkson", "Bertone", "Amato",
                "Bettori", "Ortega", "Inny kardynał"});
            h.MakeEvent(30000, "Egzotyczny", new string[] { "A", "B" });
            h.MakeEvent(300000, "Popularny", new string[] { "A", "B" });

             cha = new CourseHoldAgent();
            cha.uid = 1;
            cha.eid = 2;
            cha.cid = 4;
            cha.money = 700000;
            cha.tmin = 50;
            cha.tmax = 300;
            cha.reaction = 0.2;
            cha.h = h;
            cha.Run();
            cha.cref = 2.5;

            cha2 = new CourseHoldAgent();
            cha2.uid = 1;
            cha2.eid = 2;
            cha2.cid = 5;
            cha2.money = 200000;
            cha2.tmin = 50;
            cha2.tmax = 300;
            cha2.reaction = 0.2;
            cha2.h = h;
            cha2.Run();
            cha2.cref = 8.0;

            cha3 = new CourseHoldAgent();
            cha3.uid = 1;
            cha3.eid = 2;
            cha3.cid = 6;
            cha3.money = 200000;
            cha3.tmin = 50;
            cha3.tmax = 300;
            cha3.reaction = 0.2;
            cha3.h = h;
            cha3.Run();
            cha3.cref = 7.5;

            ReviseInfo();
            comboBox1.SelectedIndex = 0;
            listView1.Items[0].Selected = true;
        }
示例#3
0
        public ChangeUserMoney(Hub hh)
        {
            h = hh;
            InitializeComponent();

            foreach (int uid in h.UserNums())
            {
                if(uid != 0)
                    comboBox1.Items.Add(new NumberedString(h.GetUserInfo(uid).name, uid));
            }

            comboBox1.SelectedIndex = 0;
        }
示例#4
0
        public ModifyRisk(Hub hh)
        {
            InitializeComponent();

            h = hh;

            foreach (int eid in h.EventNums())
            {
                if (eid == 0)
                    continue;

                EventInfo ei = h.GetEventInfo(eid);
                comboBox1.Items.Add(new NumberedString(ei.name, ei.eid));
            }

            comboBox1.SelectedIndex = 0;
        }
示例#5
0
        public SolveEventForm(Hub h)
        {
            Hub = h;

            InitializeComponent();

            lei = new List<EventInfo>();

            foreach (int eid in Hub.EventNums())
            {
                if (eid == 0)
                    continue;

                lei.Add(Hub.GetEventInfo(eid));
            }

            foreach(EventInfo ei in lei)
            {
                comboBox1.Items.Add(new NumberedString(ei.name, ei.eid));
            }
            comboBox1.SelectedIndex = 0;
        }