// AffineGapPenalty: the score of a gap of Length positions under an affine // gap model (Gotoh, 1982): Open for the first position and Extend for each // one after it, so one long gap costs less than many short ones. With // Open == Extend it is the linear model. FUNCTION AffineGapPenalty(Length : INTEGER, Open : INTEGER, Extend : INTEGER) RETURNS INTEGER REQUIRE Length >= 1 ENSURE RESULT == Open + (Length - 1) * Extend RETURN Open + (Length - 1) * Extend ENDFUNCTION