Пример #1
0
  public BayesImWrapper(BayesPmWrapper bayesPmWrapper, BayesImParams params) {
    if (bayesPmWrapper == null) {
      throw new NullPointerException("BayesPmWrapper must not be null.");
    }

    if (params == null) {
      throw new NullPointerException("Params must not be null.");
    }

    BayesPm bayesPm = new BayesPm(bayesPmWrapper.getBayesPm());

    if (params.getInitializationMode() == BayesImParams.MANUAL_RETAIN) {
      this.bayesIm = new MlBayesIm(bayesPm);
    } else if (params.getInitializationMode() == BayesImParams.RANDOM_RETAIN) {
      this.bayesIm = new MlBayesIm(bayesPm, MlBayesIm.RANDOM);
    } else if (params.getInitializationMode() == BayesImParams.RANDOM_OVERWRITE) {
      this.bayesIm = new MlBayesIm(bayesPm, MlBayesIm.RANDOM);
    }
    log(bayesIm);
  }
Пример #2
0
 /**
  * Generates a simple exemplar of this class to test serialization.
  *
  * @see TetradSerializableUtils
  */
 public static BayesImWrapper serializableInstance() {
   return new BayesImWrapper(
       BayesPmWrapper.serializableInstance(), BayesImParams.serializableInstance());
 }