the hawkes simulation code