2.5    Optimiser Cache

The role of cache is to accumulate the results of optimisation for consecutive values of the optimised variables. Thus when the same project is optimised several times, and with goal functions based on the same set of characteristics, its cache expands. By referring to cache, QW-OptimiserPlus avoids performing an identical simulation twice (and also performing a simulation for variable values within resolution from a previously simulated case). Moreover, it has more information for suggesting new variable values. Thus the use of cache facilitates faster converge towards the optimum solution.

If the optimisation is run again without clearing Cache, the process starts from the best point obtained in previous optimisation processes (unless changes of the enabled variable values have been made prior to the run) and taking into account the optimisation history. To start optimisation without taking the history into account, we need to clear the cache using  button in Optimiser tab of QW-Simulator Ribbon or Clear Cache command from Optimiser menu of QW-Simulator main menu prior to the start of optimiser. It is important to Clear Cache after most changes in the project and some changes in the Objectives for the project or the values of UDO parameters, which do not take part in the optimisation. Otherwise optimisation will be based on the irrelevant database and may lead to confusing results.

Changes made in the project or the UDO file from which the optimised object has been defined, other than changes of values of variables of the optimised object or purely cosmetic changes of e.g. colours, will make the accumulated cache illegal for further use. QW-OptimiserPlus has no way of detecting such changes. It is the user’s responsibility to delete cache  when the project has been modified.

Moreover, some changes of the QW-OptimiserPlus parameters (made in the Parameters tab of Configure Optimiser dialogue) may also make the accumulated cache illegal for further use. Some of such changes can be detected by QW-OptimiserPlus, which then stops and issues a message: “Invalid cache – clear cache before optimisation”. Other changes are not detected, and again it is the user’s responsibility to know when the cache must be cleared.

As a reference, consider what data are stored in cache. The cache contains data for consecutive simulations during the optimisation process. For each simulation, it begins with numerical values of all variables of the optimised object (zero is stored for string variables). It further contains consecutive characteristics calculated by QW-Simulator, which are used for defining the objectives and building the goal function.

 

There are two important conclusions about variables and objectives in cache.

Variables:

The values of all variables, enabled as well as disabled for optimisation, are stored in cache. Therefore if the project is optimised several times, with respect to various sub-sets of variables in the Variable tab of Configure Optimiser dialogue, the cache remains valid. Similarly, changes of Lower, Upper or Resolution for the variables do not make cache invalid. Changes between Optimise and Grid Search regimes are also allowed and both regimes save their results to the same cache file.

Of course, if the whole set of variables is modified by the Load UDO… command from the Variables tab of Configure Optimiser dialogue, the cache typically becomes invalid. Therefore QW-OptimiserPlus suggests clearing the cache upon the Load UDO... button.

Objectives:

Objectives are saved in cache in their full Freq/Angle Range. Typical Edit operations on Objectives, such as changing their Target, Lower and Upper or the Sub-Range, do not make the cache invalid. On the other hand, changes of the Radiation Pattern settings via Antenna Settings… (e.g., changes of frequency, reference axis, constant angle, range) require that the cache be cleared before further optimisation.

As regards the Add and Remove operations in the Objective tab of Configure Optimiser dialogue, a safe approach is to assume that the cache should be cleared after all such changes. Strictly speaking, this is indeed necessary after any Add and Remove operations for the Radiation Pattern objectives. In the case of Scattering Parameters and FD probing objectives, some Add and Remove operations do not require clearing the cache. If two objectives in the Objective tab of Configure Optimiser dialogue are based on the same S-Parameters or FD-Probing characteristic, for example, on the same |S11| curve, then removing one of these objectives does not make the cache invalid. Similarly, adding a new objective based on the same S-Parameters or FD-Probing characteristic on which one of the already existing objectives is based, does not make the cache invalid.

The Enable and Disable operations in the Objective tab should be treated like the Add and Remove operations, from the viewpoint of validity of the cache.

Cache is a text file and can be inspected with a text editor. A more convenient way of inspecting the cache is using the  button in Optimiser tab of QW-Simulator Ribbon or View Optimiser Cache command from Optimiser menu of QW-Simulator main menu. It opens the View Optimiser Cache dialogue. By default, it tries to load projectname.cache file from the project directory. While all variables from the Variables tab are saved in cache, the View Optimiser Cache window shows only the currently enabled variables. On the other hand, the cache contains the characteristics on which the objectives are based, and not the values of the individual objectives or the goal function at consecutive optimisation steps recorded in cache. The values shown in the Goal Function column are re-calculated when the cache is loaded, using the current definitions of the objectives for the project. Thus the display of the cache in the View Optimiser Cache dialogue depends not only on the contents of the loaded projectname.cache file, but also on the contents of the projectname.xyp file from the current project directory. If the projectname.xyp file cannot be found, or of its contents are inconsistent with the cache contents (e.g., a Radiation Pattern objective has been added or deleted with respect to the settings when the cache was accumulated), the cache will not be displayed.

The Load Cache button allows the user to select and inspect another cache file. This file must be accompanied by a consistent *.xyp file in the same directory.