Investigating strain hardening by simulations of dislocation dynamics