Skip to content

Commit

Permalink
Merge pull request #1800 from cmu-phil/joe_work_2024_6-13
Browse files Browse the repository at this point in the history
joe_work_2024_6-13
  • Loading branch information
jdramsey authored Aug 11, 2024
2 parents 1c5a45e + 56c421f commit 66f42ea
Show file tree
Hide file tree
Showing 207 changed files with 12,065 additions and 5,355 deletions.
9 changes: 2 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.13.0</version>
<configuration>
<source>17</source>
<target>17</target>
Expand Down Expand Up @@ -163,7 +163,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<version>3.2.4</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand Down Expand Up @@ -198,11 +198,6 @@
</properties>

<dependencies>
<!-- <dependency>-->
<!-- <groupId>org.slf4j</groupId>-->
<!-- <artifactId>slf4j-log4j12</artifactId>-->
<!-- <version>1.7.36</version>-->
<!-- </dependency>-->
<dependency> <!--For java annotations used by annotated algorithms-->
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
Expand Down
6 changes: 3 additions & 3 deletions tetrad-gui/dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.13.0</version>
<configuration>
<source>17</source>
<target>17</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.1</version>
<version>3.6.0</version>
<executions>
<execution>
<phase>package</phase>
Expand All @@ -68,7 +68,7 @@
</plugins>
</build>
<properties>
<java.version>1.8</java.version>
<java.version>17</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
6 changes: 3 additions & 3 deletions tetrad-gui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<version>3.13.0</version>
<configuration>
<source>17</source>
<target>17</target>
Expand All @@ -40,7 +40,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.1</version>
<version>3.6.0</version>
<executions>
<execution>
<phase>package</phase>
Expand Down Expand Up @@ -186,7 +186,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
<java.version>17</java.version>
</properties>

<!--<scm>-->
Expand Down
2 changes: 1 addition & 1 deletion tetrad-gui/src/main/java/edu/cmu/tetradapp/Tetrad.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public final class Tetrad implements PropertyChangeListener {
*/
private static final String EXP_OPT = "--experimental";
/**
* Whether to enable experimental features
* Whether to enable experimental featuresj
*/
public static boolean enableExperimental;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -821,67 +821,38 @@ private void showLogConfig(TetradLoggerConfig config) {
}

private void executeSessionNode(SessionNode sessionNode) {
SwingUtilities.invokeLater(() -> {
final Class c = SessionEditorWorkbench.class;
Container container = SwingUtilities.getAncestorOfClass(c,
SessionEditorNode.this);
SessionEditorWorkbench workbench
= (SessionEditorWorkbench) container;

System.out.println("Executing " + sessionNode);
new WatchedProcess() {
@Override
public void watch() {
final Class c = SessionEditorWorkbench.class;
Container container = SwingUtilities.getAncestorOfClass(c,
SessionEditorNode.this);
SessionEditorWorkbench workbench
= (SessionEditorWorkbench) container;

workbench.getSimulationStudy().execute(sessionNode, true);
});
System.out.println("Executing " + sessionNode);

// class MyWatchedProcess extends WatchedProcess {
// @Override
// public void watch() {
// final Class c = SessionEditorWorkbench.class;
// Container container = SwingUtilities.getAncestorOfClass(c,
// SessionEditorNode.this);
// SessionEditorWorkbench workbench
// = (SessionEditorWorkbench) container;
//
// System.out.println("Executing " + sessionNode);
//
// workbench.getSimulationStudy().execute(sessionNode, true);
// }
// }

// new MyWatchedProcess();
workbench.getSimulationStudy().execute(sessionNode, true);
}
};
}

private void createDescendantModels() {
SwingUtilities.invokeLater(() -> {
final Class clazz = SessionEditorWorkbench.class;
Container container = SwingUtilities.getAncestorOfClass(clazz,
SessionEditorNode.this);
SessionEditorWorkbench workbench
= (SessionEditorWorkbench) container;

if (workbench != null) {
workbench.getSimulationStudy().createDescendantModels(
getSessionNode(), true);
new WatchedProcess() {
@Override
public void watch() {
final Class clazz = SessionEditorWorkbench.class;
Container container = SwingUtilities.getAncestorOfClass(clazz,
SessionEditorNode.this);
SessionEditorWorkbench workbench
= (SessionEditorWorkbench) container;

if (workbench != null) {
workbench.getSimulationStudy().createDescendantModels(
getSessionNode(), true);
}
}
});
//
// class MyWatchedProcess extends WatchedProcess {
// @Override
// public void watch() {
// final Class clazz = SessionEditorWorkbench.class;
// Container container = SwingUtilities.getAncestorOfClass(clazz,
// SessionEditorNode.this);
// SessionEditorWorkbench workbench
// = (SessionEditorWorkbench) container;
//
// if (workbench != null) {
// workbench.getSimulationStudy().createDescendantModels(
// getSessionNode(), true);
// }
// }
// }
//
// new MyWatchedProcess();
};
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
import java.awt.datatransfer.ClipboardOwner;
import java.awt.datatransfer.Transferable;
import java.awt.event.ActionEvent;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;

/**
* Puts up a panel showing some graph properties, e.g., number of nodes and edges in the graph, etc.
Expand Down Expand Up @@ -102,7 +104,8 @@ public void watch() {
}

private void addTreks(Node node1, Node node2, Graph graph, JTextArea textArea) {
List<List<Node>> treks = graph.paths().allPaths(node1, node2, 8);
Set<List<Node>> _treks = graph.paths().allPaths(node1, node2, 8);
List<List<Node>> treks = new ArrayList<>(_treks);

if (treks.isEmpty()) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@

package edu.cmu.tetradapp.editor;

import edu.cmu.tetrad.data.Knowledge;
import edu.cmu.tetrad.graph.EdgeListGraph;
import edu.cmu.tetrad.graph.Graph;
import edu.cmu.tetrad.search.utils.DagSepsets;
import edu.cmu.tetrad.search.utils.FciOrient;
import edu.cmu.tetrad.search.utils.R0R4StrategyTestBased;
import edu.cmu.tetradapp.workbench.GraphWorkbench;

import javax.swing.*;
Expand Down Expand Up @@ -76,8 +77,8 @@ public void actionPerformed(ActionEvent e) {
}

Graph __g = new EdgeListGraph(graph);
FciOrient finalFciRules = new FciOrient(new DagSepsets(__g));
finalFciRules.zhangFinalOrientation(__g);
FciOrient finalFciRules = new FciOrient(R0R4StrategyTestBased.defaultConfiguration(graph, new Knowledge()));
finalFciRules.finalOrientation(__g);
workbench.setGraph(__g);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public void actionPerformed(ActionEvent e) {

graph = new EdgeListGraph(graph);
MeekRules meekRules = new MeekRules();
meekRules.setMeekPreventCycles(true);
meekRules.setRevertToUnshieldedColliders(false);
meekRules.orientImplied(graph);
workbench.setGraph(graph);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public class CheckGraphForMagAction extends AbstractAction {
*/
private final GraphWorkbench workbench;

/**
* Stores the result of the legal MAG check.
*/
private volatile GraphSearchUtils.LegalMagRet legalMag = null;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ public CheckGraphForPagAction(GraphWorkbench workbench) {
this.workbench = workbench;
}

/**
* The legal PAG result.
*/
private volatile GraphSearchUtils.LegalPagRet legalPag = null;

/**
Expand Down
13 changes: 9 additions & 4 deletions tetrad-gui/src/main/java/edu/cmu/tetradapp/editor/DagEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -490,11 +490,16 @@ private JMenu createGraphMenu() {
JMenuItem randomGraph = new JMenuItem("Random Graph");
graph.add(randomGraph);
graph.addSeparator();
randomGraph.setAccelerator(
KeyStroke.getKeyStroke(KeyEvent.VK_R, InputEvent.ALT_DOWN_MASK));

graph.add(new GraphPropertiesAction(this.workbench));
graph.add(new PathsAction(this.workbench, parameters));
graph.add(new UnderliningsAction(this.workbench));
graph.addSeparator();

JMenuItem graphProperties = new JMenuItem(new GraphPropertiesAction(getWorkbench()));
JMenuItem pathsAction = new JMenuItem(new PathsAction(getWorkbench(), parameters));
graphProperties.setAccelerator(
KeyStroke.getKeyStroke(KeyEvent.VK_G, InputEvent.ALT_DOWN_MASK));
pathsAction.setAccelerator(
KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.ALT_DOWN_MASK));

graph.add(GraphUtils.getHighlightMenu(this.workbench));
graph.add(GraphUtils.getCheckGraphMenu(this.workbench));
Expand Down
Loading

0 comments on commit 66f42ea

Please sign in to comment.