コード例 #1
0
ファイル: frmMain.cs プロジェクト: BackupTheBerlios/pwmds
        private void create10TabPage()
        {
            List<int> neurons = new List<int>();
            neurons.Add(30);
            neurons.Add(3);
            neurons.Add(30);

            List<Network.Function> fun = new List<Network.Function>();
            fun.Add(new Network.Function(Network.Function.IDENTITY));
            fun.Add(new Network.Function(Network.Function.SIGM));
            fun.Add(new Network.Function(Network.Function.SIGM));

            Data.NetworkParam param = new Data.NetworkParam();
            param.Type = Data.NetworkParam.MDS;
            param.Neurons = neurons;
            param.LayerNumber = neurons.Count;
            param.Functions = fun;
            param.SolutionLayerNr = 2;

            //    //get netowrikParam
            //    //createNetowork
            //    //add Network to list
            try
            {
                int nr = mainANN.AddNetwork(param);
                NetPage page = new NetPage(this, nr, mainANN.InputData, mainANN.GetNetwork(nr));
                page.NetworkName = "30-3-30";
                this._tabControl.TabPages.Add(page);
                this._tabControl.SelectedTab = page;
            }
            catch (Exception)
            { }
        }
コード例 #2
0
ファイル: frmMain.cs プロジェクト: BackupTheBerlios/pwmds
        private void _mNewNetwork_Click(object sender, EventArgs e)
        {
            CreateNetwork createDialog = new CreateNetwork();

            if (createDialog.ShowDialog() == DialogResult.OK)
            {
                Data.NetworkParam param = new Data.NetworkParam();
                param.Type = createDialog.NetworkType;
                param.Neurons = createDialog.NeuronsInLayer;
                param.LayerNumber = createDialog.LayersNumber;
                param.Functions = createDialog.Functions;
                param.SolutionLayerNr = createDialog.SolutionLayerNr;

            //    //get netowrikParam
            //    //createNetowork
            //    //add Network to list
                try
                {
                    int nr = mainANN.AddNetwork(param);
                    NetPage page = new NetPage(this, nr, mainANN.InputData, mainANN.GetNetwork(nr) );
                    page.NetworkName = createDialog.NetworkName;
                    this._tabControl.TabPages.Add(page);
                    this._tabControl.SelectedTab = page;

                }
                catch (ArgumentNullException)
                {

                    MessageBox.Show("Creating new network failed.");
                }
                createDialog.Dispose();
            }
        }