A custom clone method is helpful; allowing planning actions to provide their own has advantages:
- A planning action knows what state it modifies. With a well structured model planning action can return a shallow copy, with only relevant sections re-allocated (uses less memory)
- In turn this makes equality compares much faster, because un-modified refs can be detected right away.