def compare(self, cost_map):
cri_val = cost_map[self._criteria]<EOL>if self._best_criteria is None:<EOL><INDENT>self._best_criteria = cri_val<EOL>return True<EOL><DEDENT>else:<EOL><INDENT>if self._smaller_is_better and cri_val < self._best_criteria:<EOL><INDENT>self._best_criteria = cri_val<EOL>return True<EOL><DEDENT>elif not self._smaller_is_better and cri_val > self._best_criteria:<EOL><INDENT>self._best_criteria = cri_val<EOL>return True<EOL><DEDENT>else:<EOL><INDENT>return False<EOL><DEDENT><DEDENT>
Compare to previous records and return whether the given cost is a new best.
:return: True if the given cost is a new best