Last change
on this file since 1555 was
1554,
checked in by rkrimmel, 10 years ago
|
Moved alignment plugin into core-tasktrees
|
File size:
1022 bytes
|
Rev | Line | |
---|
[1314] | 1 | /** |
---|
| 2 | * |
---|
| 3 | */ |
---|
[1553] | 4 | package de.ugoe.cs.autoquest.tasktrees.alignment.substitution; |
---|
[1314] | 5 | |
---|
[1324] | 6 | import java.util.Collection; |
---|
| 7 | import java.util.List; |
---|
| 8 | |
---|
| 9 | import de.ugoe.cs.autoquest.eventcore.Event; |
---|
[1553] | 10 | import de.ugoe.cs.autoquest.tasktrees.treeifc.IUserSession; |
---|
[1324] | 11 | |
---|
[1314] | 12 | /** |
---|
| 13 | * @author Ralph Krimmel |
---|
| 14 | * |
---|
| 15 | */ |
---|
| 16 | public class NearbySubstitutionMatrix implements SubstitutionMatrix { |
---|
| 17 | |
---|
| 18 | private int[] input1; |
---|
| 19 | private int[] input2; |
---|
| 20 | private int range; |
---|
| 21 | |
---|
| 22 | public NearbySubstitutionMatrix(int[] input1,int[] input2, int range) { |
---|
| 23 | this.input1 = input1; |
---|
| 24 | this.input2 = input2; |
---|
| 25 | this.range = range; |
---|
| 26 | } |
---|
| 27 | |
---|
| 28 | /* (non-Javadoc) |
---|
| 29 | * @see de.ugoe.cs.autoquest.plugin.alignment.SubstitutionMatrix#getDistance(int, int) |
---|
| 30 | */ |
---|
[1554] | 31 | public float getDistance(int pos1, int pos2) { |
---|
[1314] | 32 | int difference = Math.abs(input1[pos1]-input2[pos2]); |
---|
| 33 | if(difference < range) { |
---|
| 34 | return range-difference; |
---|
| 35 | } |
---|
| 36 | else { |
---|
| 37 | return -range; |
---|
| 38 | } |
---|
| 39 | } |
---|
| 40 | |
---|
| 41 | |
---|
| 42 | @Override |
---|
[1554] | 43 | public float getGapPenalty() { |
---|
[1314] | 44 | return -range-1; |
---|
| 45 | } |
---|
| 46 | |
---|
| 47 | |
---|
[1324] | 48 | @Override |
---|
[1554] | 49 | public void generate() { |
---|
[1324] | 50 | // TODO Auto-generated method stub |
---|
| 51 | |
---|
| 52 | } |
---|
| 53 | |
---|
[1553] | 54 | |
---|
| 55 | |
---|
[1314] | 56 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.