001    package org.hackystat.projectbrowser.page.trajectory.dtw.step;
002    
003    import java.awt.Point;
004    
005    import org.hackystat.projectbrowser.page.trajectory.dtw.constraint.AbstractConstraintFunction;
006    
007    /**
008     * Defines the stepfunction for the DTW.
009     * 
010     * @author Pavel Senin
011     */
012    public abstract class AbstractStepFunction {
013    
014      /**
015       * Calculates the next step given the cost matrix and constraints.
016       * 
017       * @param position the current position.
018       * @param costMatrix the distance matrix.
019       * @param constraints the constraints function.
020       * @return The next step.
021       */
022      public abstract Point doStep(Point position, double[][] costMatrix,
023          AbstractConstraintFunction constraints);
024    
025      /**
026       * Get the local cost matrix using the step function.
027       * 
028       * @param distanceMatrix The distance matrix to use.
029       * @return computed cost matrix.
030       */
031      public abstract double[][] getCostMatrix(double[][] distanceMatrix);
032    
033    }