    001    package calhoun.analysis.crf.features.interval29;
    002
    003    import calhoun.analysis.crf.CacheStrategySpec;
    004    import calhoun.analysis.crf.FeatureManagerNodeBoundaries;
    005    import calhoun.analysis.crf.CacheStrategySpec.CacheStrategy;
    006
    007
    008    public class ReferenceBasePredictorZeroPadInterval29 extends ReferenceBasePredictorInterval29Base implements FeatureManagerNodeBoundaries<Character> {
    009
    010            private static final long serialVersionUID = -1104446043334637758L;
    011
    012            public ReferenceBasePredictorZeroPadInterval29() {
    013            }
    014
    015            @Override
    016            public CacheStrategySpec getCacheStrategy() {
    017
    018                    CacheStrategySpec css = new CacheStrategySpec(CacheStrategy.DENSE_NODE_BOUNDARY);
    019                    CacheStrategySpec.DenseBoundaryCachingDetails details = new CacheStrategySpec.DenseBoundaryCachingDetails(9); // we will use 9 tables
    020
    021                    // state, table, featureIx, rightPad, leftPad
    022                    // If you want to debug and verify equality with the Markov case, then set all the pads to zero as below:
    023
    024                    details.add(0,0,startIx + (multipleFeatures ? 0 : 0),0,0);
    025                    details.add(1,1,startIx + (multipleFeatures ? 1 : 0),0,0);
    026                    details.add(2,2,startIx + (multipleFeatures ? 1 : 0),0,0);
    027                    details.add(3,3,startIx + (multipleFeatures ? 1 : 0),0,0);
    028                    details.add(4,4,startIx + (multipleFeatures ? 2 : 0),0,0);
    029                    details.add(5,4,startIx + (multipleFeatures ? 2 : 0),0,0);
    030                    details.add(6,4,startIx + (multipleFeatures ? 2 : 0),0,0);
    031                    details.add(7,5,startIx + (multipleFeatures ? 3 : 0),0,0);
    032                    details.add(8,6,startIx + (multipleFeatures ? 3 : 0),0,0);
    033                    details.add(9,7,startIx + (multipleFeatures ? 3 : 0),0,0);
    034                    details.add(10,8,startIx + (multipleFeatures ? 4 : 0),0,0);
    035                    details.add(11,8,startIx + (multipleFeatures ? 4 : 0),0,0);
    036                    details.add(12,8,startIx + (multipleFeatures ? 4 : 0),0,0);
    037                    details.add(13,0,startIx + (multipleFeatures ? 0 : 0),0,0);
    038                    details.add(14,0,startIx + (multipleFeatures ? 0 : 0),0,0);
    039                    details.add(15,4,startIx + (multipleFeatures ? 2 : 0),0,0);
    040                    details.add(16,4,startIx + (multipleFeatures ? 2 : 0),0,0);
    041                    details.add(17,4,startIx + (multipleFeatures ? 2 : 0),0,0);
    042                    details.add(18,4,startIx + (multipleFeatures ? 2 : 0),0,0);
    043                    details.add(19,4,startIx + (multipleFeatures ? 2 : 0),0,0);
    044                    details.add(20,4,startIx + (multipleFeatures ? 2 : 0),0,0);
    045                    details.add(21,0,startIx + (multipleFeatures ? 0 : 0),0,0);
    046                    details.add(22,0,startIx + (multipleFeatures ? 0 : 0),0,0);
    047                    details.add(23,8,startIx + (multipleFeatures ? 4 : 0),0,0);
    048                    details.add(24,8,startIx + (multipleFeatures ? 4 : 0),0,0);
    049                    details.add(25,8,startIx + (multipleFeatures ? 4 : 0),0,0);
    050                    details.add(26,8,startIx + (multipleFeatures ? 4 : 0),0,0);
    051                    details.add(27,8,startIx + (multipleFeatures ? 4 : 0),0,0);
    052                    details.add(28,8,startIx + (multipleFeatures ? 4 : 0),0,0);
    053
    054                    details.check();
    055
    056                    css.details = details;
    057
    058                    return css;
    059            }
    060    }