Made some classes serializable.

Changed the code of some behaviours of the equipletAgent so it is shorter.