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

com.github.chen0040.rl.utils.IndexValue Maven / Gradle / Ivy

Go to download

Classical RL algorithms implemented in Java, including Q-Learn, R-Learn, SARSA, Actor-Critic

There is a newer version: 1.0.5
Show newest version
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