Package edu.cmu.cs.fusion.test

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


  @Test
  public void testMakeEffectsTestNegTrue() {
    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.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 testMakeEffectsTestNegUnk() {
    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.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 testTruthFalse() {
    Predicate bv = new BooleanValue(utils.getVar(0));
    Map<ObjectLabel, ThreeValue> tvs = new HashMap<ObjectLabel, ThreeValue>();
    tvs.put(utils.getSub(0).getSub(utils.getVar(0)), ThreeValue.FALSE);
    FusionEnvironment env = new TestEnvironment(utils.getContext(0), tvs, Variant.SOUND_VARIANT);
   
    assertEquals(ThreeValue.FALSE, bv.getTruth(env, utils.getSub(0)));
  }
View Full Code Here

  @Test
  public void testTruthTrue() {
    Predicate bv = new BooleanValue(utils.getVar(0));
    Map<ObjectLabel, ThreeValue> tvs = new HashMap<ObjectLabel, ThreeValue>();
    tvs.put(utils.getSub(0).getSub(utils.getVar(0)), ThreeValue.TRUE);
    FusionEnvironment env = new TestEnvironment(utils.getContext(0), tvs, Variant.SOUND_VARIANT);
   
    assertEquals(ThreeValue.TRUE, bv.getTruth(env, utils.getSub(0)));
  }
View Full Code Here

  @Test
  public void testTruthUnknown() {
    Predicate bv = new BooleanValue(utils.getVar(0));
    Map<ObjectLabel, ThreeValue> tvs = new HashMap<ObjectLabel, ThreeValue>();
    tvs.put(utils.getSub(0).getSub(utils.getVar(0)), ThreeValue.UNKNOWN);
    FusionEnvironment env = new TestEnvironment(utils.getContext(0), tvs, Variant.SOUND_VARIANT);
   
    assertEquals(ThreeValue.UNKNOWN, bv.getTruth(env, utils.getSub(0)));
  }
View Full Code Here

  public void testTruthNotFalse() {
    BooleanValue bv = new BooleanValue(utils.getVar(0));
    bv.setPositive(false);
    Map<ObjectLabel, ThreeValue> tvs = new HashMap<ObjectLabel, ThreeValue>();
    tvs.put(utils.getSub(0).getSub(utils.getVar(0)), ThreeValue.FALSE);
    FusionEnvironment env = new TestEnvironment(utils.getContext(0), tvs, Variant.SOUND_VARIANT);
   
    assertEquals(ThreeValue.TRUE, bv.getTruth(env, utils.getSub(0)));
  }
View Full Code Here

  public void testTruthNotTrue() {
    BooleanValue bv = new BooleanValue(utils.getVar(0));
    bv.setPositive(false);
    Map<ObjectLabel, ThreeValue> tvs = new HashMap<ObjectLabel, ThreeValue>();
    tvs.put(utils.getSub(0).getSub(utils.getVar(0)), ThreeValue.TRUE);
    FusionEnvironment env = new TestEnvironment(utils.getContext(0), tvs, Variant.SOUND_VARIANT);
   
    assertEquals(ThreeValue.FALSE, bv.getTruth(env, utils.getSub(0)));
  }
View Full Code Here

  public void testTruthNotUnknown() {
    BooleanValue bv = new BooleanValue(utils.getVar(0));
    bv.setPositive(false);
    Map<ObjectLabel, ThreeValue> tvs = new HashMap<ObjectLabel, ThreeValue>();
    tvs.put(utils.getSub(0).getSub(utils.getVar(0)), ThreeValue.UNKNOWN);
    FusionEnvironment env = new TestEnvironment(utils.getContext(0), tvs, Variant.SOUND_VARIANT);
   
    assertEquals(ThreeValue.UNKNOWN, bv.getTruth(env, utils.getSub(0)));
  }
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 T or T
    RelationshipPredicate lP = new RelationshipPredicate(utils.getRelation(0), new SpecVar[] {utils.getVar(0), utils.getVar(1)});
    RelationshipPredicate rP = new RelationshipPredicate(utils.getRelation(0), new SpecVar[] {utils.getVar(4), utils.getVar(3)});
    OrPredicate pred = new OrPredicate(lP, rP);

    FusionEnvironment env = new TestEnvironment(utils.getContext(0), Variant.SOUND_VARIANT);
   
    assertEquals(ThreeValue.TRUE, pred.getTruth(env, utils.getSub(0)));
  }
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.