double chainScore(struct chain *chain, struct dnaSeq *qSeq, struct dnaSeq *tSeq, int matrix[256][256], int (*gapCost)(int dt, int dq)) /* Calculate score of chain from scratch looking at blocks. */ { struct cBlock *b, *a = NULL; double score = 0; for (b = chain->blockList; b != NULL; b = b->next) { int size = b->qEnd - b->qStart; score += scoreBlock(qSeq->dna + b->qStart, tSeq->dna + b->tStart, size, matrix); if (a != NULL) score -= gapCost(b->tStart - a->tEnd, b->qStart - a->qEnd); a = b; } return score; }
/* Used to commence scoring with the block and parking based on the values Parameters: distance - distance to travel speed - speed to travel direction - direction to travel */ void scoreRobot(float distance, float speed, string direction){ scoreBlock(); moveRobot(distance, speed, direction); parkRobot(); stopRobot(); }