You need to make this a member variable of the enclosing class that you probably want to set up at the end of parse_parameters. Otherwise you will only ever get to initialize it once at the first time of the program, but will get wrong results if you run the simulator twice on different input files.