use of edu.cmu.tetrad.data.Knowledge2 in project tetrad by cmu-phil.
the class PcRunner method getMeekRules.
public ImpliedOrientation getMeekRules() {
MeekRules rules = new MeekRules();
rules.setAggressivelyPreventCycles(this.isAggressivelyPreventCycles());
rules.setKnowledge((IKnowledge) getParams().get("knowledge", new Knowledge2()));
return rules;
}
use of edu.cmu.tetrad.data.Knowledge2 in project tetrad by cmu-phil.
the class PcdRunner method execute.
// ===================PUBLIC METHODS OVERRIDING ABSTRACT================//
public void execute() {
IKnowledge knowledge = (IKnowledge) getParams().get("knowledge", new Knowledge2());
Parameters searchParams = getParams();
Parameters params = searchParams;
Pcd pc = new Pcd(getIndependenceTest());
pc.setKnowledge(knowledge);
pc.setDepth(params.getInt("depth", -1));
Graph graph;
try {
graph = pc.search();
} catch (UnsupportedOperationException e) {
e.printStackTrace();
JOptionPane.showMessageDialog(JOptionUtils.centeringComp(), "There was an error, probably because the " + "independence test doesn't support determinististic checks.");
return;
}
if (getSourceGraph() != null) {
GraphUtils.arrangeBySourceGraph(graph, getSourceGraph());
} else if (knowledge.isDefaultToKnowledgeLayout()) {
SearchGraphUtils.arrangeByKnowledgeTiers(graph, knowledge);
} else {
GraphUtils.circleLayout(graph, 200, 200, 150);
}
setResultGraph(graph);
}
use of edu.cmu.tetrad.data.Knowledge2 in project tetrad by cmu-phil.
the class SampleVcpcRunner method getMeekRules.
public ImpliedOrientation getMeekRules() {
MeekRules meekRules = new MeekRules();
meekRules.setAggressivelyPreventCycles(this.isAggressivelyPreventCycles());
meekRules.setKnowledge((IKnowledge) getParams().get("knowledge", new Knowledge2()));
return meekRules;
}
use of edu.cmu.tetrad.data.Knowledge2 in project tetrad by cmu-phil.
the class MbfsPatternRunner method execute.
// ===================PUBLIC METHODS OVERRIDING ABSTRACT================//
public void execute() {
IKnowledge knowledge = (IKnowledge) getParams().get("knowledge", new Knowledge2());
Mbfs search = new Mbfs(getIndependenceTest(), -1);
search.setDepth(getParams().getInt("depth", -1));
// search.setTrueGraph(trueGraph);
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);
}
use of edu.cmu.tetrad.data.Knowledge2 in project tetrad by cmu-phil.
the class PcLocalRunner method execute.
// ===================PUBLIC METHODS OVERRIDING ABSTRACT================//
public void execute() {
IKnowledge knowledge = (IKnowledge) getParams().get("knowledge", new Knowledge2());
IndependenceTest independenceTest = getIndependenceTest();
Parameters testParams = getParams();
PcLocal search = new PcLocal(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);
}
Aggregations