jasmineRepo / JAS-mine-core

JAS-mine maintains and develops the JAS simulation platform, a discrete-event tool-kit for agent-based and dynamic microsimulation modelling. This repository contains the core libraries. See www.jas-mine.net for more details.
European Union Public License 1.2
2 stars 5 forks source link

Allow `intputFolder` and `outputRootFolder` to be edited by reflection #47

Closed andrewbaxter439 closed 1 month ago

andrewbaxter439 commented 10 months ago

Setting these as static allows them to be edited using reflection from SimPaths calls:

@Transient
public static String inputFolder = "./input";

@Transient
public static String outputRootFolder = "./output";

e.g.:

Field inputDir = Experiment.class.getDeclaredField("inputFolder");
inputDir.setAccessible(true);
inputDir.set(null, root_dir + File.separator + "input");
inputDir.setAccessible(false);

can set the input folder and output folder according to new root_dir argument in SimPathsMultiRun.

I don't think this breaks or changes anything else @pbronka @justin-ven? A minor suggested tweak as I'm simultaneously working on a SimPaths possibility for specifying an input/output folder (for potential tweaks for batch runs).

andrewbaxter439 commented 10 months ago

Also - I promise I'll start taking Christmas holidays and stop with pull requests for at least a good while 😁