An agent-based implementation of Schelling's segregation model