Пример #1
0
 public AbstractAlgorithmRunner(
     Graph graph, Parameters params, KnowledgeBoxModel knowledgeBoxModel) {
   this(graph, params);
   if (knowledgeBoxModel != null) {
     getParams().set("knowledge", knowledgeBoxModel.getKnowledge());
   }
 }
Пример #2
0
  /**
   * Constructs a wrapper for the given DataWrapper. The DatWrapper must contain a DataSet that is
   * either a DataSet or a DataSet or a DataList containing either a DataSet or a DataSet as its
   * selected model.
   *
   * @param knowledgeBoxModel
   */
  public AbstractAlgorithmRunner(
      DataWrapper dataWrapper,
      Parameters params,
      KnowledgeBoxModel knowledgeBoxModel,
      IndependenceFactsModel facts) {
    if (dataWrapper == null) {
      throw new NullPointerException();
    }
    if (params == null) {
      throw new NullPointerException();
    }

    this.params = params;
    this.sourceGraph = dataWrapper.getSourceGraph();

    DataModel dataSource = getSelectedDataModel(dataWrapper);

    this.dataWrapper = dataWrapper;

    // temporary workaround to get the knowledge box to coexist with the dataWrapper's knowledge
    if (knowledgeBoxModel == null) {
      getParams().set("knowledge", dataWrapper.getKnowledge());
    } else {
      getParams().set("knowledge", knowledgeBoxModel.getKnowledge());
    }

    getParams().set("independenceFacts", facts.getFacts());
    List names = dataSource.getVariableNames();
    transferVarNamesToParams(names);
  }
Пример #3
0
  /**
   * Constructs a wrapper for the given DataWrapper. The DatWrapper must contain a DataSet that is
   * either a DataSet or a DataSet or a DataList containing either a DataSet or a DataSet as its
   * selected model.
   *
   * @param knowledgeBoxModel
   */
  public AbstractAlgorithmRunner(
      DataWrapper dataWrapper, Parameters params, KnowledgeBoxModel knowledgeBoxModel) {
    if (dataWrapper == null) {
      throw new NullPointerException();
    }
    if (params == null) {
      throw new NullPointerException();
    }

    this.params = params;
    this.sourceGraph = dataWrapper.getSourceGraph();

    DataModelList dataSource = dataWrapper.getDataModelList();

    //        if (dataSource instanceof ColtDataSet) {
    //            dataSource = new ColtDataSet((ColtDataSet) dataSource);
    //        }

    this.dataWrapper = dataWrapper;

    // temporary workaround to get the knowledge box to coexist with the dataWrapper's knowledge
    if (knowledgeBoxModel == null) {
      getParams().set("knowledge", dataWrapper.getKnowledge());
    } else {
      getParams().set("knowledge", knowledgeBoxModel.getKnowledge());
    }
    List names = dataSource.getVariableNames();
    transferVarNamesToParams(names);
  }
Пример #4
0
 public AbstractAlgorithmRunner(
     Parameters params, KnowledgeBoxModel knowledgeBoxModel, Graph... graphs) {
   this.graphs = Arrays.asList(graphs);
   this.params = params;
   if (knowledgeBoxModel != null) {
     getParams().set("knowledge", knowledgeBoxModel.getKnowledge());
   }
 }
Пример #5
0
 public AbstractAlgorithmRunner(
     Graph graph,
     Parameters params,
     KnowledgeBoxModel knowledgeBoxModel,
     IndependenceFacts facts) {
   this(graph, params);
   if (knowledgeBoxModel != null) {
     getParams().set("knowledge", knowledgeBoxModel.getKnowledge());
   }
   if (facts != null) {
     getParams().set("independenceFacts", facts);
   }
 }
Пример #6
0
  public AbstractAlgorithmRunner(
      IndependenceFactsModel model, Parameters params, KnowledgeBoxModel knowledgeBoxModel) {
    if (model == null) {
      throw new NullPointerException();
    }
    if (params == null) {
      throw new NullPointerException();
    }

    this.params = params;

    DataModel dataSource = model.getFacts();

    if (knowledgeBoxModel != null) {
      getParams().set("knowledge", knowledgeBoxModel.getKnowledge());
    }

    List names = dataSource.getVariableNames();
    transferVarNamesToParams(names);
    this.dataModel = dataSource;
  }