def simulate(kernel, model, define_dict, blocking_constant, blocking_length):
kernel.clear_state()<EOL>for k, v in define_dict.items():<EOL><INDENT>kernel.set_constant(k, v)<EOL><DEDENT>kernel.set_constant(blocking_constant, blocking_length)<EOL>model.analyze()<EOL>return sum([cy for dscr, cy in model.results['<STR_LIT>']])<EOL>
Setup and execute model with given blocking length