![]() |
![]() |
![]() |
liboscats Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
gdouble (*OscatsAlgChooserCriterion) (const OscatsItem *item
,const OscatsExaminee *e
,gpointer data
); struct OscatsAlgChooser; void oscats_alg_chooser_set_c_criterion (OscatsAlgChooser *chooser
,OscatsAlgChooserCriterion f
); gint oscats_alg_chooser_choose (OscatsAlgChooser *chooser
,const OscatsExaminee *e
,GBitArray *eligible
,gpointer data
);
gdouble (*OscatsAlgChooserCriterion) (const OscatsItem *item
,const OscatsExaminee *e
,gpointer data
);
struct OscatsAlgChooser;
Support algorithm (for item selection): Picks an optimal item based on a supplied criterion function. Note: This algorithm won't work correctly if there are multiple items with exactly the optimality metric.
void oscats_alg_chooser_set_c_criterion (OscatsAlgChooser *chooser
,OscatsAlgChooserCriterion f
);
Sets the criterion function f
, which takes an OscatsItem, an
OscatsExaminee, and optional user data and returns the item's value
on the criterion. The chooser
will minimize this
criterion.
|
an OscatsAlgChooser object |
|
the criterion function to be minimized |
gint oscats_alg_chooser_choose (OscatsAlgChooser *chooser
,const OscatsExaminee *e
,GBitArray *eligible
,gpointer data
);
Chooses an item that minimizes the given criterion for examinee e
.
|
an OscatsAlgChooser with criterion set |
|
the OscatsExaminee for which to choose the item |
|
a GBitArray indicating which items in the bank are eligible |
|
optional user data for the criterion function |
Returns : |
the index of the selected item, or -1 if no item is available |
"itembank"
property"itembank" OscatsItemBank* : Read / Write
The item bank from which to choose items.