sweep parameter optimization and use restart