Examples of Timers


Examples of org.mindswap.pellet.utils.Timers

   
    // Get an instance of the incremental classifier
    IncrementalClassifier classifier = new IncrementalClassifier( ontologyTBox );

    // We need some timing to show the performance of the classification
    Timers timers = new Timers();

    // We classify the ontology and use a specific timer to keep track of
    // the time required for the classification
    Timer t = timers.createTimer( "First classification" );
    t.start();
    classifier.classify();
    t.stop();
       
    System.out.println( "\nClassification time: " + t.getTotal() + "ms");
    System.out.println( "Subclasses of " + pain + ": " + classifier.getSubClasses( pain, true ).getFlattened() + "\n");
   
    // Now create a new OWL axiom, subClassOf(Headache, Pain)
    OWLAxiom axiom = OWL.subClassOf( headache, pain );

    // Add the axiom to the ontology, which creates a change event
    OWL.manager.applyChange( new AddAxiom( ontologyTBox, axiom ) );

    // Now we create a second timer to keep track of the performance of the
    // second classification
    t = timers.createTimer("Second classification");
    t.start();
    classifier.classify();
    t.stop();
   
    System.out.println( "\nClassification time: " + t.getTotal() + "ms");
    System.out.println( "Subclasses of " + pain + ": " + classifier.getSubClasses( pain, true ).getFlattened() + "\n");

    // Remove the axiom from the ontology, which creates a change event
    OWL.manager.applyChange( new RemoveAxiom( ontologyTBox, axiom ) );

    // Now we create a third timer to keep track of the performance of the
    // third classification
    timers.startTimer( "Third classification" );
    classifier.classify();
    timers.stopTimer( "Third classification" );
   
    System.out.println( "\nClassification time: " + t.getTotal() + "ms");
    System.out.println( "Subclasses of " + pain + ": " + classifier.getSubClasses( pain, true ).getFlattened() + "\n");
   
    // Finally, print the timing. As you can see, the second classification
    // takes significantly less time, which is the characteristic of the
    // incremental classifier.
    System.out.println( "Timers summary" );
    for( Timer timer : timers.getTimers() ) {
      if( !timer.isStarted() )
        System.out.println( timer.getName() + ": " + timer.getTotal() + "ms" );
    }
   
  }
View Full Code Here

Examples of org.mindswap.pellet.utils.Timers

   
    // Get an instance of the incremental classifier
    IncrementalClassifier classifier = new IncrementalClassifier( ontology );

    // We need some timing to show the performance of the classification
    Timers timers = new Timers();

    // We classify the ontology and use a specific timer to keep track of
    // the time required for the classification
    Timer t = timers.createTimer( "First classification" );
    t.start();
    classifier.classify();
    t.stop();
       
    System.out.println( "\nClassification time: " + t.getTotal() + "ms");
    System.out.println( "Subclasses of " + pain + ": " + classifier.getSubClasses( pain, true ).getFlattened() + "\n");
   
    // Now create a new OWL axiom, subClassOf(Headache, Pain)
    OWLAxiom axiom = OWL.subClassOf( headache, pain );

    // Add the axiom to the ontology, which creates a change event
    OWL.manager.applyChange( new AddAxiom( ontology, axiom ) );

    // Now we create a second timer to keep track of the performance of the
    // second classification
    t = timers.createTimer( "Second classification" );
    t.start();
    classifier.classify();
    t.stop();
   
    System.out.println( "\nClassification time: " + t.getTotal() + "ms");
    System.out.println( "Subclasses of " + pain + ": " + classifier.getSubClasses( pain, true ).getFlattened() + "\n");

    // Remove the axiom from the ontology, which creates a change event
    OWL.manager.applyChange( new RemoveAxiom( ontology, axiom ) );

    // Now we create a third timer to keep track of the performance of the
    // third classification
    timers.startTimer( "Third classification" );
    classifier.classify();
    timers.stopTimer( "Third classification" );
   
    System.out.println( "\nClassification time: " + t.getTotal() + "ms");
    System.out.println( "Subclasses of " + pain + ": " + classifier.getSubClasses( pain, true ).getFlattened() + "\n");
   
    // Finally, print the timing. As you can see, the second classification
    // takes significantly less time, which is the characteristic of the
    // incremental classifier.
    System.out.println( "Timers summary" );
    for( Timer timer : timers.getTimers() ) {
      if( !timer.isStarted() )
        System.out.println( timer.getName() + ": " + timer.getTotal() + "ms" );
    }
  }
View Full Code Here

Examples of org.mindswap.pellet.utils.Timers

  public PelletCmdApp() {
    this.options = getOptions();
    this.appId = getAppId();
    this.appCmd = getAppCmd();
    this.inputFiles = new ArrayList<String>();
    this.timers = new Timers();

    buildHelp();
  }
View Full Code Here

Examples of org.mindswap.pellet.utils.Timers

  public PelletCmdApp() {
    this.options = getOptions();
    this.appId = getAppId();
    this.appCmd = getAppCmd();
    this.inputFiles = new ArrayList<String>();
    this.timers = new Timers();

    buildHelp();
  }
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.