Package edu.cmu.cs.fusion.test

Examples of edu.cmu.cs.fusion.test.TestEnvironment


  @Test
  public void testTruthNotFalse() {
    RelationshipPredicate pred = new RelationshipPredicate(utils.getRelation(0), new SpecVar[] {utils.getVar(0), utils.getVar(2)});
    pred.setPositive(false);
    FusionEnvironment env = new TestEnvironment(utils.getContext(0), Variant.SOUND_VARIANT);
   
    assertEquals(ThreeValue.TRUE, pred.getTruth(env, utils.getSub(0)));
  }
View Full Code Here


  @Test
  public void testTruthNotTrue() {
    RelationshipPredicate pred = new RelationshipPredicate(utils.getRelation(0), new SpecVar[] {utils.getVar(0), utils.getVar(1)});
    pred.setPositive(false);
    FusionEnvironment env = new TestEnvironment(utils.getContext(0), Variant.SOUND_VARIANT);
   
    assertEquals(ThreeValue.FALSE, pred.getTruth(env, utils.getSub(0)));
  }
View Full Code Here

  @Test
  public void testTruthNotUnknownNoInference() {
    RelationshipPredicate pred = new RelationshipPredicate(utils.getRelation(1), new SpecVar[] {utils.getVar(2), utils.getVar(1)});
    pred.setPositive(false);
    FusionEnvironment env = new TestEnvironment(utils.getContext(0), Variant.SOUND_VARIANT);
   
    assertEquals(ThreeValue.UNKNOWN, pred.getTruth(env, utils.getSub(0)));
  }
View Full Code Here

  }
 
  @Test
  public void testMakeEffectsAdd() {
    Effect eff = RelEffect.createAddEffect(utils.getRelation(0), new SpecVar[] {utils.getVar(0), utils.getVar(1)});
    TestEnvironment env = new TestEnvironment(utils.getContext(0), Variant.SOUND_VARIANT);
   
    RelationshipDelta delta = eff.makeEffects(env, utils.getSub(0));
    ObjectLabel[] labels = new ObjectLabel[] {utils.getSub(0).getSub(utils.getVar(0)), utils.getSub(0).getSub(utils.getVar(1))};
    SevenPointLattice val = delta.getValue(new Relationship(utils.getRelation(0), labels));
    assertEquals(SevenPointLattice.TRU, val);
View Full Code Here

  }
 
  @Test
  public void testMakeEffectsRemove() {
    Effect eff = RelEffect.createRemoveEffect(utils.getRelation(0), new SpecVar[] {utils.getVar(0), utils.getVar(1)});
    TestEnvironment env = new TestEnvironment(utils.getContext(0), Variant.SOUND_VARIANT);
   
    RelationshipDelta delta = eff.makeEffects(env, utils.getSub(0));
    ObjectLabel[] labels = new ObjectLabel[] {utils.getSub(0).getSub(utils.getVar(0)), utils.getSub(0).getSub(utils.getVar(1))};
    SevenPointLattice val = delta.getValue(new Relationship(utils.getRelation(0), labels));
    assertEquals(SevenPointLattice.FAL, val);
View Full Code Here

 
  @Test
  public void testMakeEffectsTestTrue() {
    Effect eff = RelEffect.createTestEffect(utils.getRelation(0), new SpecVar[] {utils.getVar(0), utils.getVar(1)}, utils.getVar(2));
    Map<ObjectLabel, ThreeValue> map = new HashMap<ObjectLabel, ThreeValue>();
    TestEnvironment env = new TestEnvironment(utils.getContext(0), map, Variant.SOUND_VARIANT);
   
    map.put(utils.getSub(0).getSub(utils.getVar(2)), ThreeValue.TRUE);
   
    RelationshipDelta delta = eff.makeEffects(env, utils.getSub(0));
    ObjectLabel[] labels = new ObjectLabel[] {utils.getSub(0).getSub(utils.getVar(0)), utils.getSub(0).getSub(utils.getVar(1))};
View Full Code Here

  public void testFalse() throws FusionException {
    RelationshipDelta startRels = new RelationshipDelta();
    startRels.setRelationship(new Relationship(utils.getRelation(0), new ObjectLabel[]{utils.getLabel(0), utils.getLabel(2)}), SevenPointLattice.FAL);
    RelationshipContext rels = new RelationshipContext(false).applyChangesFromDelta(startRels);
   
    Pair<RelationshipDelta, Substitution> deltas = runFullyBound(new TestEnvironment(rels, variant), utils.getSub(1), cons);

    assertEquals(0, deltas.fst().numberOfChanges());
    assertFalse(checkFullyBound(new TestEnvironment(rels, variant), utils.getSub(1), cons));
  }
View Full Code Here

 
  @Test
  public void testMakeEffectsTestFalse() {
    Effect eff = RelEffect.createTestEffect(utils.getRelation(0), new SpecVar[] {utils.getVar(0), utils.getVar(1)}, utils.getVar(2));
    Map<ObjectLabel, ThreeValue> map = new HashMap<ObjectLabel, ThreeValue>();
    TestEnvironment env = new TestEnvironment(utils.getContext(0), map, Variant.SOUND_VARIANT);
   
    map.put(utils.getSub(0).getSub(utils.getVar(2)), ThreeValue.FALSE);
   
    RelationshipDelta delta = eff.makeEffects(env, utils.getSub(0));
    ObjectLabel[] labels = new ObjectLabel[] {utils.getSub(0).getSub(utils.getVar(0)), utils.getSub(0).getSub(utils.getVar(1))};
View Full Code Here

 
  @Test
  public void testMakeEffectsTestUnk() {
    Effect eff = RelEffect.createTestEffect(utils.getRelation(0), new SpecVar[] {utils.getVar(0), utils.getVar(1)}, utils.getVar(2));
    Map<ObjectLabel, ThreeValue> map = new HashMap<ObjectLabel, ThreeValue>();
    TestEnvironment env = new TestEnvironment(utils.getContext(0), map, Variant.SOUND_VARIANT);
   
    map.put(utils.getSub(0).getSub(utils.getVar(2)), ThreeValue.UNKNOWN);
   
    RelationshipDelta delta = eff.makeEffects(env, utils.getSub(0));
    ObjectLabel[] labels = new ObjectLabel[] {utils.getSub(0).getSub(utils.getVar(0)), utils.getSub(0).getSub(utils.getVar(1))};
View Full Code Here

  @Test
  public void testMakeEffectsTestNegFalse() {
    Effect eff = RelEffect.createNegatedTestEffect(utils.getRelation(0), new SpecVar[] {utils.getVar(0), utils.getVar(1)}, utils.getVar(2));
    Map<ObjectLabel, ThreeValue> map = new HashMap<ObjectLabel, ThreeValue>();
    TestEnvironment env = new TestEnvironment(utils.getContext(0), map, Variant.SOUND_VARIANT);
   
    map.put(utils.getSub(0).getSub(utils.getVar(2)), ThreeValue.TRUE);
   
    RelationshipDelta delta = eff.makeEffects(env, utils.getSub(0));
    ObjectLabel[] labels = new ObjectLabel[] {utils.getSub(0).getSub(utils.getVar(0)), utils.getSub(0).getSub(utils.getVar(1))};
View Full Code Here

TOP

Related Classes of edu.cmu.cs.fusion.test.TestEnvironment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.