Batch codes for simulation