de.jstacs.algorithms.alignment.cost
Class SimpleCosts

java.lang.Object
  extended by de.jstacs.algorithms.alignment.cost.SimpleCosts
All Implemented Interfaces:
Costs

public class SimpleCosts
extends Object
implements Costs

Class for simple costs with costs

Author:
Jan Grau, Jens Keilwagen

Constructor Summary
SimpleCosts(double match, double mismatch, double gap)
          Creates a new instance of simple costs with costs match for a match, mismatch for a mismatch, and gap for a gap (of length 1).
 
Method Summary
 double getCostFor(Sequence s1, Sequence s2, int i, int j)
          Returns the costs for the alignment of s1(i) and s2(j).
 double getGapCosts()
          Returns the costs for a gap.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleCosts

public SimpleCosts(double match,
                   double mismatch,
                   double gap)
Creates a new instance of simple costs with costs match for a match, mismatch for a mismatch, and gap for a gap (of length 1).

Parameters:
match - the match costs
mismatch - the mismatch costs
gap - the costs for a gap
Method Detail

getCostFor

public double getCostFor(Sequence s1,
                         Sequence s2,
                         int i,
                         int j)
Description copied from interface: Costs
Returns the costs for the alignment of s1(i) and s2(j).

Specified by:
getCostFor in interface Costs
Parameters:
s1 - the first sequence
s2 - the second sequence
i - the index in the first sequence
j - the index in the second sequence
Returns:
the costs
See Also:
Sequence.discreteVal(int)

getGapCosts

public double getGapCosts()
Description copied from interface: Costs
Returns the costs for a gap.

Specified by:
getGapCosts in interface Costs
Returns:
the costs for a gap