a09a10d3388835a7468c0c414a912a4ca3c9d109
[pingpong.git] / Code / Projects / SmartPlugDetector / src / main / java / edu / uci / iotproject / comparison / seqalignment / SampleIntegerAlignmentPricer.java
1 package edu.uci.iotproject.comparison.seqalignment;
2
3 /**
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.
8  *
9  * @author Janus Varmarken {@literal <jvarmark@uci.edu>}
10  * @author Rahmadi Trimananda {@literal <rtrimana@uci.edu>}
11  */
12 public class SampleIntegerAlignmentPricer extends AlignmentPricer<Integer> {
13
14     /**
15      * Constructs a new {@link SampleIntegerAlignmentPricer}.
16      */
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);
21     }
22
23 }