Package org.ontospread.restrictions

Examples of org.ontospread.restrictions.OntoSpreadRestriction.eval()


  public void testEval() {
    OntoSpreadRestriction maxRestriction = new OntoSpreadRestrictionMaxConcepts(10);
    OntoSpreadState ontoSpreadState = new OntoSpreadState();
    Set<String> spreadedConcepts= new HashSet<String>();
    ontoSpreadState.setSpreadedConcepts(spreadedConcepts);
    assertTrue(maxRestriction.eval(ontoSpreadState));
    for(int i = 0; i<=10;i++){
      ontoSpreadState.getSpreadedConcepts().add(String.valueOf(i));
    }
    assertFalse(maxRestriction.eval(ontoSpreadState));
  }
View Full Code Here


    ontoSpreadState.setSpreadedConcepts(spreadedConcepts);
    assertTrue(maxRestriction.eval(ontoSpreadState));
    for(int i = 0; i<=10;i++){
      ontoSpreadState.getSpreadedConcepts().add(String.valueOf(i));
    }
    assertFalse(maxRestriction.eval(ontoSpreadState));
  }

  public void testGetMaxConceptsSpreaded() {
    OntoSpreadRestrictionMaxConcepts maxRestriction = new OntoSpreadRestrictionMaxConcepts(10);
    assertEquals(10, maxRestriction.getMaxConceptsSpreaded())
View Full Code Here

  public void testEval() {
    OntoSpreadRestriction minRestriction = new OntoSpreadRestrictionMinConcepts(10);
    OntoSpreadState ontoSpreadState = new OntoSpreadState();
    Set<String> spreadedConcepts= new HashSet<String>();
    ontoSpreadState.setSpreadedConcepts(spreadedConcepts);
    assertTrue(minRestriction.eval(ontoSpreadState));
    for(int i = 0; i<=10;i++){
      ontoSpreadState.getSpreadedConcepts().add(String.valueOf(i));
    }
    assertFalse(minRestriction.eval(ontoSpreadState));
  }
View Full Code Here

    ontoSpreadState.setSpreadedConcepts(spreadedConcepts);
    assertTrue(minRestriction.eval(ontoSpreadState));
    for(int i = 0; i<=10;i++){
      ontoSpreadState.getSpreadedConcepts().add(String.valueOf(i));
    }
    assertFalse(minRestriction.eval(ontoSpreadState));
  }

  public void testGetMinConceptsSpreaded() {
    OntoSpreadRestrictionMinConcepts minRestriction = new OntoSpreadRestrictionMinConcepts(10);
    assertEquals(10, minRestriction.getMinConceptsSpreaded())
View Full Code Here

  public void testEval() {
    OntoSpreadRestriction valueRestriction = new OntoSpreadRestrictionMinActivationValue(10.0);
    OntoSpreadState ontoSpreadState = new OntoSpreadState();
    ontoSpreadState.setCurrentScore(11.0);
    assertTrue(valueRestriction.eval(ontoSpreadState));
    ontoSpreadState.setCurrentScore(9.0);   
    assertFalse(valueRestriction.eval(ontoSpreadState));   
  }
}
View Full Code Here

    OntoSpreadRestriction valueRestriction = new OntoSpreadRestrictionMinActivationValue(10.0);
    OntoSpreadState ontoSpreadState = new OntoSpreadState();
    ontoSpreadState.setCurrentScore(11.0);
    assertTrue(valueRestriction.eval(ontoSpreadState));
    ontoSpreadState.setCurrentScore(9.0);   
    assertFalse(valueRestriction.eval(ontoSpreadState));   
  }
}
View Full Code Here

  public void testTrueEval(){
    OntoSpreadRestriction contextRestriction = new OntoSpreadRestrictionContext("http://context",10);
    OntoSpreadState ontoSpreadState = new OntoSpreadState();
    ConceptTO conceptToSpread = new ConceptTO("http://context#Concept");
    ontoSpreadState.setConceptToSpread(conceptToSpread );
    assertTrue(contextRestriction.eval(ontoSpreadState));
  }
  public void testFalseEval(){
    OntoSpreadRestriction contextRestriction = new OntoSpreadRestrictionContext("http://context",10);
    OntoSpreadState ontoSpreadState = new OntoSpreadState();
    ConceptTO conceptToSpread = new ConceptTO("http://contex1t#Concept");
View Full Code Here

  public void testFalseEval(){
    OntoSpreadRestriction contextRestriction = new OntoSpreadRestrictionContext("http://context",10);
    OntoSpreadState ontoSpreadState = new OntoSpreadState();
    ConceptTO conceptToSpread = new ConceptTO("http://contex1t#Concept");
    ontoSpreadState.setConceptToSpread(conceptToSpread );
    assertFalse(contextRestriction.eval(ontoSpreadState));
  }
}
View Full Code Here

  public void testMaxTime(){
    OntoSpreadRestriction restriction = new OntoSpreadRestrictionNotMaxTime(2000);
    OntoSpreadState ontoSpreadState = new OntoSpreadState();
    ontoSpreadState.setSpreadTime(0);
    assertTrue(restriction.eval(ontoSpreadState));
  }
 
  public void testMaxTime1(){
    OntoSpreadRestriction restriction = new OntoSpreadRestrictionNotMaxTime(2000);
    OntoSpreadState ontoSpreadState = new OntoSpreadState();
View Full Code Here

 
  public void testMaxTime1(){
    OntoSpreadRestriction restriction = new OntoSpreadRestrictionNotMaxTime(2000);
    OntoSpreadState ontoSpreadState = new OntoSpreadState();
    ontoSpreadState.setSpreadTime(1999);
    assertTrue(restriction.eval(ontoSpreadState));
  }
 
  public void testMaxTime2(){
    OntoSpreadRestriction restriction = new OntoSpreadRestrictionNotMaxTime(2000);
    OntoSpreadState ontoSpreadState = new OntoSpreadState();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.