use of edu.cmu.tetrad.search.IonJoeModifications in project tetrad by cmu-phil.
the class IonRunner 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() {
System.out.println("Executing.");
IonJoeModifications ion = new IonJoeModifications(getGraphs());
ion.setAdjacencySearch(getParams().getBoolean("pruneByAdjacencies", true));
ion.setPathLengthSearch(getParams().getBoolean("pruneByPathLength", true));
ion.setKnowledge((IKnowledge) getParams().get("knowledge", new Knowledge2()));
List<Graph> graphs = ion.search();
Collections.sort(graphs, new Comparator<Graph>() {
public int compare(Graph graph, Graph graph1) {
return graph.getNumEdges() - graph1.getNumEdges();
}
});
if (graphs == null) {
throw new NullPointerException();
}
if (!graphs.isEmpty()) {
setResultGraph(graphs.get(0));
}
System.out.println("graphs = " + graphs);
getParams().set("graphIndex", 0);
this.graphs = graphs;
}
Aggregations