Extend MODL Interface |
![]() |
The Extend MODL is used to add reasoning capabilities to Extend models. It consists of 6 files. The first 5 files are in the arulesxl\api\bin_redist directory. The last 2 files are in the arulesxl\api\modl directory.
To use the MODL interface, put all of the above files in the Extend\extensions directory.
MODL uses the Extend DLL application programming interface (API). As a result, the API calls differ in these ways:
The most common error codes are:
These error codes usually occur when calling QueryRulesTo___ and the result of the query does not match the type returned by the function. You can test your queries directly in Excel using RQuery(). Alternatively, you can enable tracing in the arulesrt.cfg file. To do this remove the pound sign (#) in front of these lines:
apitrace = on
logfile = c:\arulestrace.log
If you look in the log file you will see the queries and the results returned.
Description:
integer AddDoubleObject(long arxl, string ruleset, string objectname, double value)
integer AddLongObject(long arxl, string ruleset, string objectname, long value)
integer AddStringObject(long arxl, string ruleset, string objectname, string value)
Remarks:
See AddObject()
Return Value:
An error code, where 0 means success.
Description:
integer AddDoubleToTable(long arxl, string ruleset, string objectName, string rowname, string colname, double value)
integer AddLongToTable(long arxl, string ruleset, string objectName, string rowname, string colname, long value)
integer AddStringToTable(long arxl, string ruleset, string objectName, string rowname, string colname, string value)
Remarks:
See AddToTable()
Return Value:
An error code, where 0 means success.
Description:
integer AddDoubleToVector(long arxl, string ruleset, string objectname, string rowname, double value)
integer AddLongToVector(long arxl, string ruleset, string objectname, string rowname, long value)
integer AddStringToVector(long arxl, string ruleset, string objectname, string rowname, string value)
Remarks:
See AddToVector()
Return Value:
An error code, where 0 means success.
Description:
InitRules()
Remarks:
InitRules() must be called before OpenRules(), and initializes the ARulesXL module by loading external code in DLLs.
Return Value:
None.
Description:
integer LoadVectorFromDoubleArray(long arxl, string ruleset, string objectname, double values[])
integer LoadVectorFromLongArray(long arxl, string ruleset, string objectname, long values[])
Remarks:
Replaces all data in a new or existing vector (a one-dimensional table) with the values given.
Return Value:
An error code, where 0 means success.
Example:
double ar[3]; integer arxl; integer rc;
InitRules();
arxl = OpenRules("c:\Extend6LT\pricing.axl", "C:\Extend6LT\Extensions\");
ar[0] = 1;
ar[1] = 2.345;
ar[2] = 0.345678e20;
rc = LoadVectorFromDoubleArray(arxl, "PriceRules", "ar", ar);
Description:
long OpenRules(string rulesetfile, string arulespath)
Remarks:
See OpenRules().
InitRules() must be called before OpenRules().
Return Value:
The ARulesXL identifier that is passed to all subsequent functions.
Description:
integer QueryRulesToDouble(long arxl, string ruleset, string query, double out[])
integer QueryRulesToLong(long arxl, string ruleset, string query, long out[])
Remarks:
See QueryRules().
Return Value:
An error code, where 0 means success. The last parameter is an array of length 1 where the result of the query is returned.
Description:
integer QueryRulesToDoubleVector(long arxl, string ruleset, string query, long count[], double out[])
integer QueryRulesToLongVector(long arxl, string ruleset, string query, long count[], long out[])
Remarks:
See QueryRules().
Returns a list of values from a query into a double or long array. Will return all the items in the list if the array is large enough to contain them, otherwise just fills the array.
Return Value:
An error code, where 0 means success. The count parameter is an array of length 1 where the number of items in the list is returned. The out parameter is an array where the values of the list are returned in order.
Description:
integer QueryMoreToDouble(long arxl, string ruleset, string query, double out[])
integer QueryMoreToLong(long arxl, string ruleset, string query, long out[])
Remarks:
See QueryMore().
Return Value:
An error code, where 0 means success. The last parameter is an array of length 1 where the result of the query is returned.
Before running the sample, you need to create and copy files into the Extend program directories:
To run the sample:
|
Copyright ©2005-7 Amzi! inc. All Rights Reserved.
|