Changeset 672 for cpp/frams


Ignore:
Timestamp:
08/18/17 22:08:42 (7 years ago)
Author:
Maciej Komosinski
Message:

More appropriate name for the "model_energy_max" variable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/f1/conv_f1.cpp

    r671 r672  
    1818{
    1919public:
    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) {}
    2121        ~Builder() { SAFEDELETE(first_part_mapping); }
    2222        char tmp[222];
     
    3939        MultiRange *first_part_mapping;
    4040        double lastjoint_muscle_power;
    41         double model_energy, model_energy_max;
     41        double model_energy;
     42        int model_energy_count;
    4243        void grow(int part1, const char*g, Pt3D k, F1Props c);
    4344        void setPartMapping(int p, const char* g);
     
    111112        if (builder.invalid) return SString();
    112113        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;
    114115        builder.model.close(); // model is ready to use now
    115116        if (map) builder.model.getCurrentToF0Map(*map); // generate f1-to-f0 conversion map
     
    209210                        }
    210211                        model_energy += 0.9*c.energy + 0.1;
    211                         model_energy_max += 1.0;
     212                        model_energy_count++;
    212213
    213214                        int part2 = growPart(c, g);
Note: See TracChangeset for help on using the changeset viewer.