Tree simulator by Z. Burda, M. Kotwica and K. Malarz (see arXiv:2005.11506). ---------------- The code 'tree_simulator.c' is written in C. It can be compiled in the following way: cc -O tree_simulator.c -lm and executed from the command line as follows ./a.out < input_parameters.dat or ./a.out < input_parameters.dat > output.dat & or ./a.out < input_parameters.dat >> output.dat & Execution requires an input file: 'input_parameters.dat' and four subdirectories which have to be created in the main directory before the program is run: BSD/ DD/ NDD/ TOM/ The directories are used to store histograms of - branch size distribution - distance distribution - node degree distribution - tree tomography = tree crown distribution respectively. The input parameters are defined in the first line of the file 'input_parameters.dat'. There are 7 parameters: init_option v_option mc_option n_vertices seed n_sweeps h_storage_frequency An example: 2 1 1 128 173462 1000 100 The meaning of the parameters, in the order of appearance: 1 init_option 0= continue from 'input_configuration.dat'; 1= random tree (random Pruefer code) 2= exponential growing tree; 3= Barabasi-Albert tree; 4= line graph; 5= star graph; 2 v_option 0= independent trees (applies only if init_option = 1|2|3) 1= leaf reshuffling 2= branch reshuffling 3 mc_option 1= random free trees: p(q) = 1/e 1/(q-1)! 2= random exponential trees: p(q) = 2^(-q) 3= random trees with BA distribution: p(q) = 4/q(q+1)(q+2) 4 number of vertices V 3-100000 5 seed for random generator (drand48) 0-2147483647 6 number of sweeps (each sweep = V attempts) 7 frequency of histogram recording ---------------- For the parametrs in the example given above: 2 1 1 128 173462 1000 100 +--------+--------------------------------------------------+ | 2 | simulations start from exponential growing trees | | 1 | trees evolve by reshuffling of leaves | | 1 | detailed balance condition is as for free trees | | 128 | trees have 128 vertices | | 173462 | seed of drand48() is 173462 | | 1000 | number of sweeps is 1000 | | 100 | histograms are recorded every 100 sweeps | +-------+---------------------------------------------------+ ---------------- If init_option=0 for run continuation is set, the simulation will start from the configuration stored at the end of the previous run in 'config.dat'. The file 'config.dat' will be automatically renamed to 'old_config.dat'. The numbering of sweeps will start from the number read in from 'config.dat', so the value of the parameter 6 must be larger than the previous number sweeps. ---------------- The structure of the output is: # sd(degree), #nleaves/#leaves, mean(dist), max(dist), #layers, stem_length 1 # = the measurement number 2 sd(degree) = standard deviation of the node degree distribution 3 #nleaves/#leaves = ratio of the numbers of leaves' neighbours and of leaves 4 mean(dist) = mean distance between nodes 5 max(dist) = maximal distance nodes (diameter) 6 #layers = the depth of the crown-distribution 7 stem_length = the number of nodes of the stem (spine) ----------------- Histograms are stored in the directories BDS/ DD/ NDD/ TOM/ as mentioned above. They are recorded with the frequency given by the parameter 7 of the input file 'input_parameter.dat'. At the end of each run also cumulative histograms are recorded in 'cum_hist.dat' files in BDS/ DD/ NDD/ TOM/