Search in sources :

Example 6 with Knowledge2

use of edu.cmu.tetrad.data.Knowledge2 in project tetrad by cmu-phil.

the class LingamStructureRunner method getMeekRules.

public ImpliedOrientation getMeekRules() {
    MeekRules rules = new MeekRules();
    rules.setKnowledge((IKnowledge) getParams().get("knowledge", new Knowledge2()));
    return rules;
}
Also used : Knowledge2(edu.cmu.tetrad.data.Knowledge2) MeekRules(edu.cmu.tetrad.search.MeekRules)

Example 7 with Knowledge2

use of edu.cmu.tetrad.data.Knowledge2 in project tetrad by cmu-phil.

the class PcPatternRunner method execute.

// ===================PUBLIC METHODS OVERRIDING ABSTRACT================//
public void execute() {
    IKnowledge knowledge = (IKnowledge) getParams().get("knowledge", new Knowledge2());
    int depth = getParams().getInt("depth", -1);
    PcPattern pcSearch = new PcPattern(getIndependenceTest());
    pcSearch.setKnowledge(knowledge);
    pcSearch.setAggressivelyPreventCycles(isAggressivelyPreventCycles());
    pcSearch.setDepth(depth);
    Graph graph = pcSearch.search();
    if (getSourceGraph() != null) {
        GraphUtils.arrangeBySourceGraph(graph, getSourceGraph());
    } else if (knowledge.isDefaultToKnowledgeLayout()) {
        SearchGraphUtils.arrangeByKnowledgeTiers(graph, knowledge);
    } else {
        GraphUtils.circleLayout(graph, 200, 200, 150);
    }
    setResultGraph(graph);
}
Also used : IKnowledge(edu.cmu.tetrad.data.IKnowledge) Knowledge2(edu.cmu.tetrad.data.Knowledge2)

Example 8 with Knowledge2

use of edu.cmu.tetrad.data.Knowledge2 in project tetrad by cmu-phil.

the class PcStableMaxLocalRunner method execute.

// ===================PUBLIC METHODS OVERRIDING ABSTRACT================//
public void execute() {
    IKnowledge knowledge = (IKnowledge) getParams().get("knowledge", new Knowledge2());
    IndependenceTest independenceTest = getIndependenceTest();
    Parameters testParams = getParams();
    PcStableMaxLocal search = new PcStableMaxLocal(independenceTest);
    search.setAggressivelyPreventCycles(isAggressivelyPreventCycles());
    search.setKnowledge(knowledge);
    Graph graph = search.search();
    if (getSourceGraph() != null) {
        GraphUtils.arrangeBySourceGraph(graph, getSourceGraph());
    } else if (knowledge.isDefaultToKnowledgeLayout()) {
        SearchGraphUtils.arrangeByKnowledgeTiers(graph, knowledge);
    } else {
        GraphUtils.circleLayout(graph, 200, 200, 150);
    }
    setResultGraph(graph);
}
Also used : IKnowledge(edu.cmu.tetrad.data.IKnowledge) Parameters(edu.cmu.tetrad.util.Parameters) Knowledge2(edu.cmu.tetrad.data.Knowledge2)

Example 9 with Knowledge2

use of edu.cmu.tetrad.data.Knowledge2 in project tetrad by cmu-phil.

the class PcStableMaxLocalRunner method getMeekRules.

public ImpliedOrientation getMeekRules() {
    MeekRules rules = new MeekRules();
    rules.setAggressivelyPreventCycles(isAggressivelyPreventCycles());
    rules.setKnowledge((IKnowledge) getParams().get("knowledge", new Knowledge2()));
    return rules;
}
Also used : Knowledge2(edu.cmu.tetrad.data.Knowledge2)

Example 10 with Knowledge2

use of edu.cmu.tetrad.data.Knowledge2 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

Knowledge2 (edu.cmu.tetrad.data.Knowledge2)75 IKnowledge (edu.cmu.tetrad.data.IKnowledge)43 Parameters (edu.cmu.tetrad.util.Parameters)17 Graph (edu.cmu.tetrad.graph.Graph)13 GraphWorkbench (edu.cmu.tetradapp.workbench.GraphWorkbench)8 ArrayList (java.util.ArrayList)7 Test (org.junit.Test)5 DataSet (edu.cmu.tetrad.data.DataSet)4 EdgeListGraph (edu.cmu.tetrad.graph.EdgeListGraph)4 MeekRules (edu.cmu.tetrad.search.MeekRules)4 WatchedProcess (edu.cmu.tetradapp.util.WatchedProcess)4 CharArrayWriter (java.io.CharArrayWriter)4 PrintWriter (java.io.PrintWriter)4 ContinuousVariable (edu.cmu.tetrad.data.ContinuousVariable)3 Node (edu.cmu.tetrad.graph.Node)3 CovarianceMatrixOnTheFly (edu.cmu.tetrad.data.CovarianceMatrixOnTheFly)1 DataModel (edu.cmu.tetrad.data.DataModel)1 DataReader (edu.cmu.tetrad.data.DataReader)1 KnowledgeEdge (edu.cmu.tetrad.data.KnowledgeEdge)1 Edge (edu.cmu.tetrad.graph.Edge)1