Database Reference
In-Depth Information
* @param crecs the current recommendation indexes
* @param crewardValue the current reward value
* @throws MiningException
*/
private void learn(State cstate, int[] crecs, double
crewardValue)
throws MiningException {
String cStateStr
¼
(String) cstate.getValueCategory(0).
getValue();
// Create sample vector:
if (nextState !
¼
null) {
String nextStateStr
¼
(String) nextState.getValue-
Category(0).getValue();
Action
¼
action
recoEnv.getAction(nextStateStr,
cStateStr);
if (action
¼¼
null) {
// ...create new rule ...///
}
nextSelRec
¼
(int) action.getIndex();
}
if (state !
¼
null) {
Action
¼
action
new
ComposedAction(recs,
selRec,
recoEnv.recoIDAtt);
Reward reward
¼
new Reward(crewardValue);
Action nextAction
¼
new
ComposedAction(nextRecs,
nextSelRec,
recoEnv.
recoIDAtt);
RecommVector recommVec
¼
new
RecommVector(agent,
state,
action,
reward,
nextState, nextAction);
agent.learnApply(recommVec);
}
// Update values:
boolean absorbing
¼
cStateStr.equals("_a_");
if (absorbing) {
state
¼
null;
recs
¼
null;
nextSelRec
¼
-1;
}
else {
state
¼
nextState;
recs
¼
nextRecs;
}