Domain-wall motion in random potential and hysteresis modeling