Changeset 1329
- Timestamp:
- 12/26/24 01:43:47 (3 weeks ago)
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/nonstd_math.h
r1318 r1329 95 95 static constexpr unsigned int FPEX_INVALID = FE_INVALID; 96 96 static constexpr unsigned int FPEX_OVERFLOW = FE_OVERFLOW; 97 #elif defined IPHONE 97 #elif defined IPHONE || defined MACOS 98 98 // (not implemented but these constants are still needed) 99 99 static constexpr unsigned int FPEX_DIV0 = 0; -
experiments/frams/foraminifera/data/scripts/foraminifera.expdef
r1152 r1329 84 84 //world 85 85 SignalView.mode = 1; 86 World.wrldwat = 200;86 World.wrldwat = 50; 87 87 World.wrldsiz = micronsToFrams(100000); 88 88 World.wrldbnd = 1; -
experiments/frams/foraminifera/data/scripts/foraminifera.show
r1152 r1329 105 105 property: 106 106 id:feedtrans 107 name:Energy transfer 108 type:d 0 2 1 ~0.000 1~0.001~0.01107 name:Energy transfer per second 108 type:d 0 2 1 ~0.0005~0.001~0.002 109 109 110 110 property: 111 111 id:energy_nut 112 name:Nutrient energy 113 type:d 0 2 1 ~28908~108908~188908 112 name:Nutrient energy [ng Corg] 113 # shorter approximate values instead of precise picograms ~28908~108908~188908. Details in http://dx.doi.org/10.1016/j.jocs.2016.09.009 114 type:d 0 2 1 ~≈29~≈109~≈189 114 115 115 116 property: -
experiments/frams/multi-threading/test-mt.cmd
r703 r1329 4 4 5 5 rem real task: maximize fitness=velocity 6 rem frams "ex standard-mt" "ExpProperties.threads=%%T;" "ExpProperties.capacity=%%C;" "UserScripts.script_Multithreading_efficiency_test_args(0,120,10);" -q >exp-evol-speed\test_%%T_%%C.out6 rem frams "expdef standard-mt" "ExpProperties.threads=%%T;" "ExpProperties.capacity=%%C;" "UserScripts.script_Multithreading_efficiency_test_args(0,120,10);" -q >exp-evol-speed\test_%%T_%%C.out 7 7 8 8 … … 12 12 13 13 rem no mutation, no crossover, only cloning - so that the same genotype is always evaluated. Useful to measure "raw" efficiency of parallel computation 14 remframs "expdef standard-mt" "ExpProperties.threads=%%T;" "ExpProperties.p_mut=0;" "ExpProperties.p_xov=0;" "ExpProperties.capacity=%%C;" "UserScripts.script_Multithreading_efficiency_test_args(0,6,10);" -q >exp-evol-speed-nochange\test_%%T_%%C.out14 frams "expdef standard-mt" "ExpProperties.threads=%%T;" "ExpProperties.p_mut=0;" "ExpProperties.p_xov=0;" "ExpProperties.capacity=%%C;" "UserScripts.script_Multithreading_efficiency_test_args(0,6,10);" -q >exp-evol-speed-nochange\test_%%T_%%C.out 15 15 16 16 17 17 rem same as above but with a bigger genotype, so that the time spent on script processing is relatively shorter, and more time is used for pure simulation 18 remframs "expdef standard-mt" "ExpProperties.threads=%%T;" "ExpProperties.p_mut=0;" "ExpProperties.p_xov=0;" "ExpProperties.capacity=%%C;" "UserScripts.script_Multithreading_efficiency_test_args(6,6,10);" -q >exp-evol-speed-nochange-biggeno\test_%%T_%%C.out18 frams "expdef standard-mt" "ExpProperties.threads=%%T;" "ExpProperties.p_mut=0;" "ExpProperties.p_xov=0;" "ExpProperties.capacity=%%C;" "UserScripts.script_Multithreading_efficiency_test_args(6,6,10);" -q >exp-evol-speed-nochange-biggeno\test_%%T_%%C.out 19 19 20 20 -
framspy/FramsticksEvolution.py
r1312 r1329 67 67 68 68 def is_feasible_fitness_value(fitness_value: float) -> bool: 69 assert isinstance(fitness_value, float), f"feasible_fitness({fitness_value}): argument is not of type float, it is of type {type(fitness_value)}" # since we are using DEAP, we unfortunately must represent the fitness of an "infeasible solution" as a float...69 assert isinstance(fitness_value, float), f"feasible_fitness({fitness_value}): argument is not of type 'float', it is of type '{type(fitness_value)}'" # since we are using DEAP, we unfortunately must represent the fitness of an "infeasible solution" as a float... 70 70 return fitness_value != FITNESS_VALUE_INFEASIBLE_SOLUTION # ...so if a valid solution happens to have fitness equal to this special value, such a solution will be considered infeasible :/ 71 71 -
framspy/README.txt
r1195 r1329 27 27 framework ( https://deap.readthedocs.io/en/master/ ) to perform the optimization. 28 28 Supports multiple criteria, the generational architecture, and numerous parameters 29 to customize the evolutionary search. Invalid genotypes are assigned the fitness of "-1" 30 and the selection process is responsible for their extinction. 29 to customize the evolutionary search. 31 30 See "run-deap-examples.cmd". 32 31 -
framspy/dissimilarity/density_distribution.py
r1325 r1329 6 6 7 7 class DensityDistribution: 8 """Two dissimilarity measures based on the spatial distribution of two Models. The Model bounding box is divided into a grid of equally-sized cuboids, the number of which is the 'resolution' parameter cubed. Then the Model surface is covered with points; the density of the surface sampling is determined by the 'density' parameter. There are two versions of the measure. In the default version ('frequency'=False), asignature of each cuboid is the centroid and the number of samples. In the 'frequency'=True version, FFT is computed from the vector containing the number of samples in each cuboid. The final result of the dissimilarity measure is the distance between the signatures and it can be computed using EMD, L1, or L2 norms (the 'metric' parameter).8 """Two dissimilarity measures based on the spatial distribution of two Models. The Model bounding box is divided into a grid of equally-sized cuboids, the number of which is the 'resolution' parameter cubed. Then the Model surface is covered with points; the density of the surface sampling is determined by the 'density' parameter. There are two versions of the measure. In the default version ('frequency'=False), the signature of each cuboid is the centroid and the number of samples. In the 'frequency'=True version, FFT is computed from the vector containing the number of samples in each cuboid. The final result of the dissimilarity measure is the distance between the signatures and it can be computed using EMD, L1, or L2 norms (the 'metric' parameter). 9 9 """ 10 10 … … 43 43 def calculateNeighborhood(self,array,mean_coords): 44 44 """ Calculates number of elements for given sample and set ups the center of this sample 45 to the center of mass (calculated by mean of every coordinate) 45 to the center of mass (calculated by mean of every coordinate). 46 46 Args: 47 47 array ([[float,float,float],...,[float,float,float]]): array of voxels that belong to given sample. … … 61 61 62 62 63 def calculateDistPoints(self,point1, point2): 64 """ Returns Euclidean distance between two points 65 Args (distribution): 66 point1 ([float,float,float]) - coordinates of first point 67 point2 ([float,float,float]) - coordinates of second point 63 def calculateDistPoints(self, point1, point2): 64 """ Returns Euclidean distance between two samples (1D for frequency) or points (3D for distribution). 68 65 Args (frequency): 69 66 point1 (float) - value of the first sample 70 67 point2 (float) - value of the second sample 68 Args (distribution): 69 point1 ([float,float,float]) - coordinates of the first point 70 point2 ([float,float,float]) - coordinates of the second point 71 71 72 72 Returns: … … 74 74 """ 75 75 if self.frequency: 76 return abs(point1-point2) # TODO vector instead of scalar returned?76 return abs(point1-point2) 77 77 else: 78 78 return np.linalg.norm(point1-point2, ord=2) 79 79 80 80 81 def calculateDistanceMatrix(self, array1, array2):81 def calculateDistanceMatrix(self, array1, array2): 82 82 """ 83 83 Args: … … 138 138 steps3 ([float,float,float]): [size of interval for x axis, size of interval for y axis, size of interval for y axis] 139 139 140 Returns (frequency): 141 signature np.array(,dtype=np.float64): returns signatuere np.array of coefficients 140 142 Returns (distribution): 141 143 signature [np.array(,dtype=np.float64),np.array(,dtype=np.float64)]: returns signatuere [np.array of points, np.array of weights] 142 Returns (frequency):143 signature np.array(,dtype=np.float64): returns signatuere np.array of coefficients144 144 """ 145 145 edges_x,edges_y,edges_z = edges3 … … 212 212 213 213 def getVoxels(self,geno): 214 """Generates voxels for genotype using frams.ModelGeometry 214 """Generates voxels for genotype using frams.ModelGeometry. 215 215 216 216 Args: -
js/standard_expdef_demo/README.txt
r880 r1329 1 This is a simple demo/animation demonstrating the basic behavior of "standard.expdef" experiment definition in Framsticks.1 This is a simple demo/animation demonstrating the basic behavior of the "standard.expdef" experiment definition in Framsticks. 2 2 This demo uses Framsticks SDK and three.js. 3 3 Published online at http://www.framsticks.com/common/std_expdef.html
Note: See TracChangeset
for help on using the changeset viewer.