An agent-based model of exaptive processes