Search in sources :

Example 1 with Cefs

use of edu.cmu.tetrad.search.Cefs in project tetrad by cmu-phil.

the class CeFanSearchRunner method execute.

// =================PUBLIC METHODS OVERRIDING ABSTRACT=================//
/**
 * Executes the algorithm, producing (at least) a result workbench. Must be
 * implemented in the extending class.
 */
public void execute() {
    int pcDepth = getParams().getInt("depth", -1);
    Cefs search = new Cefs(getIndependenceTest(), pcDepth);
    Parameters params = getParams();
    if (params instanceof Parameters) {
        search.setAggressivelyPreventCycles(params.getBoolean("aggressivelyPreventCycles", false));
    }
    String targetName = getParams().getString("targetName", null);
    Graph graph = search.search(targetName);
    setResultGraph(graph);
    if (getSourceGraph() != null) {
        GraphUtils.arrangeBySourceGraph(graph, getSourceGraph());
    } else if (((IKnowledge) getParams().get("knowledge", new Knowledge2())).isDefaultToKnowledgeLayout()) {
        SearchGraphUtils.arrangeByKnowledgeTiers(graph, (IKnowledge) getParams().get("knowledge", new Knowledge2()));
    } else {
        GraphUtils.circleLayout(graph, 200, 200, 150);
    }
}
Also used : Cefs(edu.cmu.tetrad.search.Cefs) IKnowledge(edu.cmu.tetrad.data.IKnowledge) Parameters(edu.cmu.tetrad.util.Parameters) Knowledge2(edu.cmu.tetrad.data.Knowledge2)

Aggregations

IKnowledge (edu.cmu.tetrad.data.IKnowledge)1 Knowledge2 (edu.cmu.tetrad.data.Knowledge2)1 Cefs (edu.cmu.tetrad.search.Cefs)1 Parameters (edu.cmu.tetrad.util.Parameters)1