Modify this to generate weights from trajectoryFile.txt.