Newer
Older
package mp.Model;
import java.io.File;
import java.util.Arrays;
public class ParameterGroupBuilder {
static public ParameterGroup buildSettings(){
ParameterGroup settings = new ParameterGroup("General", "General settings that apply to all curves");
settings.list.add(new IntegerParameter("numberOfElements",40, "Number of points that will make up the curve. Should be between 40 and 200 to limit computation time"));
settings.list.add(new IntegerParameter("numberOfTimesteps", 100, "Number of snapshots of evolution"));
settings.list.add(new StringParameter("UserDirectory", "Output"));
settings.list.add(new StringParameter("SurfaceName", "evolution"));
File dataFiles = new File( "DataFiles");
settings.list.add(new StringParameter("DataFileDirectory",dataFiles.getAbsolutePath()));
return settings;
}
static public ParameterGroup buildCurve(String name){
ParameterGroup curve = new ParameterGroup(name);
curve.list.add(new OptionParameter("boundaryConditions",
Arrays.asList(new Option("periodic", "Periodic curve."),
new Option("dirichlet","Curve has on fixed point.")),0, "You should stay with periodic."));
curve.list.add(new BooleanParameter("selfAvoidance", false,"Curve avoid selfintersections. Drastically increases computation time!!"));
curve.list.add(new DoubleParameter("tStart", 0., "Start of virtual timeline"));
curve.list.add(new DoubleParameter("tEnd", 1., "End of virtual timeline"));
curve.list.add(new OptionParameter("initialCurve",
Arrays.asList( new Option("trefoilKnot","Simplest nontrivial Knot"),
new Option("pringles", "Simple knot that resembles the shape of crisps"),
new Option("squareKnot", ""),
new Option("grannyKnot",""),
new Option("compoundQuadrupleKnot", "Complex, flowerlike knot"),
new Option("FigureEightInner", "First variation of the Figure Eight knot"),
new Option("FigureEightOuter", "Second variation of the Figure Eight knot"),
new Option("trigParametrization", "<html>Complex formula that allows parametrization of 10 variables.<br>"+
"x = m * cos(p * x) + n * cos(q * x) + o * cos(r * x)<br>"+
"y = m * sin(p * x) + n * sin(q * x) + o * cos (r * x)<br>"+
"z = h * sin(s * x) + g * sin(t * x)</html>")),
0, "Determines type of initial curve"));
ParameterGroup trig = new ParameterGroup("trigParametrization", "<html>Only used if initialCurve is set to trigparametrization<br>Complex formula that allows parametrization of 10 variables.<br>"
+ "x = m * cos(p * x) + n * cos(q * x) + o * cos(r * x)<br>"
+ "y = m * sin(p * x) + n * sin(q * x) + o * cos (r * x)<br>"
+ "z = h * sin(s * x) + g * sin(t * x)</html>");
trig.list.add(new DoubleParameter("m",1.,"Variable 'm' for formula. See tooltip of <trigParametrization>"));
trig.list.add(new DoubleParameter("n",1.,"Variable 'n' for formula. See tooltip of <trigParametrization>"));
trig.list.add(new DoubleParameter("o",1.,"Variable 'o' for formula. See tooltip of <trigParametrization>"));
trig.list.add(new DoubleParameter("h",1.,"Variable 'h' for formula. See tooltip of <trigParametrization>"));
trig.list.add(new DoubleParameter("g",1.,"Variable 'g' for formula. See tooltip of <trigParametrization>"));
trig.list.add(new DoubleParameter("p",1.,"Variable 'p' for formula. See tooltip of <trigParametrization>"));
trig.list.add(new DoubleParameter("q",1.,"Variable 'q' for formula. See tooltip of <trigParametrization>"));
trig.list.add(new DoubleParameter("r",1.,"Variable 'r' for formula. See tooltip of <trigParametrization>"));
trig.list.add(new DoubleParameter("s",1.,"Variable 's' for formula. See tooltip of <trigParametrization>"));
trig.list.add(new DoubleParameter("t",1.,"Variable 't' for formula. See tooltip of <trigParametrization>"));
curve.list.add(trig);
curve.list.add(new OptionParameter("velocity",
Arrays.asList(new Option("bumps", "One direction (x,y or z) is 1 for a fragment of length p, then the next one..."),
new Option("clelie", "takes values from clelie curve with parameter p"),
new Option("everyPoint", "takes values from stream for every Point"),
new Option("interpolation","takes values from stream for gridpoints and interpolates in between"),
new Option("gaussian", "Select one Point 'x' that gets values from stream. "+System.lineSeparator()+
"Other point are calculated around this point by a Gaussian function with parameters (0.,sigmaValues). Specify below!."+System.lineSeparator()+
" After each timestep, 'x' is moves randomly by a gaussian distribution with parameters (expectedShift,varianceShift). Specify below!")
), 0, "Mathematical transformation from inputdata 'p' to usable velocities. 'p' is updated every timestep."));
ParameterGroup velocity = new ParameterGroup("velocity", "Specify configuration of file stream and other details");
velocity.list.add(new OptionParameter("stream", Arrays.asList(
new Option("sentiment", "sentiment analysis of 'textFile' using 'sentimentFile'"),
new Option("invertedSentiment", "inverted sentiment"),
new Option("wordLength", "counts letter per word in 'textFile'"),
new Option("timeSeries", "takes values from 'timeSeriesFile")),
0, "Specifies source for value stream"));
velocity.list.add(new StringParameter("sentimentFile","AFINN_cleaned", "Should be placed in elasticcurve/DataFiles"));
velocity.list.add(new StringParameter("textFile", "MulhollandDrive.txt", "Should be placed in elasticcurve/DataFiles"));
velocity.list.add(new StringParameter("timeSeriesFile", "BitcoinChangeRelative.tsv", "Should be placed in elasticcurve/DataFiles. Should only contain whitespace seperated numbers!"));
velocity.list.add(new IntegerParameter("wordLengthShift", 5,"Subtracted from length of a word. Ignored if stream is not wordlength."));
velocity.list.add(new BooleanParameter("normalize",false,"normalize result vector to length 1"));
velocity.list.add(new BooleanParameter("scale", false, "Scale velocity with inverse of time, i.e. v(x) -> 1/t * v(x*t), with time t. Overrides Normalization!"));
velocity.list.add(new BooleanParameter("shift", false,"Shift velocity by time t, i.e. v(x) -> v(x+t)"));
curve.list.add(velocity);
ParameterGroup gaussian = new ParameterGroup("gaussian", "Parameters specifying gaussian velocity. Ignored for other velocities.");
gaussian.list.add(new DoubleParameter("expectedShift",1.,"Expectation of movement of point 'x'"));
gaussian.list.add(new DoubleParameter("varianceShift",1.,"Variance of movement of point 'x'"));
gaussian.list.add(new DoubleParameter("sigmaValues", 1.,"determines width of value distribution around point x"));
curve.list.add(gaussian);
curve.list.add(new DoubleParameter("kappa",1., "Factor for bending Energy. Determines 'speed' of untangling"));
curve.list.add(new DoubleParameter("gamma",-10., "Factor for Penalty 'Knicks' in curve. Posivitve values are taken directly, negative values are scaled by timestepsize(recommended)."));
curve.list.add(new DoubleParameter("lambda",-10., "Factor for Penalty changes in length of curve. Posivitve values are taken directly, negative values are scaled by timestepsize(recommended)."));
curve.list.add(new DoubleParameter("rho",0.001,"Factor for Penalty of selfintersections. Ignored if 'selfAvoidance' is false."));
return curve;
}
}