All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mwt.sample.MyPolicy Maven / Gradle / Ivy

Go to download

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy