I'm trying to use a genetic algorithm to iterate over my model, tuning the FIS parameters that i'm passing into the FLC in my Simulink model. Currently, the MATLAB code looks similar to the following:
global generic_fis;% generic_fis = object.convertChromosome2FIS(chromosome); (edited out as not strictly accurate - replaced with following)
generic_fis = newfis('testfis');sim(mdl);
Where generic_fis is specified as the input parameter to the Fuzzy Logic Controller block. I've also tried saving this FIS to a file, i.e. 'tunableFIS.fis', and specifying this as the input parameter to the Fuzzy Logic Controller block, but this has yielded the same result. Essentially, in Accelerator mode the model builds every time the sim() command is called. I've read through previous questions about this, which seem to indicate that any tunable parameters need to be contained within an inport to the model, but I'm not sure how to apply this to a Fuzzy Logic Controller since what i'm altering is the parameter of this block, and I'm not sure how to use a model variable to change this value as the only input available for this block is the input signal.
So to summarise, my question is: How do I stop the model re-building/initialising every time the sim() command is called in accelerator/rapid accelerator mode given that what i'm trying to update is the FIS parameter of the Fuzzy Logic Controller block?
Cheers,
Sam
Best Answer