1 package edu.uci.iotproject.comparison.seqalignment;
4 * A sample {@link AlignmentPricer} for computing the cost of aligning integer values. In this sample implementation,
5 * the cost of aligning two integers {@code i1} and {@code i2} is {@code Math.abs(i1 - i2)}, i.e., it is the absolute
6 * value of the difference between {@code i1} and {@code i2}. The cost of aligning an integer {@code i} with a gap is
7 * simply {@code i}, i.e., the gap is essentially treated as a zero.
9 * @author Janus Varmarken {@literal <jvarmark@uci.edu>}
10 * @author Rahmadi Trimananda {@literal <rtrimana@uci.edu>}
12 public class SampleIntegerAlignmentPricer extends AlignmentPricer<Integer> {
15 * Constructs a new {@link SampleIntegerAlignmentPricer}.
17 public SampleIntegerAlignmentPricer() {
18 // Cost of aligning integers i1 and i2 is the absolute value of their difference.
19 // Cost of aligning integer i with a gap is i (as it was aligned with 0).
20 super((i1,i2) -> Math.abs(i1 - i2) , (i) -> i);