Search in sources :

Example 31 with Knowledge2

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

the class MbfsPatternRunner method getMeekRules.

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

Example 32 with Knowledge2

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

the class SampleVcpcRunner method execute.

// ===================PUBLIC METHODS OVERRIDING ABSTRACT================//
public void execute() {
    IKnowledge knowledge = (IKnowledge) getParams().get("knowledge", new Knowledge2());
    Parameters searchParams = getParams();
    Parameters params = searchParams;
    SampleVcpc svcpc = new SampleVcpc(getIndependenceTest());
    svcpc.setKnowledge(knowledge);
    svcpc.setAggressivelyPreventCycles(this.isAggressivelyPreventCycles());
    svcpc.setDepth(params.getInt("depth", -1));
    if (independenceFactsModel != null) {
        svcpc.setFacts(independenceFactsModel.getFacts());
    }
    // vcpc.setSemPm(semPm);
    // 
    // if (semPm != null) {
    // vcpc.setSemPm(getSemPm());
    // }
    svcpc.setSemIm(semIm);
    if (semIm != null) {
        svcpc.setSemIm(this.semIm);
    }
    Graph graph = svcpc.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);
    setSvcpcFields(svcpc);
}
Also used : IKnowledge(edu.cmu.tetrad.data.IKnowledge) Parameters(edu.cmu.tetrad.util.Parameters) Knowledge2(edu.cmu.tetrad.data.Knowledge2)

Example 33 with Knowledge2

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

the class DataAlgorithmRunner method execute.

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

Example 34 with Knowledge2

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

the class LofsSearchEditor method layoutByKnowledge.

public void layoutByKnowledge() {
    GraphWorkbench resultWorkbench = getWorkbench();
    Graph graph = resultWorkbench.getGraph();
    IKnowledge knowledge = (IKnowledge) getAlgorithmRunner().getParams().get("knowledge", new Knowledge2());
    SearchGraphUtils.arrangeByKnowledgeTiers(graph, knowledge);
// resultWorkbench.setGraph(graph);
}
Also used : IKnowledge(edu.cmu.tetrad.data.IKnowledge) GraphWorkbench(edu.cmu.tetradapp.workbench.GraphWorkbench) Knowledge2(edu.cmu.tetrad.data.Knowledge2)

Example 35 with Knowledge2

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

the class LofsSearchEditorNew method layoutByKnowledge.

public void layoutByKnowledge() {
    GraphWorkbench resultWorkbench = getWorkbench();
    Graph graph = resultWorkbench.getGraph();
    IKnowledge knowledge = (IKnowledge) getAlgorithmRunner().getParams().get("knowledge", new Knowledge2());
    SearchGraphUtils.arrangeByKnowledgeTiers(graph, knowledge);
// resultWorkbench.setGraph(graph);
}
Also used : IKnowledge(edu.cmu.tetrad.data.IKnowledge) GraphWorkbench(edu.cmu.tetradapp.workbench.GraphWorkbench) 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