org.chocosolver.util.bandit.MOSS Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of choco-solver Show documentation
Show all versions of choco-solver Show documentation
Open-source constraint solver.
The newest version!
/*
* This file is part of choco-solver, http://choco-solver.org/
*
* Copyright (c) 2024, IMT Atlantique. All rights reserved.
*
* Licensed under the BSD 4-clause license.
*
* See LICENSE file in the project root for full license information.
*/
package org.chocosolver.util.bandit;
/**
* Minimax Optimal Strategy in the Stochastic case.
*
*
* @author Charles Prud'homme
* @since 29/06/2020
*/
public class MOSS extends UCB1 {
public MOSS(int numActions) {
super(numActions);
}
/**
* @param t step
* @param n number of times an action was played so far
* @return √(4 / n * log(max(1, t / 2n))
* @implNote The main reason this class exists
*/
protected double upperBound(int t, int n) {
return Math.sqrt(4. / n * Math.log(Math.max(1, t / 2 * n)));
}
}