RLPark 1.0.0
Reinforcement Learning Framework in Java
|
00001 package rlpark.plugin.rltoys.algorithms.representations.discretizer.partitions; 00002 00003 import rlpark.plugin.rltoys.algorithms.representations.discretizer.Discretizer; 00004 import rlpark.plugin.rltoys.math.ranges.Range; 00005 00006 public class BoundedSmallPartitionFactory extends AbstractPartitionFactory { 00007 private static final long serialVersionUID = 5982191647323647140L; 00008 00009 public BoundedSmallPartitionFactory(Range... ranges) { 00010 super(ranges); 00011 } 00012 00013 @Override 00014 public Discretizer createDiscretizer(int inputIndex, int resolution, int tilingIndex, int nbTilings) { 00015 Range range = ranges[inputIndex]; 00016 double offset = range.length() / ((resolution + 1) * nbTilings - 1); 00017 double shift = computeShift(offset, tilingIndex, inputIndex); 00018 double width = range.length() - offset * (nbTilings - 1); 00019 double min = range.min() + shift; 00020 double max = min + width; 00021 return new BoundedPartition(min, max, resolution); 00022 } 00023 }