- Timestamp:
- 08/18/17 22:08:42 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/genetics/f1/conv_f1.cpp
r671 r672 18 18 { 19 19 public: 20 Builder(const char*g, int mapping = 0) :invalid(0), genbegin(g), usemapping(mapping), first_part_mapping(NULL), model_energy(0), model_energy_ max(0) {}20 Builder(const char*g, int mapping = 0) :invalid(0), genbegin(g), usemapping(mapping), first_part_mapping(NULL), model_energy(0), model_energy_count(0) {} 21 21 ~Builder() { SAFEDELETE(first_part_mapping); } 22 22 char tmp[222]; … … 39 39 MultiRange *first_part_mapping; 40 40 double lastjoint_muscle_power; 41 double model_energy, model_energy_max; 41 double model_energy; 42 int model_energy_count; 42 43 void grow(int part1, const char*g, Pt3D k, F1Props c); 43 44 void setPartMapping(int p, const char* g); … … 111 112 if (builder.invalid) return SString(); 112 113 builder.addPendingInputs(); 113 builder.model.startenergy = (builder.model_energy_ max > 0) ? (builder.model_energy / builder.model_energy_max) : 1.0;114 builder.model.startenergy = (builder.model_energy_count > 0) ? (builder.model_energy / builder.model_energy_count) : 1.0; 114 115 builder.model.close(); // model is ready to use now 115 116 if (map) builder.model.getCurrentToF0Map(*map); // generate f1-to-f0 conversion map … … 209 210 } 210 211 model_energy += 0.9*c.energy + 0.1; 211 model_energy_ max += 1.0;212 model_energy_count++; 212 213 213 214 int part2 = growPart(c, g);
Note: See TracChangeset
for help on using the changeset viewer.