- Timestamp:
- 05/11/24 16:51:08 (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
framspy/recording-body-coords.sim
r1221 r1305 5 5 # If STORE_ALL_PART_COORDS=0 below, only COG is stored and the format is 6 6 # [ [cog1x,cog1y,cog1z], [cog2x,cog2y,cog2z], [cog3x,cog3y,cog3z], ...] 7 # where numbers are simulation steps.7 # where index numbers in the names are simulation steps. 8 8 # So you get a vector of COG x,y,z coordinates repeated for every simulation step. 9 9 # 10 10 # If STORE_ALL_PART_COORDS=1 below, the format is more verbose with one more level of nesting, because after the COG, 11 # the list of coordinates of all Parts follows (the first number below is the simulation step, the secondis Part number)11 # the list of coordinates of all Parts follows (the first index in the names below is the simulation step, the second one is Part number) 12 12 # [ [[cog1x,cog1y,cog1z], [p1_1x,p1_1y,p1_1z], [p1_2x,p1_2y,p1_2z], ...], ...] 13 13 # … … 25 25 { 26 26 super_onBorn(cr); 27 cr.data->bodyrecording=[]; // create key and initialize its value in the "data" dictionary27 cr.data->bodyrecording=[]; //in the creature's "data" dictionary, create the key "bodyrecording" and initialize its value to empty vector. Equivalent to cr.data["bodyrecording"]=[] 28 28 } 29 29 … … 49 49 super_addGenotypePerformanceFromCreature(g, cr); 50 50 51 g.data->bodyrecording = cr.data->bodyrecording; //no averaging or any other form of aggregation - here assuming we only evaluate a g enotype once; if not, then we ignore (overwrite) recordings from previous evaluations51 g.data->bodyrecording = cr.data->bodyrecording; //no averaging or any other form of aggregation - here assuming we only evaluate a given Genotype object once; if not, then we ignore (overwrite) recordings from previous evaluations of this genotype 52 52 53 53 //Simulator.print("Recorded time steps: %d" % g.data->bodyrecording.size); //just for debugging
Note: See TracChangeset
for help on using the changeset viewer.