use of com.sri.ai.praise.core.representation.interfacebased.factor.core.table.TableFactor in project aic-praise by aic-sri-international.
the class TableFactorTest method testMultiplicationf2f1.
@Test
public void testMultiplicationf2f1() {
println();
println("MULTIPLYING f2 * f1");
println("-------------------");
TableFactor f2f1 = (TableFactor) f2.multiply(f1);
f2f1.setName("f2f1");
println(f2f1);
assertEquals("phi[{V2:card=3}, {V4:card=2}, {V1:card=2}, {V3:card=4}]: [11.0, 11.0, 11.0, 11.0, 11.0, 11.0, 11.0, 11.0, " + "12.0, 12.0, 12.0, 12.0, 12.0, 12.0, 12.0, 12.0, " + "21.0, 21.0, 21.0, 21.0, 21.0, 21.0, 21.0, 21.0, " + "22.0, 22.0, 22.0, 22.0, 22.0, 22.0, 22.0, 22.0, " + "31.0, 31.0, 31.0, 31.0, 31.0, 31.0, 31.0, 31.0, " + "32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0, 32.0]", f2.multiply(f1).toString());
println();
}
use of com.sri.ai.praise.core.representation.interfacebased.factor.core.table.TableFactor in project aic-praise by aic-sri-international.
the class TableFactorTest method testf1SumOutV1V3.
@Test
public void testf1SumOutV1V3() {
println();
println("SUM OUT V1 and V3 from F1");
println("-------------------------");
ArrayList<TableVariable> variablesToSumOut = Util.arrayList(V1, V3);
TableFactor f1SumOutV1V3 = (TableFactor) f1.sumOut(variablesToSumOut);
f1SumOutV1V3.setName("f1SumOutV1V3");
println(f1SumOutV1V3);
assertEquals("f1SumOutV1V3[{V2:card=3}]: [8.0, 8.0, 8.0]", f1SumOutV1V3.toString());
println();
}
use of com.sri.ai.praise.core.representation.interfacebased.factor.core.table.TableFactor in project aic-praise by aic-sri-international.
the class TableFactorTest method testf1SumOutV2V3.
@Test
public void testf1SumOutV2V3() {
println();
println("SUM OUT V2 and V3 from F1");
println("-------------------------");
ArrayList<TableVariable> variablesToSumOut = Util.arrayList(V2, V3);
TableFactor f1SumOutV2V3 = (TableFactor) f1.sumOut(variablesToSumOut);
f1SumOutV2V3.setName("f1SumOutV2V3");
println(f1SumOutV2V3);
assertEquals("f1SumOutV2V3[{V1:card=2}]: [12.0, 12.0]", f1SumOutV2V3.toString());
println();
}
use of com.sri.ai.praise.core.representation.interfacebased.factor.core.table.TableFactor in project aic-praise by aic-sri-international.
the class TableFactorTest method testf1SumOutV3.
@Test
public void testf1SumOutV3() {
println();
println("SUM OUT V3 from F1");
println("------------------");
ArrayList<TableVariable> variablesToSumOut = Util.arrayList(V3);
TableFactor f1SumOutV3 = (TableFactor) f1.sumOut(variablesToSumOut);
f1SumOutV3.setName("f1SumOutV3");
println(f1SumOutV3);
assertEquals("f1SumOutV3[{V1:card=2}, {V2:card=3}]: [4.0, 4.0, 4.0, 4.0, 4.0, 4.0]", f1SumOutV3.toString());
println();
}
use of com.sri.ai.praise.core.representation.interfacebased.factor.core.table.TableFactor in project aic-praise by aic-sri-international.
the class TableFactorTest method testf1SumOutV2.
@Test
public void testf1SumOutV2() {
println();
println("SUM OUT V2 from F1");
println("------------------");
ArrayList<TableVariable> variablesToSumOut = Util.arrayList(V2);
TableFactor f1SumOutV2 = (TableFactor) f1.sumOut(variablesToSumOut);
f1SumOutV2.setName("f1SumOutV2");
println(f1SumOutV2);
assertEquals("f1SumOutV2[{V1:card=2}, {V3:card=4}]: [3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0]", f1SumOutV2.toString());
println();
}
Aggregations