EDIT: Based on comments it sounds like I need to explain the purpose. Users should be able to input their experimental design, meaning which variables they want, and what the levels of each variable are. Then my program makes every permutation of those (trials), randomizes the trials, and then iterates through them for the experiment. The output is all just a .csv string. So after each trial it outputs the value of each input variable, and then calculates and outputs the output variables.
I have it all working right now. But at the moment, I need to define the variables manually for the users, and then they can put a list of values in for each on their own. I also have to manually write conversions to strings for each variable, and then manually put them into the correct order and alignment for the csv file. My end goal is to allow them to create their own variables and add it to the experiment without my intervention, and force an implemetation of string output.
what I have:
List<float> levels = new List<float>();
levels.add(1f);
levels.add(2f);
levels.add(3f);
Experiment.variable1.levels = levels;
what I want:
Experiment.AddVariable(new Variable<float>(levels);
// note that Variable should conceivably be any type
// and all variables types should have a method to output its value as a
// string depending on what type it is.