com.mwt.sample.MyPolicy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of explore-java Show documentation
Show all versions of explore-java Show documentation
A library for general purpose exploration through a set of actions. This is most applicable in a reinforcement
or bandit setting, althought it is most often tested with Vowpal Wabbit.
The newest version!
package com.mwt.sample;
import com.mwt.policies.Policy;
/**
* Example of a custom policy which implements the IPolicy,
* declaring that this policy only interacts with MyContext objects.
*/
class MyPolicy implements Policy {
private int index;
public MyPolicy() {
this(-1);
}
public MyPolicy(int index) {
this.index = index;
}
public int chooseAction(MyContext context) {
// Always returns the same action regardless of context
return 5;
}
}