//=========================================================================== // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== void ScaleFuzzySeperator_r(fuzzyseperator_t * fs, float scale) { if(fs->child) { ScaleFuzzySeperator_r(fs->child, scale); } //end if else if(fs->type == WT_BALANCE) { // fs->weight = (fs->maxweight + fs->minweight) * scale; //get the weight between bounds if(fs->weight < fs->minweight) { fs->weight = fs->minweight; } else if(fs->weight > fs->maxweight) { fs->weight = fs->maxweight; } } //end else if if(fs->next) { ScaleFuzzySeperator_r(fs->next, scale); } } //end of the function ScaleFuzzySeperator_r
void ScaleWeight(weightconfig_t *config, char *name, float scale) { int i; if (scale < 0) scale = 0; else if (scale > 1) scale = 1; for (i = 0; i < config->numweights; i++) { if (!strcmp(name, config->weights[i].name)) { ScaleFuzzySeperator_r(config->weights[i].firstseperator, scale); break; } //end if } //end for } //end of the function ScaleWeight
/* ======================================================================================================================================= ScaleWeight ======================================================================================================================================= */ void ScaleWeight(weightconfig_t *config, char *name, float scale) { int i; if (scale < 0) { scale = 0; } else if (scale > 1) { scale = 1; } for (i = 0; i < config->numweights; i++) { if (!strcmp(name, config->weights[i].name)) { ScaleFuzzySeperator_r(config->weights[i].firstseperator, scale); break; } } }