Search in sources :

Example 1 with SemUpdater

use of edu.cmu.tetrad.sem.SemUpdater in project tetrad by cmu-phil.

the class TestSemUpdater method testUpdate.

@Test
public void testUpdate() {
    Graph graph = constructGraph1();
    SemPm semPm = new SemPm(graph);
    SemIm semIm = new SemIm(semPm);
    List<Node> nodes = semIm.getVariableNodes();
    SemUpdater semUpdater = new SemUpdater(semIm);
    SemEvidence evidence = new SemEvidence(semIm);
    evidence.getProposition().setValue(nodes.get(4), 10.0);
    evidence.getProposition().setValue(nodes.get(2), 1.5);
    semUpdater.setEvidence(evidence);
    evidence.setManipulated(1, true);
    semUpdater.getManipulatedSemIm();
    semUpdater.getUpdatedSemIm();
}
Also used : SemUpdater(edu.cmu.tetrad.sem.SemUpdater) SemEvidence(edu.cmu.tetrad.sem.SemEvidence) EdgeListGraph(edu.cmu.tetrad.graph.EdgeListGraph) Graph(edu.cmu.tetrad.graph.Graph) GraphNode(edu.cmu.tetrad.graph.GraphNode) Node(edu.cmu.tetrad.graph.Node) SemPm(edu.cmu.tetrad.sem.SemPm) SemIm(edu.cmu.tetrad.sem.SemIm) Test(org.junit.Test)

Aggregations

EdgeListGraph (edu.cmu.tetrad.graph.EdgeListGraph)1 Graph (edu.cmu.tetrad.graph.Graph)1 GraphNode (edu.cmu.tetrad.graph.GraphNode)1 Node (edu.cmu.tetrad.graph.Node)1 SemEvidence (edu.cmu.tetrad.sem.SemEvidence)1 SemIm (edu.cmu.tetrad.sem.SemIm)1 SemPm (edu.cmu.tetrad.sem.SemPm)1 SemUpdater (edu.cmu.tetrad.sem.SemUpdater)1 Test (org.junit.Test)1