
com.github.chen0040.rl.utils.IndexValue Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-reinforcement-learning Show documentation
Show all versions of java-reinforcement-learning Show documentation
Classical RL algorithms implemented in Java, including Q-Learn, R-Learn, SARSA, Actor-Critic
package com.github.chen0040.rl.utils;
import lombok.Getter;
import lombok.Setter;
/**
* Created by xschen on 6/5/2017.
*/
@Getter
@Setter
public class IndexValue {
private int index;
private double value;
public IndexValue(){
}
public IndexValue(int index, double value){
this.index = index;
this.value = value;
}
public IndexValue makeCopy(){
IndexValue clone = new IndexValue();
clone.setValue(value);
clone.setIndex(index);
return clone;
}
@Override
public boolean equals(Object rhs){
if(rhs != null && rhs instanceof IndexValue){
IndexValue rhs2 = (IndexValue)rhs;
return index == rhs2.index && value == rhs2.value;
}
return false;
}
public boolean isValid(){
return index != -1;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy