The use that wishes to define his own criteria can do it by inserting code in “SRC/Result/predfinedCriteria.cpp” source file and re-compiling the library. Three areas are to be modified:
One must first define the itneger ID that is associated to the criterion. This is done by inserting the appropriate “#define” statement at the beginning. For example:
#define UD_criterion_1 20001 #define UD_criterion_2 20002 #define UD_criterion_3 20003 #define UD_criterion_4 20004 // ...
in which one assumes that all the user criteria are prefixed with “UD_” string. (It is advised to prefix the criteria following this kind of convention to reduce the risk of clash with someone else’s criterion.)
Then, at the beginning of the “result::calcPredefinedCriterion” method, the mapping between criteria names and integer IDs must be build (“critNameIds” variable). This is currently done by the following C++ lines:
if (bFirstHere) { critNameIds.insert(make_pair("HoneycombAirbusMoS",HoneycombAirbusMoS)); critNameIds.insert(make_pair("HoneycombAirbusSR",HoneycombAirbusSR)); critNameIds.insert(make_pair("VonMisesMoS",VonMisesMoS)); critNameIds.insert(make_pair("VonMisesSR",VonMisesSR)); critNameIds.insert(make_pair("SGI_SR",SGI_SR)); critNameIds.insert(make_pair("UD_criterion_1",UD_criterion_1)); critNameIds.insert(make_pair("UD_criterion_2",UD_criterion_2)); critNameIds.insert(make_pair("UD_criterion_3",UD_criterion_3)); critNameIds.insert(make_pair("UD_criterion_4",UD_criterion_4)); // ... }
(Here again, the User is allowed to change the criteria name and associated integer variable names.)
Finally, the new criterion “case” must be defined in the “switch(critId)” case. The case integer ID corrtrsponds to the integer value defined with “#define” statement. The otugh part fo the job is to write the appropriate C++ source code. We hope that the criteria already defined will be a source of inspiration for the developers.