RLPark 1.0.0
Reinforcement Learning Framework in Java

WrappedPartitionFactory.java

Go to the documentation of this file.
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 WrappedPartitionFactory extends AbstractPartitionFactory {
00007   private static final long serialVersionUID = -5578336702743121475L;
00008 
00009   public WrappedPartitionFactory(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 / nbTilings;
00017     double shift = computeShift(offset, tilingIndex, inputIndex);
00018     double min = range.min() + shift;
00019     double max = range.max() + shift;
00020     return new WrappedPartition(min, max, resolution);
00021   }
00022 }
 All Classes Namespaces Files Functions Variables Enumerations
Zephyr
RLPark