Optimal offending in view of the offender's criminal record