Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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 creating created by directely instantiating the classes of the underlying implementation.

...

Pre-defined functions are those functions that are registered with the function factory's catalog and that can be created by specifying their name; in . 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:

Code Block
borderStylesolid
// 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");

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.

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):

Code Block
borderStylesolid

// 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

Panel
borderColor#ccc
bgColor#FFFFCE
titleBGColor#F7D6C1
titleUnder Construction
borderStyledashed

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

...

Direct Instantiation