Core train and test code of AMPT based on APT.