Package unbbayes.util.extension.bn.inference

Examples of unbbayes.util.extension.bn.inference.InferenceAlgorithmOptionPanel


//                    } else if (gaussianMixtureAlgorithm.isSelected()) {
//                      controller.setInferenceAlgorithm(InferenceAlgorithmEnum.GAUSSIAN_MIXTURE);
//                    }
                   
                    // commit changes (made at each option panel) on inference algorithm
                    InferenceAlgorithmOptionPanel currentPanel = getSelectedAlgorithmOptionPanel();
                    if (currentPanel != null) {
                      currentPanel.commitChanges();
                     
                      // updating the inference algorithm referenced by controller
                        controller.setInferenceAlgorithm(currentPanel.getInferenceAlgorithm());
                    }
                   
                    setVisible(false);
                    dispose();
                    graph.update();
                }
            });

    restore = new JButton(resource.getString("resetLabel"));
    restore.setToolTipText(resource.getString("resetToolTip"));
        confirmationPanel.add(restore);
        restore.addActionListener(
            new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    probabilisticDescriptionNodeColor = ProbabilisticNode.getDescriptionColor();
                    probabilisticExplanationNodeColor = ProbabilisticNode.getExplanationColor();
                    //by young
                    /*
          decisionNodeColor = DecisionNode.getColor();
          utilityNodeColor = UtilityNode.getColor();
                    edgeColor = Edge.getColor();
                    selectionColor = GraphPane.getSelectionColor();
                    backgroundColor = graph.getBackgroundColor();
                    netSlider.setValue((int) graph.getGraphDimension().getWidth());
                    radiusSlider.setValue((int)Node.getWidth()/2);
                    */
                    //by young end
                   
                    // reverting changes on algorithm plugins
                    InferenceAlgorithmOptionPanel selectedAlgorithmOptionPanel = getSelectedAlgorithmOptionPanel();
                    if (selectedAlgorithmOptionPanel != null) {
                      selectedAlgorithmOptionPanel.revertChanges();
                    }
                   
                    controller.getSingleEntityNetwork().setCreateLog(createLogBoolean);
                    repaint();
                }
            });

    cancel = new JButton(resource.getString("cancelLabel"));
    cancel.setToolTipText(resource.getString("cancelToolTip"));
        confirmationPanel.add(cancel);
        cancel.addActionListener(
            new ActionListener() {
                public void actionPerformed(ActionEvent e) {

                  // reverting changes on algorithm plugins
                    InferenceAlgorithmOptionPanel selectedAlgorithmOptionPanel = getSelectedAlgorithmOptionPanel();
                    if (selectedAlgorithmOptionPanel != null) {
                      selectedAlgorithmOptionPanel.revertChanges();
                    }
                   
                    setVisible(false);
                    dispose();
                    graph.update();
View Full Code Here


            ClassLoader classLoader = this.getPluginManager().getPluginClassLoader(descr);
                  Class pluginClass = null// class for the plugin (InferenceAlgorithmOptionPanel)
                  pluginClass = classLoader.loadClass(classParam.valueAsString());
           
                  // intantiating plugin object
              InferenceAlgorithmOptionPanel algorithmOptionPanel = null;
              algorithmOptionPanel = (InferenceAlgorithmOptionPanel)pluginClass.newInstance();
             
            // creating the radio buttons
              // we assume algorithm equality as class equality (if 2 algorithms uses the same class, we assume they are the same algorithm)
            JRadioButtonMenuItem radio =  new JRadioButtonMenuItem(algorithmOptionPanel.getInferenceAlgorithm().getName(),
                (controller.getInferenceAlgorithm()!= null) && (controller.getInferenceAlgorithm().getClass().equals(algorithmOptionPanel.getInferenceAlgorithm().getClass())));
            radio.setToolTipText(algorithmOptionPanel.getInferenceAlgorithm().getDescription());
           
           
            // filling the return
            ret.put(radio, algorithmOptionPanel);
          } catch (Throwable e) {
View Full Code Here

     */
  protected Map<JRadioButtonMenuItem, InferenceAlgorithmOptionPanel> getDefaultAlgorithms() {
   
    Map<JRadioButtonMenuItem, InferenceAlgorithmOptionPanel> ret = new HashMap<JRadioButtonMenuItem, InferenceAlgorithmOptionPanel>();
    JRadioButtonMenuItem radio = null// key of the map
    InferenceAlgorithmOptionPanel algorithmOptionPanel = null// the mapped object
   
    // we assume algorithm equality as class equality (if 2 algorithms uses the same class, we assume they are the same algorithm)
     
      // junction tree
      algorithmOptionPanel = new JunctionTreeOptionPanel();
      radio = new JRadioButtonMenuItem(algorithmOptionPanel.getInferenceAlgorithm().getName(),
        (controller.getInferenceAlgorithm()!= null) && (controller.getInferenceAlgorithm().getClass().equals(algorithmOptionPanel.getInferenceAlgorithm().getClass())));
    radio.setToolTipText(algorithmOptionPanel.getInferenceAlgorithm().getDescription());
    ret.put(radio, algorithmOptionPanel);

      // likelihood weighting
//      algorithmOptionPanel = new LikelihoodWeightingOptionPanel();
//      radio = new JRadioButtonMenuItem(algorithmOptionPanel.getInferenceAlgorithm().getName(),
//        (controller.getInferenceAlgorithm()!= null) && (controller.getInferenceAlgorithm().getClass().equals(algorithmOptionPanel.getInferenceAlgorithm().getClass())));
//    radio.setToolTipText(algorithmOptionPanel.getInferenceAlgorithm().getDescription());
//    ret.put(radio, algorithmOptionPanel);
     
      // gibbs
//      algorithmOptionPanel = new GibbsSamplingOptionPanel();
//      radio = new JRadioButtonMenuItem(algorithmOptionPanel.getInferenceAlgorithm().getName(),
//        (controller.getInferenceAlgorithm()!= null) && (controller.getInferenceAlgorithm().getClass().equals(algorithmOptionPanel.getInferenceAlgorithm().getClass())));
//    radio.setToolTipText(algorithmOptionPanel.getInferenceAlgorithm().getDescription());
//    ret.put(radio, algorithmOptionPanel);
     
        // gaussian mixture algorithm
      algorithmOptionPanel = new GaussianMixtureOptionPanel();
      radio = new JRadioButtonMenuItem(algorithmOptionPanel.getInferenceAlgorithm().getName(),
        (controller.getInferenceAlgorithm()!= null) && (controller.getInferenceAlgorithm().getClass().equals(algorithmOptionPanel.getInferenceAlgorithm().getClass())));
    radio.setToolTipText(algorithmOptionPanel.getInferenceAlgorithm().getDescription());
    ret.put(radio, algorithmOptionPanel);
       
    return ret;
  }
View Full Code Here

TOP

Related Classes of unbbayes.util.extension.bn.inference.InferenceAlgorithmOptionPanel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.