Added agent.cpp file that implements the functions in agent.h.