You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Functions within AIDA are created via an IFunctionFactory. They can be created by either accessing a pool of pre-defined functions or by scripting them on the fly.
Alternatively they can be created by directely instantiating the classes of the underlying implementation.

Pre-defined Functions

Pre-defined functions are those functions that are registered with the function factory's catalog and that can be created by specifying their name. There are two types of pre-defined functions: those defined by the JAIDA implementation and the ones that have been added to the catalog by the user.

JAIDA Pre-defined Functions

JAIDA currently provides a handful of pre-defined functions. For list of the functions provided by the JAIDA implementation, their definition and the list of the parameter's names please refer to the JAIDA Release Notes.

In the following example we create a gaussian:

// The AIDA Factories
IAnalysisFactory af = IAnalysisFactory.create();
ITree = af.createTreeFactory().create();
IFunctionFactory ff = af.createFunctionFactory(tree);

// Create a gaussian
IFunction gauss = ff.createFunctionByName("gauss","g");

User Registered Functions

Once a user has defined a function it is possible to register such function with the function factory's catalog for a given name. Registered functions can be created by name just like the built-in functions. In the following example a function is registered with the catalog and used by name when creating a new function (the sum of a gaussian with the newly registered function):

// The AIDA Factories
IAnalysisFactory af = IAnalysisFactory.create();
ITree = af.createTreeFactory().create();
IFunctionFactory ff = af.createFunctionFactory(tree);

// Register the function myFunc with the catalog.
// Note that there are many ways in which myFunc could have been created.
ff.catalog().add("myFunc",myFunc);

IFunction func = ff.createFunctionByName("func","g+myFunc");

Scripted Functions

Under Construction

There are several ways a user could register a function to the catalog.

Direct Instantiation

  • No labels