📄 demogng.java
字号:
epsiloniHCL_choice.select(0); epsiloniHCL_choice.show(); compute.e_f = epsilonfHCL_Af[0]; epsilonfHCL_choice.select(0); epsilonfHCL_choice.show(); compute.t_max = tmaxHCL_Af[0]; tmaxHCL_choice.select(0); tmaxHCL_choice.show(); // Gernerate some nodes for (i = 0; i < compute.maxNodes; i++) compute.addNode(d); } else if (arg.equals(ALGO_2)) { compute.algo = 2; // Set default values nodes_lbl.setText("Nodes:"); compute.l_i = lambdaiNG_Af[0]; lambdaiNG_choice.select(0); lambdaiNG_choice.show(); compute.l_f = lambdafNG_Af[0]; lambdafNG_choice.select(0); lambdafNG_choice.show(); compute.e_i = epsiloniNG_Af[0]; epsiloniNG_choice.select(0); epsiloniNG_choice.show(); compute.e_f = epsilonfNG_Af[0]; epsilonfNG_choice.select(0); epsilonfNG_choice.show(); compute.t_max = tmaxNG_Af[0]; tmaxNG_choice.select(0); tmaxNG_choice.show(); // Gernerate some nodes for (i = 0; i < compute.maxNodes; i++) compute.addNode(d); } else if (arg.equals(ALGO_3)) { compute.algo = 3; // Set default values nodes_lbl.setText("Nodes:"); compute.l_i = lambdaiCHL_Af[0]; lambdaiCHL_choice.select(0); lambdaiCHL_choice.show(); compute.l_f = lambdafCHL_Af[0]; lambdafCHL_choice.select(0); lambdafCHL_choice.show(); compute.e_i = epsiloniCHL_Af[0]; epsiloniCHL_choice.select(0); epsiloniCHL_choice.show(); compute.e_f = epsilonfCHL_Af[0]; epsilonfCHL_choice.select(0); epsilonfCHL_choice.show(); compute.t_max = tmaxCHL_Af[0]; tmaxCHL_choice.select(0); tmaxCHL_choice.show(); compute.delEdge_i = edgeiCHL_Ai[0]; edgeiCHL_choice.select(0); edgeiCHL_choice.show(); compute.delEdge_f = edgefCHL_Ai[0]; edgefCHL_choice.select(0); edgefCHL_choice.show(); // Gernerate some nodes for (i = 0; i < compute.maxNodes; i++) compute.addNode(d); } else if (arg.equals(ALGO_4)) { compute.algo = 4; // Set default values nodes_lbl.setText("Nodes:"); // Gernerate some nodes for (i = 0; i < compute.maxNodes; i++) compute.addNode(d); } else if (arg.equals(ALGO_5)) { compute.algo = 5; // Set default values compute.stepSize = stepSize_Ai[1]; stepSize_choice.select(1); stepSize_choice.show(); compute.maxNodes = nodes_Ai[5]; nodes_choice.select(5); nodes_choice.show(); compute.numDiscreteSignals = discreteNumSignalsLBG_Ai[0]; discreteNumSignalsLBG_choice.select(0); discreteNumSignalsLBG_choice.show(); compute.readyLBG_B = false; compute.LBG_U_B = LBG_U_cb.getState(); nodes_lbl.setText("Nodes:"); compute.errorBestLBG_U = Float.MAX_VALUE; // Initialize discrete signals compute.initDiscreteSignals(compute.distribution); // Gernerate some nodes int z = (int) (compute.numDiscreteSignals * Math.random()); for (i = 0; i < compute.maxNodes; i++) compute.addNode(compute.discreteSignalsX[(z+i)%compute.numDiscreteSignals], compute.discreteSignalsY[(z+i)%compute.numDiscreteSignals]); } else if (arg.equals(ALGO_6)) { compute.algo = 6; // Set default values compute.fineTuningB = false; compute.initGrid(2, 2, d); compute.maxNodes = nodes_Ai[0]; nodes_choice.select(0); nodes_choice.show(); nodes_lbl.setText("max. Nodes:"); compute.l_i = lambdagGG_Af[0]; lambdagGG_choice.select(0); lambdagGG_choice.show(); compute.l_f = lambdafGG_Af[0]; lambdafGG_choice.select(0); lambdafGG_choice.show(); compute.e_i = epsiloniGG_Af[0]; epsiloniGG_choice.select(0); epsiloniGG_choice.show(); compute.e_f = epsilonfGG_Af[0]; epsilonfGG_choice.select(0); epsilonfGG_choice.show(); compute.sigma = sigmaGG_Af[0]; sigmaGG_choice.select(0); sigmaGG_choice.show(); } else if (arg.equals(ALGO_7)) { compute.algo = 7; // Set default values compute.initGrid(sizeSOM_Ai[0][0], sizeSOM_Ai[0][1], d); nodes_lbl.disable(); nodes_choice.disable(); compute.e_i = epsiloniSOM_Af[0]; epsiloniSOM_choice.select(0); epsiloniSOM_choice.show(); compute.e_f = epsilonfSOM_Af[0]; epsilonfSOM_choice.select(0); epsilonfSOM_choice.show(); compute.sigma_i = sigmaiSOM_Af[0]; sigmaiSOM_choice.select(0); sigmaiSOM_choice.show(); compute.sigma_f = sigmafSOM_Af[0]; sigmafSOM_choice.select(0); sigmafSOM_choice.show(); compute.t_max = tmaxSOM_Af[0]; tmaxSOM_choice.select(0); tmaxSOM_choice.show(); } } // distribution else if (distrib_choice.equals(evt.target)) { if (compute.soundB) { play(getCodeBase(), "audio/drummer.au"); } compute.distribution = distrib_choice.getSelectedIndex(); // Initialize discrete signals compute.initDiscreteSignals(compute.distribution); compute.errorBestLBG_U = Float.MAX_VALUE; } // stepsize else if (stepSize_choice.equals(evt.target)) { compute.stepSize = stepSize_Ai[stepSize_choice.getSelectedIndex()]; } // machine speed else if (speed_choice.equals(evt.target)) { compute.speed = speed_Ai[speed_choice.getSelectedIndex()]; } // max. nodes else if (nodes_choice.equals(evt.target)) { compute.maxNodes = nodes_Ai[nodes_choice.getSelectedIndex()]; compute.fineTuningB = false; } // insert new node else if (newNodeGNG_choice.equals(evt.target)) { compute.NUM_NEW_NODE = newNodeGNG_Ai[newNodeGNG_choice.getSelectedIndex()]; } // max. edges else if (delEdgeGNG_choice.equals(evt.target)) { compute.MAX_EDGE_AGE = delEdgeGNG_Ai[delEdgeGNG_choice.getSelectedIndex()]; } // epsilon HCL else if (epsilonHCL_choice.equals(evt.target)) { compute.epsilon = epsilonHCL_Af[epsilonHCL_choice.getSelectedIndex()]; } // epsilon_i HCL else if (epsiloniHCL_choice.equals(evt.target)) { compute.e_i = epsiloniHCL_Af[epsiloniHCL_choice.getSelectedIndex()]; } // epsilon_f HCL else if (epsilonfHCL_choice.equals(evt.target)) { compute.e_f = epsilonfHCL_Af[epsilonfHCL_choice.getSelectedIndex()]; } // t_max HCL else if (tmaxHCL_choice.equals(evt.target)) { compute.t_max = tmaxHCL_Af[tmaxHCL_choice.getSelectedIndex()]; } // epsilon winner GNG else if (epsilonGNG1_choice.equals(evt.target)) { compute.epsilonGNG = epsilonGNG1_Af[epsilonGNG1_choice.getSelectedIndex()]; } // epsilon neighbors GNG else if (epsilonGNG2_choice.equals(evt.target)) { compute.epsilonGNG2 = epsilonGNG2_Af[epsilonGNG2_choice.getSelectedIndex()]; } // alpha GNG else if (alphaGNG_choice.equals(evt.target)) { compute.alphaGNG = alphaGNG_Af[alphaGNG_choice.getSelectedIndex()]; } // beta GNG else if (betaGNG_choice.equals(evt.target)) { compute.forgetFactor = 1.0f - betaGNG_Af[betaGNG_choice.getSelectedIndex()]; compute.forgetFactorUtility = 1.0f - betaGNG_Af[betaGNG_choice.getSelectedIndex()]; } // utility GNG else if (utilityGNG_choice.equals(evt.target)) { compute.utilityGNG = utilityGNG_Af[utilityGNG_choice.getSelectedIndex()]; } // lambda_i NG else if (lambdaiNG_choice.equals(evt.target)) { compute.l_i = lambdaiNG_Af[lambdaiNG_choice.getSelectedIndex()]; } // lambda_f NG else if (lambdafNG_choice.equals(evt.target)) { compute.l_f = lambdafNG_Af[lambdafNG_choice.getSelectedIndex()]; } // epsilon_i NG else if (epsiloniNG_choice.equals(evt.target)) { compute.e_i = epsiloniNG_Af[epsiloniNG_choice.getSelectedIndex()]; } // epsilon_f NG else if (epsilonfNG_choice.equals(evt.target)) { compute.e_f = epsilonfNG_Af[epsilonfNG_choice.getSelectedIndex()]; } // t_max NG else if (tmaxNG_choice.equals(evt.target)) { compute.t_max = tmaxNG_Af[tmaxNG_choice.getSelectedIndex()]; } // lambda_g GG else if (lambdagGG_choice.equals(evt.target)) { compute.l_i = lambdagGG_Af[lambdagGG_choice.getSelectedIndex()]; } // lambda_f GG else if (lambdafGG_choice.equals(evt.target)) { compute.l_f = lambdafGG_Af[lambdafGG_choice.getSelectedIndex()]; } // epsilon_i GG else if (epsiloniGG_choice.equals(evt.target)) { compute.e_i = epsiloniGG_Af[epsiloniGG_choice.getSelectedIndex()]; } // epsilon_f GG else if (epsilonfGG_choice.equals(evt.target)) { compute.e_f = epsilonfGG_Af[epsilonfGG_choice.getSelectedIndex()]; } // sigma GG else if (sigmaGG_choice.equals(evt.target)) { compute.sigma = sigmaGG_Af[sigmaGG_choice.getSelectedIndex()]; } // grid size SOM else if (sizeSOM_choice.equals(evt.target)) { sizeSOM_index = sizeSOM_choice.getSelectedIndex(); } // epsilon_i SOM else if (epsiloniSOM_choice.equals(evt.target)) { compute.e_i = epsiloniSOM_Af[epsiloniSOM_choice.getSelectedIndex()]; } // epsilon_f SOM else if (epsilonfSOM_choice.equals(evt.target)) { compute.e_f = epsilonfSOM_Af[epsilonfSOM_choice.getSelectedIndex()]; } // sigma_i SOM else if (sigmaiSOM_choice.equals(evt.target)) { compute.sigma_i = sigmaiSOM_Af[sigmaiSOM_choice.getSelectedIndex()]; } // sigma_f SOM else if (sigmafSOM_choice.equals(evt.target)) { compute.sigma_f = sigmafSOM_Af[sigmafSOM_choice.getSelectedIndex()]; } // t_max SOM else if (tmaxSOM_choice.equals(evt.target)) { compute.t_max = tmaxSOM_Af[tmaxSOM_choice.getSelectedIndex()]; } // lambda_i CHL else if (lambdaiCHL_choice.equals(evt.target)) { compute.l_i = lambdaiCHL_Af[lambdaiCHL_choice.getSelectedIndex()]; } // lambda_f CHL else if (lambdafCHL_choice.equals(evt.target)) { compute.l_f = lambdafCHL_Af[lambdafCHL_choice.getSelectedIndex()]; } // epsilon_i CHL else if (epsiloniCHL_choice.equals(evt.target)) { compute.e_i = epsiloniCHL_Af[epsiloniCHL_choice.getSelectedIndex()]; } // epsilon_f CHL else if (epsilonfCHL_choice.equals(evt.target)) { compute.e_f = epsilonfCHL_Af[epsilonfCHL_choice.getSelectedIndex()]; } // t_max CHL else if (tmaxCHL_choice.equals(evt.target)) { compute.t_max = tmaxCHL_Af[tmaxCHL_choice.getSelectedIndex()]; } // edge_i CHL else if (edgeiCHL_choice.equals(evt.target)) { compute.delEdge_i = edgeiCHL_Ai[edgeiCHL_choice.getSelectedIndex()]; } // edge_f CHL else if (edgefCHL_choice.equals(evt.target)) { compute.delEdge_f = edgefCHL_Ai[edgefCHL_choice.getSelectedIndex()]; } // numDiscreteSignals LBG else if (discreteNumSignalsLBG_choice.equals(evt.target)) { // Initialize discrete signals compute.initDiscreteSignals(compute.distribution); // Set number of discrete signals compute.numDiscreteSignals = discreteNumSignalsLBG_Ai[discreteNumSignalsLBG_choice.getSelectedIndex()]; compute.errorBestLBG_U = Float.MAX_VALUE; } return true; } return false; } public String[][] getParameterInfo() { String[][] info = { // Arrays of arrays of strings describing each parameter. {"algorithm\t\t", "The abbreviation of an algorithm (GNG, GNG-U, HCL, NG, NGwCHL, " + "CHL, LBG, LBG-U, GG, SOM)", "The starting algorithm"}, {"distribution\t", "The name of a distribution (Rectangle, Ring, Circle, UNI, " + "Small Spirals, Large Spirals, HiLo Density, Discrete, UNIT, " + "Move & Jump, Move, Jump, Right MouseB)", "The initial distribution"} }; return info; } /** * Where to find beta releases and additional information. */ static final String myHomepage = "http://www.neuroinformatik.ruhr-uni-bochum.de/ini/PEOPLE/loos"; public String getAppletInfo() { String versionInfo = "DemoGNG " + compute.DGNG_VERSION + ". Written by Hartmut S. Loos\n\nCopyright 1996-1998" + " under the terms of the GNU General Public License." + "\n\nFor updates look at " + myHomepage; return versionInfo; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -