OscatsAlgChooser

OscatsAlgChooser

Synopsis

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

Object Hierarchy

  GObject
   +----OscatsAlgChooser

Properties

  "itembank"                 OscatsItemBank*       : Read / Write
  "num"                      guint                 : Read / Write / Construct Only

Description

Details

OscatsAlgChooserCriterion ()

gdouble             (*OscatsAlgChooserCriterion)        (const OscatsItem *item,
                                                         const OscatsExaminee *e,
                                                         gpointer data);


struct OscatsAlgChooser

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.


oscats_alg_chooser_set_c_criterion ()

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.

chooser :

an OscatsAlgChooser object

f :

the criterion function to be minimized

oscats_alg_chooser_choose ()

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.

chooser :

an OscatsAlgChooser with criterion set

e :

the OscatsExaminee for which to choose the item

eligible :

a GBitArray indicating which items in the bank are eligible

data :

optional user data for the criterion function

Returns :

the index of the selected item, or -1 if no item is available

Property Details

The "itembank" property

  "itembank"                 OscatsItemBank*       : Read / Write

The item bank from which to choose items.


The "num" property

  "num"                      guint                 : Read / Write / Construct Only

Number of items from which to choose. If one, then the exact closest item is selected. If greater than one, then a random item is chosen from among the "num" closest items.

Allowed values: >= 1

Default value: 1