## 4 Design and Implementation of the Optimization Framework
### iMASKO Options via Command Lines and GUI  
iMASKO provides a series of interfaces to configure the optimization/evaluation process by command lines, which are shown in _Italics_ and **bold** letters in this section. iMASKO command line options consist of five parts which are platform selection, simulation parameter configuration, GA configuration, seed generator, and result saving respectively. * _Platform selection_: this part is to load the more platforms. Executable files of SystemC simulation are placed under the same folder, which contains several more platforms  
Figure 4: 4D plot for multi-objective based multi-scenario optimization [39]. implemented in our SystemC simulation environment (including iHop@Node [40], Telos [41], MICAz, MICA2). The option _-n <platform>_ is adopted to select the specific mode platform for the optimization experiments. An example command line can be given as: >_/imasko -n Telos_. * _Simulation parameters config_: this part is used to set the corresponding parameters of SystemC simulation, such as sample rate, sample times, CSMA/CA algorithm, output power, receiver sensitivity, and independent simulation run times. The corresponding options in iMASKKO for the above parameter settings are _-sr <samplerate>_, _-st <simulationtimes>_, _-alg <algorithm>_, _-op <outputwr>_, _-rs <sensitivity>_ and _-r <runs>_. Among the options, _samplerate_, _simulationtimes_, _algorithm (0-unslotted, 1-slotted)_, _outputwr_, _sensitivity_, and _runs_ are all integers. An example command line would be: >_/imasko -sr 10 -st 100 -alg 0 -op 0 -rs -95 -50_, which means that the sample rate is set as 10 Hz, the simulation runs for 100 ms, unslotted CSMA/CA is selected, output power is set as 0 dBm, receiver sensitivity is configured as -95 dBm and finally 50 independent simulations (different seeds) are required for average results. Default values will be used if the corresponding parameters are not set in the command line. * _GA config:_ GA related parameters are configured in this part. Parameter space under GA optimization can be configured by setting their upper and lower boundaries. In the experiment of this work, the options _-lbminBE <minBElb>_, _-ubminBE <minBEub>_, _-lbmaxBE <maxBElb>_, _-ubmaxBE <maxBEub>_, _-lbBackoff <Backofflb>_, _-ubBackoff <Backofflb>_, _-lbRetries<Retrieslb>_ and _-ubRetries<Retriesub>_ are used to specify the lower and upper bounds of the unslotted algorithm's four parameters, which are _macMinBE_, _macMaxBE_, _macMaxCSMABackoffs_ and _macMaxFrameRetries_. These boundary values are used to limit the parameter space range during the whole optimization process, and they can also be employed to initialize the _PopInitRange_ parameter in GA at the very beginning of the optimization. In addition, other commonly used GA parameters are also configurable by command lines, the provided parameters include GA's _PopulationSize_, _Generations_, _CrossoverFraction_, _CreationFcn_, _SelectionFcn_, _MutationFcn_, _CrossoverFcn_. The corresponding options in iMASKKO are _-ps <populationsize>_, _-g <generations>_, _-cf <crossoverfraction>_, _-creatf <@creationfunction>_, _-selectcf <@selectionfunction>_, _-muf <@mutationfunction>_, and _-crossf <@crossoverflowfunction>_. Among these options, _populationsize_ and _generations_ are integers, _crossoverfraction_ is a float number within the range 0 through 1. Finally, _creationfunction_, _selectionfunction_, _mutationfunction_, and _crosssoverfunction_ are the names of the functions which are provided by the GA library (e.g., _@gacreationuniform_, _@selectionstochunif_, _@mutationgaussian_, _@crossoverscattered_) or the user custom functions. Likewise, if the parameters are not set via the command line, default values will be used. An example command line can be: >_/imasko -ps 20 -g 100 -cf 0.8 -muf @mutationgaussian_.