jcolibri.test.test1
Class Test1

java.lang.Object
  extended by jcolibri.test.test1.Test1
All Implemented Interfaces:
StandardCBRApplication

public class Test1
extends java.lang.Object
implements StandardCBRApplication

Test 1 shows how to use a simple data base connector and perform the KNN retrieval. It uses the travel example with cases that only have description (without solution or result).
This example uses the DataBase connector that is implemented using the Hibernate library. That library is a Java Data Objects implementation that automatically manages the persistence of Java beans in relational data bases.
For an introduction to hibernate see: http://www.hibernate.org/hib_docs/v3/reference/en/html/tutorial.html

The DataBase connector in jcolibri/test/test1/databaseconfig.xml and that xml defines the configuration of Hibernate and the mapping of the description of our case with the data base. In this example, all the attributes of the description bean are stored in the same table.

Version:
1.0
Author:
Juan A. Recio-Garcia
See Also:
TravelDescription, DataBaseConnector

Constructor Summary
Test1()
           
 
Method Summary
 void configure()
          Configures the application: case base, connectors, etc.
 void cycle(CBRQuery query)
          Executes a CBR cycle with the given query.
static void main(java.lang.String[] args)
          Main function
 void postCycle()
          Runs the code to shutdown the application.
 CBRCaseBase preCycle()
          Runs the precyle where typically cases are read and organized into a case base.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Test1

public Test1()
Method Detail

configure

public void configure()
               throws ExecutionException
Description copied from interface: StandardCBRApplication
Configures the application: case base, connectors, etc.

Specified by:
configure in interface StandardCBRApplication
Throws:
ExecutionException

preCycle

public CBRCaseBase preCycle()
                     throws ExecutionException
Description copied from interface: StandardCBRApplication
Runs the precyle where typically cases are read and organized into a case base.

Specified by:
preCycle in interface StandardCBRApplication
Returns:
The created case base with the cases in the storage.
Throws:
ExecutionException

cycle

public void cycle(CBRQuery query)
           throws ExecutionException
Description copied from interface: StandardCBRApplication
Executes a CBR cycle with the given query.

Specified by:
cycle in interface StandardCBRApplication
Throws:
ExecutionException

postCycle

public void postCycle()
               throws ExecutionException
Description copied from interface: StandardCBRApplication
Runs the code to shutdown the application. Typically it closes the connector.

Specified by:
postCycle in interface StandardCBRApplication
Throws:
ExecutionException

main

public static void main(java.lang.String[] args)
Main function


GAIA - Group for Artificial Intelligence Applications
http://gaia.fdi.ucm.es