Database Reference
In-Depth Information
// Create initial function values:
createInitialValues();
showValues();
// Do the online learning:
onlineLearning(agent);
showValues();
}
The most complex part is the implementation of
RecommEngineEnvironment
which extends
RecommEnvironment
. Thus, we restrict our attention to the main
elements of this class. Especially, we do not show the implementations of all
methods of
RecommEnvironment
but just state the internal variables.
/**
* Environment of recommendation engine example.
<
p
>
*
* There are six states S
¼
(1,2,3,4,5,6) and in all
* of these states the same actions may be recommended: A
¼
S.
*/
public
class
RecommEngineEnvironment
extends
RecommEnvironment
{
// ---------------------------
// Variables definitions
// ---------------------------
/** Set of all states. */
private StateSet states
¼
null;
/** Array of all action sets. */
private ActionSet[] actionsets
¼
null;
// --------- Meta Data States/Actions -------- //
/** Item ID attribute of states. */
private CategoricalAttribute itemIDAtt
¼
new Categorica-
lAttribute("itemIDAtt");
/** Meta data of states, i.e. item indexes. */
private MiningDataSpecification metaDataState
¼
null;
/** Item ID attribute of actions. */
protected CategoricalAttribute recoIDAtt
¼
new Categori-
calAttribute("recoIDAtt");
/** Meta data of actions, i.e. rule indexes. */
private MiningDataSpecification metaDataAction
¼
null;
/** Hashtable of step number. */